4 commits - system/application
by pshah
system/application/assets/css/admin-style.css | 3
system/application/assets/css/style.css | 7
system/application/assets/css/thickbox.css | 156 ++++++++++
system/application/assets/images/thickbox/loadingAnimation.gif |binary
system/application/assets/images/thickbox/macFFBgHack.png |binary
system/application/assets/js/thickbox-compressed.js | 10
system/application/controllers/admin/status.php | 24 +
system/application/controllers/admin/welcome.php | 73 ----
system/application/controllers/log.php | 3
system/application/controllers/setting.php | 44 ++
system/application/controllers/voucher.php | 20 +
system/application/controllers/welcome.php | 4
system/application/libraries/Statuscheck.php | 76 ++++
system/application/models/tag_model.php | 6
system/application/views/admin/status.php | 19 +
system/application/views/admin/welcome.php | 8
system/application/views/log/index.php | 3
system/application/views/setting/change.php | 34 ++
system/application/views/tag/index.php | 2
system/application/views/template.php | 13
20 files changed, 420 insertions(+), 85 deletions(-)
New commits:
commit ccbed5a17aae0dcb657155963615c4af76e188ef
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Tue Dec 21 22:23:19 2010 +0530
Added Change active account thickbox
- Using the jQuery Thickbox Plugin
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
diff --git a/system/application/assets/css/admin-style.css b/system/application/assets/css/admin-style.css
index 8c7c565..9b51bd3 100644
--- a/system/application/assets/css/admin-style.css
+++ b/system/application/assets/css/admin-style.css
@@ -115,7 +115,6 @@ body {
border:solid 1px #787878;
background:#F0F0F0;
color:#222222;
- padding:0 10px 0 10px;
margin:0 0 10px 0;
text-align:left;
}
@@ -124,7 +123,6 @@ body {
border:solid 1px #C34A2C;
background:#FFBABA;
color:#222222;
- padding:0 10px 0 10px;
margin:0 0 10px 0;
text-align:left;
}
@@ -133,7 +131,6 @@ body {
border:solid 1px #FFEC8B;
background:#FFF8C6;
color:#222222;
- padding:0 10px 0 10px;
margin:0 0 10px 0;
text-align:left;
}
diff --git a/system/application/assets/css/style.css b/system/application/assets/css/style.css
index 7bf6cb8..7cda02a 100644
--- a/system/application/assets/css/style.css
+++ b/system/application/assets/css/style.css
@@ -121,7 +121,6 @@ body {
border:solid 1px #787878;
background:#F0F0F0;
color:#222222;
- padding:0 10px 0 10px;
margin:0 0 10px 0;
text-align:left;
}
@@ -130,7 +129,6 @@ body {
border:solid 1px #C34A2C;
background:#FFBABA;
color:#222222;
- padding:0 10px 0 10px;
margin:0 0 10px 0;
text-align:left;
}
@@ -139,7 +137,6 @@ body {
border:solid 1px #FFEC8B;
background:#FFF8C6;
color:#222222;
- padding:0 10px 0 10px;
margin:0 0 10px 0;
text-align:left;
}
@@ -153,6 +150,10 @@ body {
font-weight:bold;
}
+.hidden-element {
+ display:none;
+}
+
a.no-underline {
text-decoration:none;
}
diff --git a/system/application/assets/css/thickbox.css b/system/application/assets/css/thickbox.css
new file mode 100644
index 0000000..f4bf673
--- /dev/null
+++ b/system/application/assets/css/thickbox.css
@@ -0,0 +1,156 @@
+/* ----------------------------------------------------------------------------------------------------------------*/
+/* ---------->>> thickbox specific link and font settings <<<------------------------------------------------------*/
+/* ----------------------------------------------------------------------------------------------------------------*/
+#TB_window {
+ font-size:14px;
+}
+
+#TB_secondLine {
+ color:#666666;
+}
+
+#TB_window a:link {color: #666666;}
+#TB_window a:visited {color: #666666;}
+#TB_window a:hover {color: #000;}
+#TB_window a:active {color: #666666;}
+#TB_window a:focus{color: #666666;}
+
+/* ----------------------------------------------------------------------------------------------------------------*/
+/* ---------->>> thickbox settings <<<-----------------------------------------------------------------------------*/
+/* ----------------------------------------------------------------------------------------------------------------*/
+#TB_overlay {
+ position: fixed;
+ z-index:100;
+ top: 0px;
+ left: 0px;
+ height:100%;
+ width:100%;
+}
+
+.TB_overlayMacFFBGHack {background: url(../images/thickbox/macFFBgHack.png) repeat;}
+.TB_overlayBG {
+ background-color:#000;
+ filter:alpha(opacity=75);
+ -moz-opacity: 0.75;
+ opacity: 0.75;
+}
+
+* html #TB_overlay { /* ie6 hack */
+ position: absolute;
+ height: expression(document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight : document.body.offsetHeight + 'px');
+}
+
+#TB_window {
+ position: fixed;
+ background: #ffffff;
+ z-index: 102;
+ color:#000000;
+ display:none;
+ border: 4px solid #525252;
+ text-align:left;
+ top:50%;
+ left:50%;
+}
+
+* html #TB_window { /* ie6 hack */
+position: absolute;
+margin-top: expression(0 - parseInt(this.offsetHeight / 2) + (TBWindowMargin = document.documentElement && document.documentElement.scrollTop || document.body.scrollTop) + 'px');
+}
+
+#TB_window img#TB_Image {
+ display:block;
+ margin: 15px 0 0 15px;
+ border-right: 1px solid #ccc;
+ border-bottom: 1px solid #ccc;
+ border-top: 1px solid #666;
+ border-left: 1px solid #666;
+}
+
+#TB_caption{
+ height:25px;
+ padding:7px 30px 10px 25px;
+ float:left;
+}
+
+#TB_closeWindow{
+ height:25px;
+ padding:11px 25px 10px 0;
+ float:right;
+}
+
+#TB_closeAjaxWindow{
+ padding:7px 10px 5px 0;
+ margin-bottom:1px;
+ text-align:right;
+ float:right;
+}
+
+#TB_ajaxWindowTitle{
+ float:left;
+ padding:7px 0 5px 10px;
+ margin-bottom:1px;
+}
+
+#TB_title{
+ background-color:#e8e8e8;
+ height:27px;
+}
+
+#TB_ajaxContent{
+ clear:both;
+ padding:2px 15px 15px 15px;
+ overflow:auto;
+ text-align:left;
+ line-height:1.4em;
+}
+
+#TB_ajaxContent.TB_modal{
+ padding:15px;
+}
+
+#TB_ajaxContent p{
+ padding:5px 0px 5px 0px;
+}
+
+#TB_load{
+ position: fixed;
+ display:none;
+ height:13px;
+ width:208px;
+ z-index:103;
+ top: 50%;
+ left: 50%;
+ margin: -6px 0 0 -104px; /* -height/2 0 0 -width/2 */
+}
+
+* html #TB_load { /* ie6 hack */
+position: absolute;
+margin-top: expression(0 - parseInt(this.offsetHeight / 2) + (TBWindowMargin = document.documentElement && document.documentElement.scrollTop || document.body.scrollTop) + 'px');
+}
+
+#TB_HideSelect{
+ z-index:99;
+ position:fixed;
+ top: 0;
+ left: 0;
+ background-color:#fff;
+ border:none;
+ filter:alpha(opacity=0);
+ -moz-opacity: 0;
+ opacity: 0;
+ height:100%;
+ width:100%;
+}
+
+* html #TB_HideSelect { /* ie6 hack */
+ position: absolute;
+ height: expression(document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight : document.body.offsetHeight + 'px');
+}
+
+#TB_iframeContent{
+ clear:both;
+ border:none;
+ margin-bottom:-1px;
+ margin-top:1px;
+ _margin-bottom:1px;
+}
diff --git a/system/application/assets/images/thickbox/loadingAnimation.gif b/system/application/assets/images/thickbox/loadingAnimation.gif
new file mode 100644
index 0000000..82290f4
Binary files /dev/null and b/system/application/assets/images/thickbox/loadingAnimation.gif differ
diff --git a/system/application/assets/images/thickbox/macFFBgHack.png b/system/application/assets/images/thickbox/macFFBgHack.png
new file mode 100644
index 0000000..c6473b3
Binary files /dev/null and b/system/application/assets/images/thickbox/macFFBgHack.png differ
diff --git a/system/application/assets/js/thickbox-compressed.js b/system/application/assets/js/thickbox-compressed.js
new file mode 100644
index 0000000..28364be
--- /dev/null
+++ b/system/application/assets/js/thickbox-compressed.js
@@ -0,0 +1,10 @@
+/*
+ * Thickbox 3 - One Box To Rule Them All.
+ * By Cody Lindley (http://www.codylindley.com)
+ * Copyright (c) 2007 cody lindley
+ * Licensed under the MIT License: http://www.opensource.org/licenses/mit-license.php
+*/
+
+var tb_pathToImage = "images/loadingAnimation.gif";
+
+eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('$(o).2S(9(){1u(\'a.18, 3n.18, 3i.18\');1w=1p 1t();1w.L=2H});9 1u(b){$(b).s(9(){6 t=X.Q||X.1v||M;6 a=X.u||X.23;6 g=X.1N||P;19(t,a,g);X.2E();H P})}9 19(d,f,g){3m{3(2t o.v.J.2i==="2g"){$("v","11").r({A:"28%",z:"28%"});$("11").r("22","2Z");3(o.1Y("1F")===M){$("v").q("<U 5=\'1F\'></U><4 5=\'B\'></4><4 5=\'8\'></4>");$("#B").s(G)}}n{3(o.1Y("B")===M){$("v").q("<4 5=\'B\'></4><4 5=\'8\'></4>");$("#B").s(G)}}3(1K()){$("#B").1J("2B")}n{$("#B").1J("2z")}3(d===M){d=""}$("v").q("<4 5=\'K\'><1I L=\'"+1w.L+"\' /></4>");$(\'#K\').2y();6 h;3(f.O("?")!==-1){h=f.3l(0,f.O("?"))}n{h=f}6 i=/\\.2s$|\\.2q$|\\.2m$|\\.2l$|\\.2k$/;6 j=h.1C().2h(i);3(j==\'.2s\'||j==\'.2q\'||j==\'.2m\'||j==\'.2l\'||j==\'.2k\'){1D="";1G="";14="";1z="";1x="";R="";1n="";1r=P;3(g){E=$("a[@1N="+g+"]").36();25(D=0;((D<E.1c)&&(R===""));D++){6 k=E[D].u.1C().2h(i);3(!(E[D].u==f)){3(1r){1z=E[D].Q;1x=E[D].u;R="<1e 5=\'1X\'>&1d;&1d;<a u=\'#\'>2T &2R;</a></1e>"}n{1D=E[D].Q;1G=E[D].u;14="<1e 5=\'1U\'>&1d;&1d;<a u=\'#\'>&2O; 2N</a></1e>"}}n{1r=1b;1n="1t "+(D+1)+" 2L "+(E.1c)}}}S=1p 1t();S.1g=9(){S.1g=M;6 a=2x();6 x=a[0]-1M;6 y=a[1]-1M;6 b=S.z;6 c=S.A;3(b>x){c=c*(x/b);b=x;3(c>y){b=b*(y/c);c=y}}n 3(c>y){b=b*(y/c);c=y;3(b>x){c=c*(x/b);b=x}}13=b+30;1a=c+2G;$("#8").q("<a u=\'\' 5=\'1L\' Q=\'1o\'><1I 5=\'2F\' L=\'"+f+"\' z=\'"+b+"\' A=\'"+c+"\' 23=\'"+d+"\'/></a>"+"<4 5=\'2D\'>"+d+"<4 5=\'2C\'>"+1n+14+R+"</4></4><4 5=\'2A\'><a u=\'#\' 5=\'Z\' Q=\'1o\'>1l</a> 1k 1j 1s</4>");$("#Z").s(G);3(!(14==="")){9 12(){3($(o).N("s",12)){$(o).N("s",12)}$("#8").C();$("v").q("<4 5=\'8\'></4>");19(1D,1G,g);H P}$("#1U").s(12)}3(!(R==="")){9 1i(){$("#8").C();$("v").q("<4 5=\'8\'></4>");19(1z,1x,g);H P}$("#1X").s(1i)}o.1h=9(e){3(e==M){I=2w.2v}n{I=e.2u}3(I==27){G()}n 3(I==3k){3(!(R=="")){o.1h="";1i()}}n 3(I==3j){3(!(14=="")){o.1h="";12()}}};16();$("#K").C();$("#1L").s(G);$("#8").r({Y:"T"})};S.L=f}n{6 l=f.2r(/^[^\\?]+\\??/,\'\');6 m=2p(l);13=(m[\'z\']*1)+30||3h;1a=(m[\'A\']*1)+3g||3f;W=13-30;V=1a-3e;3(f.O(\'2j\')!=-1){1E=f.1B(\'3d\');$("#15").C();3(m[\'1A\']!="1b"){$("#8").q("<4 5=\'2f\'><4 5=\'1H\'>"+d+"</4><4 5=\'2e\'><a u=\'#\' 5=\'Z\' Q=\'1o\'>1l</a> 1k 1j 1s</4></4><U 1W=\'0\' 2d=\'0\' L=\'"+1E[0]+"\' 5=\'15\' 1v=\'15"+1f.2c(1f.1y()*2b)+"\' 1g=\'1m()\' J=\'z:"+(W+29)+"p;A:"+(V+17)+"p;\' > </U>")}n{$("#B").N();$("#8").q("<U 1W=\'0\' 2d=\'0\' L=\'"+1E[0]+"\' 5=\'15\' 1v=\'15"+1f.2c(1f.1y()*2b)+"\' 1g=\'1m()\' J=\'z:"+(W+29)+"p;A:"+(V+17)+"p;\'> </U>")}}n{3($("#8").r("Y")!="T"){3(m[\'1A\']!="1b"){$("#8").q("<4 5=\'2f\'><4 5=\'1H\'>"+d+"</4><4 5=\'2e\'><a u=\'#\' 5=\'Z\'>1l</a> 1k 1j 1s</4></4><4 5=\'F\' J=\'z:"+W+"p;A:"+V+"p\'></4>")}n{$("#B").N();$("#8").q("<4 5=\'F\' 3c=\'3b\' J=\'z:"+W+"p;A:"+V+"p;\'></4>")}}n{$("#F")[0].J.z=W+"p";$("#F")[0].J.A=V+"p";$("#F")[0].3a=0;$("#1H").11(d)}}$("#Z").s(G);3(f.O(\'37\')!=-1){$("#F").q($(\'#\'+m[\'26\']).1T());$("#8").24(9(){$(\'#\'+m[\'26\']).q($("#F").1T())});16();$("#K").C();$("#8").r({Y:"T"})}n 3(f.O(\'2j\')!=-1){16();3($.1q.35){$("#K").C();$("#8").r({Y:"T"})}}n{$("#F").34(f+="&1y="+(1p 33().32()),9(){16();$("#K").C();1u("#F a.18");$("#8").r({Y:"T"})})}}3(!m[\'1A\']){o.21=9(e){3(e==M){I=2w.2v}n{I=e.2u}3(I==27){G()}}}}31(e){}}9 1m(){$("#K").C();$("#8").r({Y:"T"})}9 G(){$("#2Y").N("s");$("#Z").N("s");$("#8").2X("2W",9(){$(\'#8,#B,#1F\').2V("24").N().C()});$("#K").C();3(2t o.v.J.2i=="2g"){$("v","11").r({A:"1Z",z:"1Z"});$("11").r("22","")}o.1h="";o.21="";H P}9 16(){$("#8").r({2U:\'-\'+20((13/2),10)+\'p\',z:13+\'p\'});3(!(1V.1q.2Q&&1V.1q.2P<7)){$("#8").r({38:\'-\'+20((1a/2),10)+\'p\'})}}9 2p(a){6 b={};3(!a){H b}6 c=a.1B(/[;&]/);25(6 i=0;i<c.1c;i++){6 d=c[i].1B(\'=\');3(!d||d.1c!=2){39}6 e=2a(d[0]);6 f=2a(d[1]);f=f.2r(/\\+/g,\' \');b[e]=f}H b}9 2x(){6 a=o.2M;6 w=1S.2o||1R.2o||(a&&a.1Q)||o.v.1Q;6 h=1S.1P||1R.1P||(a&&a.2n)||o.v.2n;1O=[w,h];H 1O}9 1K(){6 a=2K.2J.1C();3(a.O(\'2I\')!=-1&&a.O(\'3o\')!=-1){H 1b}}',62,211,'|||if|div|id|var||TB_window|function||||||||||||||else|document|px|append|css|click||href|body||||width|height|TB_overlay|remove|TB_Counter|TB_TempArray|TB_ajaxContent|tb_remove|return|keycode|style|TB_load|src|null|unbind|indexOf|false|title|TB_NextHTML|imgPreloader|block|iframe|ajaxContentH|ajaxContentW|this|display|TB_closeWindowButton||html|goPrev|TB_WIDTH|TB_PrevHTML|TB_iframeContent|tb_position||thickbox|tb_show|TB_HEIGHT|true|length|nbsp|span|Math|onload|onkeydown|goNext|Esc|or|close|tb_showIframe|TB_imageCount|Close|new|browser|TB_FoundURL|Key|Image|tb_init|name|imgLoader|TB_NextURL|random|TB_NextCaption|modal|split|toLowerCase|TB_PrevCaption|urlNoQuery|TB_HideSelect|TB_PrevURL|TB_ajaxWindowTitle|img|addClass|tb_detectMacXFF|TB_ImageOff|150|rel|arrayPageSize|innerHeight|clientWidth|self|window|children|TB_prev|jQuery|frameborder|TB_next|getElementById|auto|parseInt|onkeyup|overflow|alt|unload|for|inlineId||100||unescape|1000|round|hspace|TB_closeAjaxWindow|TB_title|undefined|match|maxHeight|TB_iframe|bmp|gif|png|clientHeight|innerWidth|tb_parseQuery|jpeg|replace|jpg|typeof|which|keyCode|event|tb_getPageSize|show|TB_overlayBG|TB_closeWindow|TB_overlayMacFFBGHack|TB_secondLine|TB_caption|blur|TB_Image|60|tb_pathToImage|mac|userAgent|navigator|of|documentElement|Prev|lt|version|msie|gt|ready|Next|marginLeft|trigger|fast|fadeOut|TB_imageOff|hidden||catch|getTime|Date|load|safari|get|TB_inline|marginTop|continue|scrollTop|TB_modal|class|TB_|45|440|40|630|input|188|190|substr|try|area|firefox'.split('|'),0,{}))
\ No newline at end of file
diff --git a/system/application/controllers/setting.php b/system/application/controllers/setting.php
index f6af99a..3595c09 100644
--- a/system/application/controllers/setting.php
+++ b/system/application/controllers/setting.php
@@ -891,6 +891,50 @@ class Setting extends Controller {
}
return;
}
+
+ /* Change Active Account */
+ function change()
+ {
+ /* Form validations */
+ $this->form_validation->set_rules('select_account', 'Select Account', 'trim|required');
+
+ /* Validating form : only if label name is not set from URL */
+ if ($this->form_validation->run() == FALSE)
+ {
+ $this->messages->add(validation_errors(), 'error');
+ redirect("");
+ return;
+ } else {
+ /* Unsetting all database configutaion */
+ $this->session->unset_userdata('db_active_label');
+
+ $data_select_account = $this->input->post('select_account', TRUE);
+ $ini_file = $this->config->item('config_path') . "accounts/" . $data_select_account . ".ini";
+
+ /* Check if database ini file exists */
+ if ( ! get_file_info($ini_file))
+ {
+ $this->messages->add("Account setting file is missing.", 'error');
+ redirect("");
+ return;
+ }
+
+ /* Parsing database ini file */
+ $active_accounts = parse_ini_file($ini_file);
+ if ( ! $active_accounts)
+ {
+ $this->messages->add("Invalid account setting file.", 'error');
+ redirect("");
+ return;
+ }
+
+ /* Setting new account database details in session */
+ $this->session->set_userdata('db_active_label', $data_select_account);
+ $this->messages->add('Active account changed.', 'success');
+ redirect("");
+ }
+ return;
+ }
}
/* End of file setting.php */
diff --git a/system/application/views/setting/change.php b/system/application/views/setting/change.php
new file mode 100644
index 0000000..63e9eda
--- /dev/null
+++ b/system/application/views/setting/change.php
@@ -0,0 +1,34 @@
+<?php
+ /* Getting list of files in the config - accounts directory */
+ $accounts_list = get_filenames($this->config->item('config_path') . 'accounts');
+ $select_account_options = array();
+ if ($accounts_list)
+ {
+ foreach ($accounts_list as $row)
+ {
+ /* Only include file ending with .ini */
+ if (substr($row, -4) == ".ini")
+ {
+ $ini_label = substr($row, 0, -4);
+ $select_account_options[$ini_label] = $ini_label;
+ }
+ }
+ }
+
+ echo form_open('setting/change');
+
+ echo "<p>";
+ echo form_label('Select account', 'select_account');
+ echo "<br />";
+ echo form_dropdown('select_account', $select_account_options);
+ echo "</p>";
+
+ echo "<p>";
+ echo form_submit('submit', 'Change');
+ echo "</p>";
+ echo "<p>";
+ echo anchor('admin/manage', 'Manage Accounts', 'Manage Accounts');
+ echo "</p>";
+
+ echo form_close();
+
diff --git a/system/application/views/template.php b/system/application/views/template.php
index dfec3e2..7ecb824 100644
--- a/system/application/views/template.php
+++ b/system/application/views/template.php
@@ -10,6 +10,8 @@
<link type="text/css" rel="stylesheet" href="<?php echo asset_url(); ?>css/custom.css">
<link type="text/css" rel="stylesheet" href="<?php echo asset_url(); ?>css/menu.css">
<link type="text/css" rel="stylesheet" href="<?php echo asset_url(); ?>css/jquery.datepick.css">
+<link type="text/css" rel="stylesheet" href="<?php echo asset_url(); ?>css/thickbox.css">
+
<?php
/* Dynamically adding css files from controllers */
if (isset($add_css))
@@ -27,6 +29,7 @@ if (isset($add_css))
<script type="text/javascript" src="<?php echo asset_url(); ?>js/hoverIntent.js"></script>
<script type="text/javascript" src="<?php echo asset_url(); ?>js/superfish.js"></script>
<script type="text/javascript" src="<?php echo asset_url(); ?>js/supersubs.js"></script>
+<script type="text/javascript" src="<?php echo asset_url(); ?>js/thickbox-compressed.js"></script>
<?php
/* Dynamically adding javascript files from controllers */
if (isset($add_javascript))
@@ -68,7 +71,10 @@ $(document).ready(function() {
<div id="info">
<?php
echo $this->config->item('account_name');
- echo "<br />";
+ echo " (";
+ echo "<a href=\"#TB_inline?height=300&width=300&inlineId=changeActiveAccount\" class=\"thickbox anchor-link-a\" title=\"Change Active Account\">change</a>";
+ echo ")<br />";
+ echo "FY : ";
echo date_mysql_to_php_display($this->config->item('account_fy_start'));
echo " - ";
echo date_mysql_to_php_display($this->config->item('account_fy_end'));
@@ -182,5 +188,10 @@ $(document).ready(function() {
<?php if (isset($page_footer)) echo $page_footer ?>
<a href="http://webzash.wordpress.com" target="_blank">Webzash<a/> is licensed under <a href="http://www.gnu.org/licenses/agpl-3.0.txt" target="_blank">GNU Affero General Public License, version 3</a> as published by the Free Software Foundation.
</div>
+<div id="account_change" class="hidden-element">
+ <div id="changeActiveAccount">
+ <?php $this->load->view("setting/change"); ?>
+ </div>
+</div>
</body>
</html>
commit f44b8cae6686360d08284c92d231bd9171ee55ab
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Tue Dec 21 15:52:00 2010 +0530
Converted active record to simple database query
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
diff --git a/system/application/controllers/log.php b/system/application/controllers/log.php
index 5416c8c..9d24beb 100644
--- a/system/application/controllers/log.php
+++ b/system/application/controllers/log.php
@@ -33,8 +33,7 @@ class Log extends Controller {
$data['page_language'] = 'en-en';
$data['creator_email'] = $this->config->item('account_email');
- $this->db->order_by("id", "desc");
- $data['feed_data'] = $this->db->get('logs');
+ $data['feed_data'] = $this->db->query('SELECT * FROM logs ORDER BY id DESC');
header("Content-Type: application/rss+xml");
$this->load->view('rss', $data);
diff --git a/system/application/controllers/voucher.php b/system/application/controllers/voucher.php
index 50dd36e..9d37292 100644
--- a/system/application/controllers/voucher.php
+++ b/system/application/controllers/voucher.php
@@ -467,7 +467,7 @@ class Voucher extends Controller {
$voucher_success_links .= " it.";
$this->messages->add(ucfirst($voucher_type) . ' Voucher number ' . voucher_number_prefix($voucher_type) . $data_number . ' added successfully. ' . $voucher_success_links, 'success');
- $this->logger->write_message("success", "Added " . ucfirst($voucher_type) . " Voucher number " . voucher_number_prefix($voucher_type) . $data_number);
+ $this->logger->write_message("success", "Added " . ucfirst($voucher_type) . " Voucher number " . voucher_number_prefix($voucher_type) . $data_number . " [id:" . $voucher_id . "]");
redirect('voucher/show/' . $voucher_type);
$this->template->load('template', 'voucher/add', $data);
return;
diff --git a/system/application/controllers/welcome.php b/system/application/controllers/welcome.php
index 846c096..5f947ac 100644
--- a/system/application/controllers/welcome.php
+++ b/system/application/controllers/welcome.php
@@ -17,11 +17,11 @@ class Welcome extends Controller {
$this->template->set('add_javascript', array("raphael.js", "jquery.enumerable.js", "jquery.tufte-graph.js"));
/* Draft voucher count */
- $draft_q = $this->db->get_where('vouchers', array('draft' => 1));
+ $draft_q = $this->db->query("SELECT * FROM vouchers WHERE draft = 1");
$data['draft_count'] = $draft_q->num_rows();
/* Bank and Cash Ledger accounts */
- $bank_q = $this->db->get_where('ledgers', array('type' => 'B'));
+ $bank_q = $this->db->query("SELECT * FROM ledgers WHERE type = ?", array('B'));
if ($bank_q->num_rows() > 0)
{
foreach ($bank_q->result() as $row)
diff --git a/system/application/models/tag_model.php b/system/application/models/tag_model.php
index 7a75042..15d1510 100644
--- a/system/application/models/tag_model.php
+++ b/system/application/models/tag_model.php
@@ -24,7 +24,7 @@ class Tag_model extends Model {
{
if ($tag_id < 1)
return "";
- $tag_q = $this->db->get_where('tags', array('id' => $tag_id));
+ $tag_q = $this->db->query("SELECT * FROM tags WHERE id = ?", array($tag_id));
if ($tag = $tag_q->row())
{
return "<span class=\"tags\" style=\"color:#" . $tag->color . "; background-color:#" . $tag->background . "\">" . $tag->title . "</span>";
@@ -36,7 +36,7 @@ class Tag_model extends Model {
{
if ($tag_id < 1)
return "";
- $tag_q = $this->db->get_where('tags', array('id' => $tag_id));
+ $tag_q = $this->db->query("SELECT * FROM tags WHERE id = ?", array($tag_id));
if ($tag = $tag_q->row())
{
return "<span class=\"tags\" style=\"color:#" . $tag->color . "; background-color:#" . $tag->background . "\">" . anchor("voucher/show/tag/" . $tag->id , $tag->title, array('style' => 'text-decoration:none;color:#' . $tag->color . ';')) . "</span>";
@@ -48,7 +48,7 @@ class Tag_model extends Model {
{
if ($tag_id < 1)
return "";
- $tag_q = $this->db->get_where('tags', array('id' => $tag_id));
+ $tag_q = $this->db->query("SELECT * FROM tags WHERE id = ?", array($tag_id));
if ($tag = $tag_q->row())
{
return $tag->title;
diff --git a/system/application/views/log/index.php b/system/application/views/log/index.php
index a1c4777..99d9b66 100644
--- a/system/application/views/log/index.php
+++ b/system/application/views/log/index.php
@@ -1,6 +1,5 @@
<?php
- $this->db->order_by("id", "desc");
- $logs_q = $this->db->get('logs');
+ $logs_q = $this->db->query('SELECT * FROM logs ORDER BY id DESC');
echo "<table border=0 class=\"simple-table\">";
echo "<thead><tr><th width=\"90\">Date</th><th>Host IP</th><th>Message</th><th width=\"30\">URL</th><th>Browser</th></tr></thead>";
foreach ($logs_q->result() as $row)
diff --git a/system/application/views/tag/index.php b/system/application/views/tag/index.php
index bb3db1d..a67ea9f 100644
--- a/system/application/views/tag/index.php
+++ b/system/application/views/tag/index.php
@@ -1,5 +1,5 @@
<?php
- $tags_q = $this->db->get("tags");
+ $tags_q = $this->db->query("SELECT * FROM tags ORDER BY title ASC");
echo "<table border=0 cellpadding=5 class=\"simple-table tag-table\">";
echo "<thead><tr><th>Title</th><th>Color</th><th></th></tr></thead>";
echo "<tbody>";
commit e52001e58db1f302ec5e84544639d1d53976074e
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Tue Dec 21 15:12:25 2010 +0530
Added Voucher actions after add and edit voucher
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
diff --git a/system/application/controllers/voucher.php b/system/application/controllers/voucher.php
index 1cf8be4..50dd36e 100644
--- a/system/application/controllers/voucher.php
+++ b/system/application/controllers/voucher.php
@@ -459,7 +459,14 @@ class Voucher extends Controller {
/* Success */
$this->db->trans_complete();
- $this->messages->add(ucfirst($voucher_type) . ' Voucher number ' . voucher_number_prefix($voucher_type) . $data_number . ' added successfully.', 'success');
+
+ /* Voucher Actions */
+ $voucher_success_links = "You can ";
+ $voucher_success_links .= anchor('voucher/view/' . strtolower($voucher_type) . "/" . $voucher_id, 'View', array('class' => 'anchor-link-a')) . " or ";
+ $voucher_success_links .= anchor('voucher/download/' . strtolower($voucher_type) . "/" . $voucher_id, 'Download', array('class' => 'anchor-link-a'));
+ $voucher_success_links .= " it.";
+
+ $this->messages->add(ucfirst($voucher_type) . ' Voucher number ' . voucher_number_prefix($voucher_type) . $data_number . ' added successfully. ' . $voucher_success_links, 'success');
$this->logger->write_message("success", "Added " . ucfirst($voucher_type) . " Voucher number " . voucher_number_prefix($voucher_type) . $data_number);
redirect('voucher/show/' . $voucher_type);
$this->template->load('template', 'voucher/add', $data);
@@ -722,7 +729,14 @@ class Voucher extends Controller {
/* Success */
$this->db->trans_complete();
- $this->messages->add(ucfirst($voucher_type) . ' Voucher number ' . voucher_number_prefix($voucher_type) . $data_number . ' updated successfully.', 'success');
+
+ /* Voucher Actions */
+ $voucher_success_links = "You can ";
+ $voucher_success_links .= anchor('voucher/view/' . strtolower($voucher_type) . "/" . $voucher_id, 'View', array('class' => 'anchor-link-a')) . " or ";
+ $voucher_success_links .= anchor('voucher/download/' . strtolower($voucher_type) . "/" . $voucher_id, 'Download', array('class' => 'anchor-link-a'));
+ $voucher_success_links .= " it.";
+
+ $this->messages->add(ucfirst($voucher_type) . ' Voucher number ' . voucher_number_prefix($voucher_type) . $data_number . ' updated successfully. ' . $voucher_success_links, 'success');
$this->logger->write_message("success", "Updated " . ucfirst($voucher_type) . " Voucher number " . voucher_number_prefix($voucher_type) . $data_number . " [id:" . $voucher_id . "]");
redirect('voucher/show/' . $voucher_type);
return;
commit 3bb2a5c0b20bf4f4e7053989898ac46d14d306ea
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Tue Dec 21 14:17:07 2010 +0530
Added Status report
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
diff --git a/system/application/controllers/admin/status.php b/system/application/controllers/admin/status.php
new file mode 100644
index 0000000..5485bcb
--- /dev/null
+++ b/system/application/controllers/admin/status.php
@@ -0,0 +1,24 @@
+<?php
+
+class Status extends Controller {
+
+ function Status()
+ {
+ parent::Controller();
+ return;
+ }
+
+ function index()
+ {
+ $this->load->library('statuscheck');
+ $this->template->set('page_title', 'Status report');
+ $statuscheck = new Statuscheck();
+ $statuscheck->check_permissions();
+ $data['error_messages'] = $statuscheck->error_messages;
+ $this->template->load('admin_template', 'admin/status', $data);
+ return;
+ }
+}
+
+/* End of file status.php */
+/* Location: ./system/application/controllers/admin/status.php */
diff --git a/system/application/controllers/admin/welcome.php b/system/application/controllers/admin/welcome.php
index a32238d..cc4ed1e 100644
--- a/system/application/controllers/admin/welcome.php
+++ b/system/application/controllers/admin/welcome.php
@@ -139,74 +139,17 @@ class Welcome extends Controller {
if ($data['current_account'] == "")
$data['current_account'] = "No account is currently active. You can " . anchor('admin/create', 'create', array('title' => 'Create a new account', 'style' => 'color:#000000')) . " a new account or " . anchor('admin/active', 'activate', array('title' => 'Activate a existing account', 'style' => 'color:#000000')) . " an existing account";
- /* check for permissions */
- $this->_check_permissions();
-
- $this->template->load('admin_template', 'admin/welcome', $data);
- return;
- }
-
- /* Check application file permissions for any security related issues */
- function _check_permissions()
- {
- $check_path = $this->config->item('config_path') . "settings/";
- if (! is_writable($check_path))
- {
- $this->messages->add('Application settings directory "' . $check_path . '" is not writable. You will not able to save or edit any application related settings.', 'error');
- }
-
- $check_path = $this->config->item('config_path') . "accounts/";
- if (! is_writable($check_path))
- {
- $this->messages->add('Account settings directory "' . $check_path . '" is not writable. You will not able to save or edit any account related settings.', 'error');
- }
-
- $check_path = $this->config->item('backup_path');
- if (! is_writable($check_path))
- {
- $this->messages->add('Backup directory "' . $check_path . '" is not writable. You will not able to save or download any backups.', 'error');
- }
-
- /* Security checks */
- $check_path = $this->config->item('config_path');
- if (substr(symbolic_permissions(fileperms($check_path)), -3, 1) == "r")
- {
- $this->messages->add('Security Risk ! The application config directory "' . $check_path . '" is world readable.', 'error');
- }
- if (substr(symbolic_permissions(fileperms($check_path)), -2, 1) == "W")
+ /* check status report */
+ $this->load->library('statuscheck');
+ $statuscheck = new Statuscheck();
+ $statuscheck->check_permissions();
+ if (count($statuscheck->error_messages) > 0)
{
- $this->messages->add('Security Risk ! The application config directory "' . $check_path . '" is world writeable.', 'error');
+ $this->messages->add('One or more problems were detected with your installation. Check the ' . anchor('admin/status', 'Status report', array('title' => 'Check Status report', 'class' => 'anchor-link-a')) . ' for more information.', 'error');
}
- $check_path = $this->config->item('config_path') . "accounts/";
- if (substr(symbolic_permissions(fileperms($check_path)), -3, 1) == "r")
- {
- $this->messages->add('Security Risk ! The application accounts directory "' . $check_path . '" is world readable.', 'error');
- }
- if (substr(symbolic_permissions(fileperms($check_path)), -2, 1) == "W")
- {
- $this->messages->add('Security Risk ! The application accounts directory "' . $check_path . '" is world writeable.', 'error');
- }
-
- $check_path = $this->config->item('config_path') . "settings/";
- if (substr(symbolic_permissions(fileperms($check_path)), -3, 1) == "r")
- {
- $this->messages->add('Security Risk ! The application settings directory "' . $check_path . '" is world readable.', 'error');
- }
- if (substr(symbolic_permissions(fileperms($check_path)), -2, 1) == "W")
- {
- $this->messages->add('Security Risk ! The application settings directory "' . $check_path . '" is world writeable.', 'error');
- }
-
- $check_path = $this->config->item('backup_path');
- if (substr(symbolic_permissions(fileperms($check_path)), -3, 1) == "r")
- {
- $this->messages->add('Security Risk ! The application backup directory "' . $check_path . '" is world readable.', 'error');
- }
- if (substr(symbolic_permissions(fileperms($check_path)), -2, 1) == "W")
- {
- $this->messages->add('Security Risk ! The application backup directory "' . $check_path . '" is world writeable.', 'error');
- }
+ $this->template->load('admin_template', 'admin/welcome', $data);
+ return;
}
}
diff --git a/system/application/libraries/Statuscheck.php b/system/application/libraries/Statuscheck.php
new file mode 100644
index 0000000..f81acf0
--- /dev/null
+++ b/system/application/libraries/Statuscheck.php
@@ -0,0 +1,76 @@
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+
+class Statuscheck {
+ var $error_messages = array();
+
+ function Statuscheck()
+ {
+ $this->error_messages = array();
+ }
+
+ function check_permissions()
+ {
+ $CI =& get_instance();
+ $check_path = $CI->config->item('config_path') . "settings/";
+ if (! is_writable($check_path))
+ {
+ $this->error_messages[] = 'Application settings directory "' . $check_path . '" is not writable. You will not able to save or edit any application related settings.';
+ }
+
+ $check_path = $CI->config->item('config_path') . "accounts/";
+ if (! is_writable($check_path))
+ {
+ $this->error_messages[] = 'Account settings directory "' . $check_path . '" is not writable. You will not able to save or edit any account related settings.';
+ }
+
+ $check_path = $CI->config->item('backup_path');
+ if (! is_writable($check_path))
+ {
+ $this->error_messages[] = 'Backup directory "' . $check_path . '" is not writable. You will not able to save or download any backups.';
+ }
+
+ /* Security checks */
+ $check_path = $CI->config->item('config_path');
+ if (substr(symbolic_permissions(fileperms($check_path)), -3, 1) == "r")
+ {
+ $this->error_messages[] = 'Security Risk ! The application config directory "' . $check_path . '" is world readable.';
+ }
+ if (substr(symbolic_permissions(fileperms($check_path)), -2, 1) == "W")
+ {
+ $this->error_messages[] = 'Security Risk ! The application config directory "' . $check_path . '" is world writeable.';
+ }
+
+ $check_path = $CI->config->item('config_path') . "accounts/";
+ if (substr(symbolic_permissions(fileperms($check_path)), -3, 1) == "r")
+ {
+ $this->error_messages[] = 'Security Risk ! The application accounts directory "' . $check_path . '" is world readable.';
+ }
+ if (substr(symbolic_permissions(fileperms($check_path)), -2, 1) == "W")
+ {
+ $this->error_messages[] = 'Security Risk ! The application accounts directory "' . $check_path . '" is world writeable.';
+ }
+
+ $check_path = $CI->config->item('config_path') . "settings/";
+ if (substr(symbolic_permissions(fileperms($check_path)), -3, 1) == "r")
+ {
+ $this->error_messages[] = 'Security Risk ! The application settings directory "' . $check_path . '" is world readable.';
+ }
+ if (substr(symbolic_permissions(fileperms($check_path)), -2, 1) == "W")
+ {
+ $this->error_messages[] = 'Security Risk ! The application settings directory "' . $check_path . '" is world writeable.';
+ }
+
+ $check_path = $CI->config->item('backup_path');
+ if (substr(symbolic_permissions(fileperms($check_path)), -3, 1) == "r")
+ {
+ $this->error_messages[] = 'Security Risk ! The application backup directory "' . $check_path . '" is world readable.';
+ }
+ if (substr(symbolic_permissions(fileperms($check_path)), -2, 1) == "W")
+ {
+ $this->error_messages[] = 'Security Risk ! The application backup directory "' . $check_path . '" is world writeable.';
+ }
+ }
+}
+
+/* End of file Template.php */
+/* Location: ./system/application/libraries/Template.php */
diff --git a/system/application/views/admin/status.php b/system/application/views/admin/status.php
new file mode 100644
index 0000000..f40be1d
--- /dev/null
+++ b/system/application/views/admin/status.php
@@ -0,0 +1,19 @@
+<?php
+ if (is_array($error_messages))
+ {
+ if (count($error_messages) > 0)
+ {
+ echo "<div id=\"error-box\">";
+ echo "<ul>";
+ foreach ($error_messages as $message)
+ {
+ echo ('<li>' . $message . '</li>');
+ }
+ echo "</ul>";
+ echo "</div>";
+ }
+ }
+
+ echo "<p>";
+ echo anchor('admin', 'Back', 'Back to admin');
+ echo "</p>";
diff --git a/system/application/views/admin/welcome.php b/system/application/views/admin/welcome.php
index d6f34de..625ac24 100644
--- a/system/application/views/admin/welcome.php
+++ b/system/application/views/admin/welcome.php
@@ -38,6 +38,14 @@
General application settings
</div>
</div>
+ <div class="settings-container">
+ <div class="settings-title">
+ <?php echo anchor('admin/status', 'Status Report', array('title' => 'Status Report')); ?>
+ </div>
+ <div class="settings-desc">
+ Status report of the application
+ </div>
+ </div>
</div>
</div>
<div class="clear">
13 years, 4 months
37 commits - backups/.htaccess config/accounts config/.htaccess config/settings system/application system/codeigniter system/libraries user_guide/changelog.html user_guide/database user_guide/doc_style user_guide/general user_guide/helpers user_guide/images user_guide/index.html user_guide/installation user_guide/libraries user_guide/license.html user_guide/overview user_guide/toc.html
by pshah
backups/.htaccess | 1
config/.htaccess | 1
config/accounts/index.html | 10
config/accounts/sample.ini | 7
config/accounts/test.ini | 7
config/settings/general.ini | 3
system/application/assets/css/admin-style.css | 57 +---
system/application/assets/css/custom.css | 87 ++++--
system/application/assets/css/printreport.css | 145 ++++++++++
system/application/assets/css/printvoucher.css | 61 ++++
system/application/assets/css/style.css | 56 +---
system/application/assets/css/tables.css | 65 ----
system/application/assets/images/icons/download.png |binary
system/application/assets/images/icons/rss.png |binary
system/application/config/accounts/sample.ini | 7
system/application/config/accounts/test.ini | 7
system/application/config/config.php | 22 +
system/application/config/general.ini | 3
system/application/controllers/account.php | 4
system/application/controllers/admin/active.php | 22 -
system/application/controllers/admin/carryforward.sql | 2
system/application/controllers/admin/create.php | 28 +-
system/application/controllers/admin/database.sql | 2
system/application/controllers/admin/gensetting.php | 90 ------
system/application/controllers/admin/manage.php | 32 +-
system/application/controllers/admin/setting.php | 90 ++++++
system/application/controllers/admin/welcome.php | 90 +++++-
system/application/controllers/group.php | 28 +-
system/application/controllers/ledger.php | 26 -
system/application/controllers/log.php | 45 +++
system/application/controllers/report.php | 71 ++++-
system/application/controllers/setting.php | 198 +++++++++++---
system/application/controllers/tag.php | 32 +-
system/application/controllers/voucher.php | 252 ++++++++++--------
system/application/helpers/MY_form_helper.php | 10
system/application/helpers/custom_helper.php | 65 ++++
system/application/libraries/Accountlist.php | 49 ---
system/application/libraries/Logger.php | 2
system/application/libraries/MY_Form_validation.php | 22 +
system/application/libraries/Startup.php | 8
system/application/views/admin/create.php | 2
system/application/views/admin/gensetting.php | 17 -
system/application/views/admin/manage/index.php | 2
system/application/views/admin/setting.php | 17 +
system/application/views/admin/welcome.php | 2
system/application/views/admin_template.php | 4
system/application/views/log/index.php | 16 +
system/application/views/report/balancesheet.php | 14 -
system/application/views/report/ledgerst.php | 130 ++++-----
system/application/views/report/profitandloss.php | 24 -
system/application/views/report/report_template.php | 28 ++
system/application/views/report/trialbalance.php | 14 -
system/application/views/rss.php | 31 ++
system/application/views/setting/cf.php | 2
system/application/views/setting/index.php | 10
system/application/views/setting/voucher.php | 41 ++
system/application/views/sidebar/tag.php | 4
system/application/views/template.php | 14 -
system/application/views/voucher/add.php | 12
system/application/views/voucher/downloadpreview.php | 105 +++++++
system/application/views/voucher/edit.php | 12
system/application/views/voucher/emailpreview.php | 46 +++
system/application/views/voucher/printpreview.php | 54 +++
system/application/views/voucher/view.php | 6
system/application/views/welcome_message.php | 37 +-
system/codeigniter/CodeIgniter.php | 2
system/libraries/Router.php | 4
user_guide/changelog.html | 9
user_guide/database/active_record.html | 2
user_guide/database/caching.html | 2
user_guide/database/call_function.html | 2
user_guide/database/configuration.html | 2
user_guide/database/connecting.html | 2
user_guide/database/examples.html | 2
user_guide/database/fields.html | 2
user_guide/database/forge.html | 2
user_guide/database/helpers.html | 2
user_guide/database/index.html | 2
user_guide/database/queries.html | 2
user_guide/database/results.html | 2
user_guide/database/table_data.html | 2
user_guide/database/transactions.html | 2
user_guide/database/utilities.html | 2
user_guide/doc_style/index.html | 2
user_guide/general/alternative_php.html | 2
user_guide/general/ancillary_classes.html | 2
user_guide/general/autoloader.html | 2
user_guide/general/caching.html | 2
user_guide/general/common_functions.html | 2
user_guide/general/controllers.html | 2
user_guide/general/core_classes.html | 2
user_guide/general/creating_libraries.html | 2
user_guide/general/credits.html | 2
user_guide/general/errors.html | 2
user_guide/general/helpers.html | 2
user_guide/general/hooks.html | 2
user_guide/general/libraries.html | 2
user_guide/general/managing_apps.html | 2
user_guide/general/models.html | 2
user_guide/general/plugins.html | 2
user_guide/general/profiling.html | 2
user_guide/general/quick_reference.html | 2
user_guide/general/requirements.html | 2
user_guide/general/reserved_names.html | 2
user_guide/general/routing.html | 2
user_guide/general/scaffolding.html | 2
user_guide/general/security.html | 2
user_guide/general/styleguide.html | 2
user_guide/general/urls.html | 2
user_guide/general/views.html | 2
user_guide/helpers/array_helper.html | 2
user_guide/helpers/compatibility_helper.html | 2
user_guide/helpers/cookie_helper.html | 2
user_guide/helpers/date_helper.html | 2
user_guide/helpers/directory_helper.html | 2
user_guide/helpers/download_helper.html | 2
user_guide/helpers/email_helper.html | 2
user_guide/helpers/file_helper.html | 2
user_guide/helpers/form_helper.html | 2
user_guide/helpers/html_helper.html | 2
user_guide/helpers/inflector_helper.html | 2
user_guide/helpers/language_helper.html | 2
user_guide/helpers/number_helper.html | 2
user_guide/helpers/path_helper.html | 2
user_guide/helpers/security_helper.html | 2
user_guide/helpers/smiley_helper.html | 2
user_guide/helpers/string_helper.html | 2
user_guide/helpers/text_helper.html | 2
user_guide/helpers/typography_helper.html | 2
user_guide/helpers/url_helper.html | 2
user_guide/helpers/xml_helper.html | 2
user_guide/images/nav_bg.jpg |binary
user_guide/images/nav_separator.jpg |binary
user_guide/images/nav_toggle.jpg |binary
user_guide/index.html | 2
user_guide/installation/downloads.html | 5
user_guide/installation/index.html | 2
user_guide/installation/troubleshooting.html | 2
user_guide/installation/upgrade_120.html | 2
user_guide/installation/upgrade_130.html | 2
user_guide/installation/upgrade_131.html | 2
user_guide/installation/upgrade_132.html | 2
user_guide/installation/upgrade_133.html | 2
user_guide/installation/upgrade_140.html | 2
user_guide/installation/upgrade_141.html | 2
user_guide/installation/upgrade_150.html | 2
user_guide/installation/upgrade_152.html | 2
user_guide/installation/upgrade_153.html | 2
user_guide/installation/upgrade_154.html | 2
user_guide/installation/upgrade_160.html | 2
user_guide/installation/upgrade_161.html | 2
user_guide/installation/upgrade_162.html | 2
user_guide/installation/upgrade_163.html | 2
user_guide/installation/upgrade_170.html | 2
user_guide/installation/upgrade_171.html | 2
user_guide/installation/upgrade_172.html | 2
user_guide/installation/upgrade_173.html | 98 +++++++
user_guide/installation/upgrade_b11.html | 2
user_guide/installation/upgrading.html | 3
user_guide/libraries/benchmark.html | 2
user_guide/libraries/calendar.html | 2
user_guide/libraries/config.html | 2
user_guide/libraries/email.html | 2
user_guide/libraries/encryption.html | 2
user_guide/libraries/file_uploading.html | 2
user_guide/libraries/form_validation.html | 2
user_guide/libraries/ftp.html | 2
user_guide/libraries/image_lib.html | 2
user_guide/libraries/input.html | 2
user_guide/libraries/language.html | 2
user_guide/libraries/loader.html | 2
user_guide/libraries/output.html | 2
user_guide/libraries/pagination.html | 2
user_guide/libraries/parser.html | 2
user_guide/libraries/sessions.html | 2
user_guide/libraries/table.html | 2
user_guide/libraries/trackback.html | 2
user_guide/libraries/typography.html | 2
user_guide/libraries/unit_testing.html | 2
user_guide/libraries/uri.html | 2
user_guide/libraries/user_agent.html | 2
user_guide/libraries/validation.html | 2
user_guide/libraries/xmlrpc.html | 2
user_guide/libraries/zip.html | 2
user_guide/license.html | 2
user_guide/overview/appflow.html | 2
user_guide/overview/at_a_glance.html | 2
user_guide/overview/cheatsheets.html | 2
user_guide/overview/features.html | 2
user_guide/overview/getting_started.html | 2
user_guide/overview/goals.html | 2
user_guide/overview/index.html | 2
user_guide/overview/mvc.html | 2
user_guide/toc.html | 2
194 files changed, 1851 insertions(+), 861 deletions(-)
New commits:
commit d7c7128381a1bfaf24794244376db614e70f349a
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Mon Dec 20 15:04:31 2010 +0530
Updated to CodeIgniter PHP Framework version 1.7.3
Website : codeigniter.com
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
diff --git a/system/codeigniter/CodeIgniter.php b/system/codeigniter/CodeIgniter.php
index 5d5bb14..87f7abc 100644
--- a/system/codeigniter/CodeIgniter.php
+++ b/system/codeigniter/CodeIgniter.php
@@ -28,7 +28,7 @@
*/
// CI Version
-define('CI_VERSION', '1.7.2');
+define('CI_VERSION', '1.7.3');
/*
* ------------------------------------------------------
diff --git a/system/libraries/Router.php b/system/libraries/Router.php
index 20e6972..7dbad03 100644
--- a/system/libraries/Router.php
+++ b/system/libraries/Router.php
@@ -307,7 +307,7 @@ class CI_Router {
*/
function set_class($class)
{
- $this->class = $class;
+ $this->class = str_replace(array('/', '.'), '', $class);
}
// --------------------------------------------------------------------
@@ -366,7 +366,7 @@ class CI_Router {
*/
function set_directory($dir)
{
- $this->directory = $dir.'/';
+ $this->directory = str_replace(array('/', '.'), '', $dir).'/';
}
// --------------------------------------------------------------------
diff --git a/user_guide/changelog.html b/user_guide/changelog.html
index ef999cc..9c62241 100644
--- a/user_guide/changelog.html
+++ b/user_guide/changelog.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="./toc.html">Table of Contents Page</a></td>
</tr>
</table>
@@ -58,8 +58,11 @@ Change Log
<h1>Change Log</h1>
<h2>Version 1.7.3</h2>
-<p>Release Date: not yet released<br />
-SVN Revision: </p>
+<p>Release Date: December 06, 2010</p>
+
+<p>Version 1.7.3 is a security maintenance release, including a previously patched file Upload class, and a new security fix to prevent possible directory
+ traversal in certain circumstances. There are no other significant changes.</p>
+
<h2>Version 1.7.2</h2>
<p>Release Date: September 11, 2009<br />
diff --git a/user_guide/database/active_record.html b/user_guide/database/active_record.html
index 060262c..1ff709f 100644
--- a/user_guide/database/active_record.html
+++ b/user_guide/database/active_record.html
@@ -27,7 +27,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/database/caching.html b/user_guide/database/caching.html
index b550a89..0b0b9f5 100644
--- a/user_guide/database/caching.html
+++ b/user_guide/database/caching.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/database/call_function.html b/user_guide/database/call_function.html
index 19c1dd4..5f072dd 100644
--- a/user_guide/database/call_function.html
+++ b/user_guide/database/call_function.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/database/configuration.html b/user_guide/database/configuration.html
index dcced6c..6739756 100644
--- a/user_guide/database/configuration.html
+++ b/user_guide/database/configuration.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/database/connecting.html b/user_guide/database/connecting.html
index fb76628..9352b0a 100644
--- a/user_guide/database/connecting.html
+++ b/user_guide/database/connecting.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/database/examples.html b/user_guide/database/examples.html
index d20b77d..ef0e92b 100644
--- a/user_guide/database/examples.html
+++ b/user_guide/database/examples.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/database/fields.html b/user_guide/database/fields.html
index 5cc2441..af03a44 100644
--- a/user_guide/database/fields.html
+++ b/user_guide/database/fields.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/database/forge.html b/user_guide/database/forge.html
index d02046a..f9d1fae 100644
--- a/user_guide/database/forge.html
+++ b/user_guide/database/forge.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/database/helpers.html b/user_guide/database/helpers.html
index 0d38d8f..c650ff0 100644
--- a/user_guide/database/helpers.html
+++ b/user_guide/database/helpers.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/database/index.html b/user_guide/database/index.html
index 46b299f..d746189 100644
--- a/user_guide/database/index.html
+++ b/user_guide/database/index.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/database/queries.html b/user_guide/database/queries.html
index f51ee07..ece7011 100644
--- a/user_guide/database/queries.html
+++ b/user_guide/database/queries.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/database/results.html b/user_guide/database/results.html
index f944a64..3b782a4 100644
--- a/user_guide/database/results.html
+++ b/user_guide/database/results.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/database/table_data.html b/user_guide/database/table_data.html
index 2bc75c2..224b962 100644
--- a/user_guide/database/table_data.html
+++ b/user_guide/database/table_data.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/database/transactions.html b/user_guide/database/transactions.html
index 94022f6..d92f269 100644
--- a/user_guide/database/transactions.html
+++ b/user_guide/database/transactions.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/database/utilities.html b/user_guide/database/utilities.html
index a26e0f3..0416a07 100644
--- a/user_guide/database/utilities.html
+++ b/user_guide/database/utilities.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/doc_style/index.html b/user_guide/doc_style/index.html
index 7021b9d..5ced4f8 100644
--- a/user_guide/doc_style/index.html
+++ b/user_guide/doc_style/index.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/general/alternative_php.html b/user_guide/general/alternative_php.html
index fc9653d..e1b6257 100644
--- a/user_guide/general/alternative_php.html
+++ b/user_guide/general/alternative_php.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/general/ancillary_classes.html b/user_guide/general/ancillary_classes.html
index 30aa0a6..c6d5ec6 100644
--- a/user_guide/general/ancillary_classes.html
+++ b/user_guide/general/ancillary_classes.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/general/autoloader.html b/user_guide/general/autoloader.html
index ba87c77..93f2a60 100644
--- a/user_guide/general/autoloader.html
+++ b/user_guide/general/autoloader.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/general/caching.html b/user_guide/general/caching.html
index 64dbab8..a452024 100644
--- a/user_guide/general/caching.html
+++ b/user_guide/general/caching.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/general/common_functions.html b/user_guide/general/common_functions.html
index 696815e..51c9c19 100644
--- a/user_guide/general/common_functions.html
+++ b/user_guide/general/common_functions.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/general/controllers.html b/user_guide/general/controllers.html
index 3eda8c4..dd780e5 100644
--- a/user_guide/general/controllers.html
+++ b/user_guide/general/controllers.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/general/core_classes.html b/user_guide/general/core_classes.html
index 1f95173..b10ed4a 100644
--- a/user_guide/general/core_classes.html
+++ b/user_guide/general/core_classes.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/general/creating_libraries.html b/user_guide/general/creating_libraries.html
index aaecbdc..87289c1 100644
--- a/user_guide/general/creating_libraries.html
+++ b/user_guide/general/creating_libraries.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/general/credits.html b/user_guide/general/credits.html
index d0597bc..8ee3a9c 100644
--- a/user_guide/general/credits.html
+++ b/user_guide/general/credits.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/general/errors.html b/user_guide/general/errors.html
index cf50319..bf2055f 100644
--- a/user_guide/general/errors.html
+++ b/user_guide/general/errors.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/general/helpers.html b/user_guide/general/helpers.html
index 80a06c8..10e5525 100644
--- a/user_guide/general/helpers.html
+++ b/user_guide/general/helpers.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/general/hooks.html b/user_guide/general/hooks.html
index eb0d99a..ef54a63 100644
--- a/user_guide/general/hooks.html
+++ b/user_guide/general/hooks.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/general/libraries.html b/user_guide/general/libraries.html
index aec9f12..ab126cd 100644
--- a/user_guide/general/libraries.html
+++ b/user_guide/general/libraries.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/general/managing_apps.html b/user_guide/general/managing_apps.html
index 195480c..cc51632 100644
--- a/user_guide/general/managing_apps.html
+++ b/user_guide/general/managing_apps.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/general/models.html b/user_guide/general/models.html
index 878934b..231fccc 100644
--- a/user_guide/general/models.html
+++ b/user_guide/general/models.html
@@ -27,7 +27,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/general/plugins.html b/user_guide/general/plugins.html
index 58ae22e..3e95d52 100644
--- a/user_guide/general/plugins.html
+++ b/user_guide/general/plugins.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/general/profiling.html b/user_guide/general/profiling.html
index f0c550b..12c2728 100644
--- a/user_guide/general/profiling.html
+++ b/user_guide/general/profiling.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/general/quick_reference.html b/user_guide/general/quick_reference.html
index 74ea0a7..fc640de 100644
--- a/user_guide/general/quick_reference.html
+++ b/user_guide/general/quick_reference.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/general/requirements.html b/user_guide/general/requirements.html
index fab9d6f..f0e9d73 100644
--- a/user_guide/general/requirements.html
+++ b/user_guide/general/requirements.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/general/reserved_names.html b/user_guide/general/reserved_names.html
index 2d637e8..d3c7770 100644
--- a/user_guide/general/reserved_names.html
+++ b/user_guide/general/reserved_names.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/general/routing.html b/user_guide/general/routing.html
index ab79c92..705632a 100644
--- a/user_guide/general/routing.html
+++ b/user_guide/general/routing.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/general/scaffolding.html b/user_guide/general/scaffolding.html
index 8597b6c..c1a0582 100644
--- a/user_guide/general/scaffolding.html
+++ b/user_guide/general/scaffolding.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/general/security.html b/user_guide/general/security.html
index 40ec5e2..b9da14c 100644
--- a/user_guide/general/security.html
+++ b/user_guide/general/security.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/general/styleguide.html b/user_guide/general/styleguide.html
index 94fd46f..04b2e04 100644
--- a/user_guide/general/styleguide.html
+++ b/user_guide/general/styleguide.html
@@ -34,7 +34,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/general/urls.html b/user_guide/general/urls.html
index 6a61c34..54a4224 100644
--- a/user_guide/general/urls.html
+++ b/user_guide/general/urls.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/general/views.html b/user_guide/general/views.html
index 3ad9699..6e758a4 100644
--- a/user_guide/general/views.html
+++ b/user_guide/general/views.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/helpers/array_helper.html b/user_guide/helpers/array_helper.html
index f098640..3190fb7 100644
--- a/user_guide/helpers/array_helper.html
+++ b/user_guide/helpers/array_helper.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/helpers/compatibility_helper.html b/user_guide/helpers/compatibility_helper.html
index 15712eb..9295812 100644
--- a/user_guide/helpers/compatibility_helper.html
+++ b/user_guide/helpers/compatibility_helper.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/helpers/cookie_helper.html b/user_guide/helpers/cookie_helper.html
index 7b1a171..a9859a3 100644
--- a/user_guide/helpers/cookie_helper.html
+++ b/user_guide/helpers/cookie_helper.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/helpers/date_helper.html b/user_guide/helpers/date_helper.html
index 2ec17fb..96ea149 100644
--- a/user_guide/helpers/date_helper.html
+++ b/user_guide/helpers/date_helper.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/helpers/directory_helper.html b/user_guide/helpers/directory_helper.html
index eae2c52..36a682c 100644
--- a/user_guide/helpers/directory_helper.html
+++ b/user_guide/helpers/directory_helper.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/helpers/download_helper.html b/user_guide/helpers/download_helper.html
index 5c1c267..89334d1 100644
--- a/user_guide/helpers/download_helper.html
+++ b/user_guide/helpers/download_helper.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/helpers/email_helper.html b/user_guide/helpers/email_helper.html
index 01579f8..3fe72df 100644
--- a/user_guide/helpers/email_helper.html
+++ b/user_guide/helpers/email_helper.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/helpers/file_helper.html b/user_guide/helpers/file_helper.html
index 92f3ff3..933098c 100644
--- a/user_guide/helpers/file_helper.html
+++ b/user_guide/helpers/file_helper.html
@@ -27,7 +27,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/helpers/form_helper.html b/user_guide/helpers/form_helper.html
index b9b11ac..5d19934 100644
--- a/user_guide/helpers/form_helper.html
+++ b/user_guide/helpers/form_helper.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/helpers/html_helper.html b/user_guide/helpers/html_helper.html
index a6920ee..d557a56 100644
--- a/user_guide/helpers/html_helper.html
+++ b/user_guide/helpers/html_helper.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/helpers/inflector_helper.html b/user_guide/helpers/inflector_helper.html
index ba25e07..6945d36 100644
--- a/user_guide/helpers/inflector_helper.html
+++ b/user_guide/helpers/inflector_helper.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/helpers/language_helper.html b/user_guide/helpers/language_helper.html
index e21a605..8ff9ad0 100644
--- a/user_guide/helpers/language_helper.html
+++ b/user_guide/helpers/language_helper.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/helpers/number_helper.html b/user_guide/helpers/number_helper.html
index 722b7f6..b18b5ea 100644
--- a/user_guide/helpers/number_helper.html
+++ b/user_guide/helpers/number_helper.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/helpers/path_helper.html b/user_guide/helpers/path_helper.html
index 232c1b6..e987dcc 100644
--- a/user_guide/helpers/path_helper.html
+++ b/user_guide/helpers/path_helper.html
@@ -27,7 +27,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/helpers/security_helper.html b/user_guide/helpers/security_helper.html
index ec7eda4..a8e87fc 100644
--- a/user_guide/helpers/security_helper.html
+++ b/user_guide/helpers/security_helper.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/helpers/smiley_helper.html b/user_guide/helpers/smiley_helper.html
index 5bc58a3..bfd806f 100644
--- a/user_guide/helpers/smiley_helper.html
+++ b/user_guide/helpers/smiley_helper.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/helpers/string_helper.html b/user_guide/helpers/string_helper.html
index 36fa40f..68fc4cc 100644
--- a/user_guide/helpers/string_helper.html
+++ b/user_guide/helpers/string_helper.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/helpers/text_helper.html b/user_guide/helpers/text_helper.html
index 120b380..0b54adb 100644
--- a/user_guide/helpers/text_helper.html
+++ b/user_guide/helpers/text_helper.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/helpers/typography_helper.html b/user_guide/helpers/typography_helper.html
index 046da42..8cbc533 100644
--- a/user_guide/helpers/typography_helper.html
+++ b/user_guide/helpers/typography_helper.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/helpers/url_helper.html b/user_guide/helpers/url_helper.html
index 09f89df..af53abb 100644
--- a/user_guide/helpers/url_helper.html
+++ b/user_guide/helpers/url_helper.html
@@ -27,7 +27,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/helpers/xml_helper.html b/user_guide/helpers/xml_helper.html
index 495b80b..e8e495a 100644
--- a/user_guide/helpers/xml_helper.html
+++ b/user_guide/helpers/xml_helper.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/images/nav_bg.jpg b/user_guide/images/nav_bg.jpg
new file mode 100644
index 0000000..440e04d
Binary files /dev/null and b/user_guide/images/nav_bg.jpg differ
diff --git a/user_guide/images/nav_separator.jpg b/user_guide/images/nav_separator.jpg
new file mode 100644
index 0000000..3f8b151
Binary files /dev/null and b/user_guide/images/nav_separator.jpg differ
diff --git a/user_guide/images/nav_toggle.jpg b/user_guide/images/nav_toggle.jpg
new file mode 100644
index 0000000..531bc26
Binary files /dev/null and b/user_guide/images/nav_toggle.jpg differ
diff --git a/user_guide/index.html b/user_guide/index.html
index a234b19..f5fdbdc 100644
--- a/user_guide/index.html
+++ b/user_guide/index.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/installation/downloads.html b/user_guide/installation/downloads.html
index 15c0f30..fb515d1 100644
--- a/user_guide/installation/downloads.html
+++ b/user_guide/installation/downloads.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
@@ -58,7 +58,8 @@ Downloading CodeIgniter
<h1>Downloading CodeIgniter</h1>
<ul>
-<li><a href="http://codeigniter.com/download.php">CodeIgniter V 1.7.2 (Current version)</a></li>
+<li><a href="http://codeigniter.com/download.php">CodeIgniter V 1.7.3 (Current version)</a></li>
+<li><a href="http://codeigniter.com/download_files/CodeIgniter_1.7.2.zip">CodeIgniter V 1.7.2</a></li>
<li><a href="http://codeigniter.com/download_files/CodeIgniter_1.7.1.zip">CodeIgniter V 1.7.1</a></li>
<li><a href="http://codeigniter.com/download_files/CodeIgniter_1.7.0.zip">CodeIgniter V 1.7.0</a></li>
<li><a href="http://codeigniter.com/download_files/CodeIgniter_1.6.3.zip">CodeIgniter V 1.6.3</a></li>
diff --git a/user_guide/installation/index.html b/user_guide/installation/index.html
index f960e28..a4593c4 100644
--- a/user_guide/installation/index.html
+++ b/user_guide/installation/index.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/installation/troubleshooting.html b/user_guide/installation/troubleshooting.html
index 08c5d9f..cbf0856 100644
--- a/user_guide/installation/troubleshooting.html
+++ b/user_guide/installation/troubleshooting.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/installation/upgrade_120.html b/user_guide/installation/upgrade_120.html
index 2ac9ab2..83ca880 100644
--- a/user_guide/installation/upgrade_120.html
+++ b/user_guide/installation/upgrade_120.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/installation/upgrade_130.html b/user_guide/installation/upgrade_130.html
index b36f39d..b7230b9 100644
--- a/user_guide/installation/upgrade_130.html
+++ b/user_guide/installation/upgrade_130.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/installation/upgrade_131.html b/user_guide/installation/upgrade_131.html
index 002f07c..514bdd9 100644
--- a/user_guide/installation/upgrade_131.html
+++ b/user_guide/installation/upgrade_131.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/installation/upgrade_132.html b/user_guide/installation/upgrade_132.html
index 01a1762..6add57e 100644
--- a/user_guide/installation/upgrade_132.html
+++ b/user_guide/installation/upgrade_132.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/installation/upgrade_133.html b/user_guide/installation/upgrade_133.html
index f12a960..a81836e 100644
--- a/user_guide/installation/upgrade_133.html
+++ b/user_guide/installation/upgrade_133.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/installation/upgrade_140.html b/user_guide/installation/upgrade_140.html
index e3f6d82..28284f9 100644
--- a/user_guide/installation/upgrade_140.html
+++ b/user_guide/installation/upgrade_140.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/installation/upgrade_141.html b/user_guide/installation/upgrade_141.html
index 886542d..bf798cf 100644
--- a/user_guide/installation/upgrade_141.html
+++ b/user_guide/installation/upgrade_141.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/installation/upgrade_150.html b/user_guide/installation/upgrade_150.html
index 4ebc78c..8eeeb95 100644
--- a/user_guide/installation/upgrade_150.html
+++ b/user_guide/installation/upgrade_150.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/installation/upgrade_152.html b/user_guide/installation/upgrade_152.html
index 7930638..06825fd 100644
--- a/user_guide/installation/upgrade_152.html
+++ b/user_guide/installation/upgrade_152.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/installation/upgrade_153.html b/user_guide/installation/upgrade_153.html
index 52efd70..a17a3c5 100644
--- a/user_guide/installation/upgrade_153.html
+++ b/user_guide/installation/upgrade_153.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/installation/upgrade_154.html b/user_guide/installation/upgrade_154.html
index c241160..a511cf6 100644
--- a/user_guide/installation/upgrade_154.html
+++ b/user_guide/installation/upgrade_154.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/installation/upgrade_160.html b/user_guide/installation/upgrade_160.html
index 35da95b..a5f299a 100644
--- a/user_guide/installation/upgrade_160.html
+++ b/user_guide/installation/upgrade_160.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/installation/upgrade_161.html b/user_guide/installation/upgrade_161.html
index 2a9d047..ef8edb3 100644
--- a/user_guide/installation/upgrade_161.html
+++ b/user_guide/installation/upgrade_161.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/installation/upgrade_162.html b/user_guide/installation/upgrade_162.html
index 0e86d5c..5c65808 100644
--- a/user_guide/installation/upgrade_162.html
+++ b/user_guide/installation/upgrade_162.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/installation/upgrade_163.html b/user_guide/installation/upgrade_163.html
index 54a7c55..263e8bd 100644
--- a/user_guide/installation/upgrade_163.html
+++ b/user_guide/installation/upgrade_163.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/installation/upgrade_170.html b/user_guide/installation/upgrade_170.html
index d3715e1..d7f765a 100644
--- a/user_guide/installation/upgrade_170.html
+++ b/user_guide/installation/upgrade_170.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/installation/upgrade_171.html b/user_guide/installation/upgrade_171.html
index 9b37bd1..988dd5d 100644
--- a/user_guide/installation/upgrade_171.html
+++ b/user_guide/installation/upgrade_171.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/installation/upgrade_172.html b/user_guide/installation/upgrade_172.html
index ade02b3..54221ab 100644
--- a/user_guide/installation/upgrade_172.html
+++ b/user_guide/installation/upgrade_172.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/installation/upgrade_173.html b/user_guide/installation/upgrade_173.html
new file mode 100644
index 0000000..1f9c282
--- /dev/null
+++ b/user_guide/installation/upgrade_173.html
@@ -0,0 +1,98 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<title>Upgrading from 1.7.2 to 1.7.3 : CodeIgniter User Guide</title>
+
+<style type='text/css' media='all'>@import url('../userguide.css');</style>
+<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
+
+<script type="text/javascript" src="../nav/nav.js"></script>
+<script type="text/javascript" src="../nav/prototype.lite.js"></script>
+<script type="text/javascript" src="../nav/moo.fx.js"></script>
+<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
+
+<meta http-equiv='expires' content='-1' />
+<meta http-equiv= 'pragma' content='no-cache' />
+<meta name='robots' content='all' />
+<meta name='author' content='ExpressionEngine Dev Team' />
+<meta name='description' content='CodeIgniter User Guide' />
+
+</head>
+<body>
+
+<!-- START NAVIGATION -->
+<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
+<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
+<div id="masthead">
+<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
+<tr>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
+<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
+</tr>
+</table>
+</div>
+<!-- END NAVIGATION -->
+
+
+<!-- START BREADCRUMB -->
+<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
+<tr>
+<td id="breadcrumb">
+<a href="http://codeigniter.com/">CodeIgniter Home</a> ›
+<a href="../index.html">User Guide Home</a> ›
+Upgrading from 1.7.2 to 1.7.3
+</td>
+<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" /> <input type="submit" class="submit" name="sa" value="Go" /></form></td>
+</tr>
+</table>
+<!-- END BREADCRUMB -->
+
+<br clear="all" />
+
+
+<!-- START CONTENT -->
+<div id="content">
+
+<h1>Upgrading from 1.7.2 to 1.7.3</h1>
+
+<p>Before performing an update you should take your site offline by replacing the index.php file with a static one.</p>
+
+
+
+<h2>Step 1: Update your CodeIgniter files</h2>
+
+<p>Replace these files and directories in your "system" folder with the new versions:</p>
+
+<ul>
+
+<li><dfn>system/codeigniter</dfn></li>
+<li><dfn>system/database</dfn></li>
+<li><dfn>system/helpers</dfn></li>
+<li><dfn>system/language</dfn></li>
+<li><dfn>system/libraries</dfn></li>
+</ul>
+
+<p class="important"><strong>Note:</strong> If you have any custom developed files in these folders please make copies of them first.</p>
+
+<h2>Step 2: Update your user guide</h2>
+<p>Please replace your local copy of the user guide with the new version, including the image files.</p>
+
+</div>
+<!-- END CONTENT -->
+
+
+<div id="footer">
+<p>
+Previous Topic: <a href="index.html">Installation Instructions</a>
+ ·
+<a href="#top">Top of Page</a> ·
+<a href="../index.html">User Guide Home</a> ·
+Next Topic: <a href="troubleshooting.html">Troubleshooting</a>
+</p>
+<p><a href="http://codeigniter.com">CodeIgniter</a> · Copyright © 2006-2010 · <a href="http://ellislab.com/">Ellislab, Inc.</a></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/user_guide/installation/upgrade_b11.html b/user_guide/installation/upgrade_b11.html
index 647dd88..f34051f 100644
--- a/user_guide/installation/upgrade_b11.html
+++ b/user_guide/installation/upgrade_b11.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/installation/upgrading.html b/user_guide/installation/upgrading.html
index 14a4455..48f239d 100644
--- a/user_guide/installation/upgrading.html
+++ b/user_guide/installation/upgrading.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
@@ -60,6 +60,7 @@ Upgrading from a Previous Version
<p>Please read the upgrade notes corresponding to the version you are upgrading from.</p>
<ul>
+<li><a href="upgrade_173.html">Upgrading from 1.7.2 to 1.7.3</a></li>
<li><a href="upgrade_172.html">Upgrading from 1.7.1 to 1.7.2</a></li>
<li><a href="upgrade_171.html">Upgrading from 1.7.0 to 1.7.1</a></li>
<li><a href="upgrade_170.html">Upgrading from 1.6.3 to 1.7.0</a></li>
diff --git a/user_guide/libraries/benchmark.html b/user_guide/libraries/benchmark.html
index 30db0de..3fddb99 100644
--- a/user_guide/libraries/benchmark.html
+++ b/user_guide/libraries/benchmark.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/libraries/calendar.html b/user_guide/libraries/calendar.html
index 187aade..bde6eb2 100644
--- a/user_guide/libraries/calendar.html
+++ b/user_guide/libraries/calendar.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/libraries/config.html b/user_guide/libraries/config.html
index d911a42..24be07b 100644
--- a/user_guide/libraries/config.html
+++ b/user_guide/libraries/config.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/libraries/email.html b/user_guide/libraries/email.html
index 3b38b26..22912b9 100644
--- a/user_guide/libraries/email.html
+++ b/user_guide/libraries/email.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/libraries/encryption.html b/user_guide/libraries/encryption.html
index 86b8cb4..8ad1f74 100644
--- a/user_guide/libraries/encryption.html
+++ b/user_guide/libraries/encryption.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/libraries/file_uploading.html b/user_guide/libraries/file_uploading.html
index 28cf8de..f458d6e 100644
--- a/user_guide/libraries/file_uploading.html
+++ b/user_guide/libraries/file_uploading.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/libraries/form_validation.html b/user_guide/libraries/form_validation.html
index 400af0e..c05f97f 100644
--- a/user_guide/libraries/form_validation.html
+++ b/user_guide/libraries/form_validation.html
@@ -27,7 +27,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/libraries/ftp.html b/user_guide/libraries/ftp.html
index c0c8e62..b74e1be 100644
--- a/user_guide/libraries/ftp.html
+++ b/user_guide/libraries/ftp.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/libraries/image_lib.html b/user_guide/libraries/image_lib.html
index b6a3447..bb0ef10 100644
--- a/user_guide/libraries/image_lib.html
+++ b/user_guide/libraries/image_lib.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/libraries/input.html b/user_guide/libraries/input.html
index dbc7925..e578970 100644
--- a/user_guide/libraries/input.html
+++ b/user_guide/libraries/input.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/libraries/language.html b/user_guide/libraries/language.html
index eb4835a..7fb1f74 100644
--- a/user_guide/libraries/language.html
+++ b/user_guide/libraries/language.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/libraries/loader.html b/user_guide/libraries/loader.html
index 19a10e4..2d97709 100644
--- a/user_guide/libraries/loader.html
+++ b/user_guide/libraries/loader.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/libraries/output.html b/user_guide/libraries/output.html
index 1e42591..21f1e03 100644
--- a/user_guide/libraries/output.html
+++ b/user_guide/libraries/output.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/libraries/pagination.html b/user_guide/libraries/pagination.html
index 187b331..a0d9fe6 100644
--- a/user_guide/libraries/pagination.html
+++ b/user_guide/libraries/pagination.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/libraries/parser.html b/user_guide/libraries/parser.html
index 4bf63ef..a1177ab 100644
--- a/user_guide/libraries/parser.html
+++ b/user_guide/libraries/parser.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/libraries/sessions.html b/user_guide/libraries/sessions.html
index 11313b5..641d04d 100644
--- a/user_guide/libraries/sessions.html
+++ b/user_guide/libraries/sessions.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/libraries/table.html b/user_guide/libraries/table.html
index 1c67e4b..2d96e07 100644
--- a/user_guide/libraries/table.html
+++ b/user_guide/libraries/table.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/libraries/trackback.html b/user_guide/libraries/trackback.html
index 9e54bbf..2536298 100644
--- a/user_guide/libraries/trackback.html
+++ b/user_guide/libraries/trackback.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/libraries/typography.html b/user_guide/libraries/typography.html
index bcb2e66..7d01fd8 100644
--- a/user_guide/libraries/typography.html
+++ b/user_guide/libraries/typography.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/libraries/unit_testing.html b/user_guide/libraries/unit_testing.html
index e0111e9..8ab8983 100644
--- a/user_guide/libraries/unit_testing.html
+++ b/user_guide/libraries/unit_testing.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/libraries/uri.html b/user_guide/libraries/uri.html
index 818115f..e9b3504 100644
--- a/user_guide/libraries/uri.html
+++ b/user_guide/libraries/uri.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/libraries/user_agent.html b/user_guide/libraries/user_agent.html
index 98bd7b1..b0acc44 100644
--- a/user_guide/libraries/user_agent.html
+++ b/user_guide/libraries/user_agent.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/libraries/validation.html b/user_guide/libraries/validation.html
index 25ea91d..b5e9ec4 100644
--- a/user_guide/libraries/validation.html
+++ b/user_guide/libraries/validation.html
@@ -27,7 +27,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/libraries/xmlrpc.html b/user_guide/libraries/xmlrpc.html
index cd4ed1c..d207119 100644
--- a/user_guide/libraries/xmlrpc.html
+++ b/user_guide/libraries/xmlrpc.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/libraries/zip.html b/user_guide/libraries/zip.html
index 36b969b..16cae3c 100644
--- a/user_guide/libraries/zip.html
+++ b/user_guide/libraries/zip.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/license.html b/user_guide/license.html
index fc79c22..20e6d40 100644
--- a/user_guide/license.html
+++ b/user_guide/license.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/overview/appflow.html b/user_guide/overview/appflow.html
index 8504ae8..1283ccb 100644
--- a/user_guide/overview/appflow.html
+++ b/user_guide/overview/appflow.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/overview/at_a_glance.html b/user_guide/overview/at_a_glance.html
index 6ee17fb..d9b7bcd 100644
--- a/user_guide/overview/at_a_glance.html
+++ b/user_guide/overview/at_a_glance.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/overview/cheatsheets.html b/user_guide/overview/cheatsheets.html
index a34cf71..79d90c2 100644
--- a/user_guide/overview/cheatsheets.html
+++ b/user_guide/overview/cheatsheets.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/overview/features.html b/user_guide/overview/features.html
index 3f584cd..de5ea55 100644
--- a/user_guide/overview/features.html
+++ b/user_guide/overview/features.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/overview/getting_started.html b/user_guide/overview/getting_started.html
index b37d546..1ce8c25 100644
--- a/user_guide/overview/getting_started.html
+++ b/user_guide/overview/getting_started.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/overview/goals.html b/user_guide/overview/goals.html
index cdd93a3..7f312a0 100644
--- a/user_guide/overview/goals.html
+++ b/user_guide/overview/goals.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/overview/index.html b/user_guide/overview/index.html
index 4dbe55c..6719d7d 100644
--- a/user_guide/overview/index.html
+++ b/user_guide/overview/index.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/overview/mvc.html b/user_guide/overview/mvc.html
index 67bae89..ea5c706 100644
--- a/user_guide/overview/mvc.html
+++ b/user_guide/overview/mvc.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/toc.html b/user_guide/toc.html
index 367fb76..bd1c355 100644
--- a/user_guide/toc.html
+++ b/user_guide/toc.html
@@ -29,7 +29,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.7.3</h1></td>
</tr>
</table>
</div>
commit 94856ffde7b8fa076859b3feeb66c263c7eb50b8
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sun Dec 19 11:42:10 2010 +0530
Added Voucher Download
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
diff --git a/system/application/controllers/voucher.php b/system/application/controllers/voucher.php
index e6f8809..1cf8be4 100644
--- a/system/application/controllers/voucher.php
+++ b/system/application/controllers/voucher.php
@@ -764,6 +764,56 @@ class Voucher extends Controller {
return;
}
+ function download($voucher_type, $voucher_id = 0)
+ {
+ $this->load->helper('download');
+ $this->load->model('Setting_model');
+ $this->load->model('Ledger_model');
+
+ $account = $this->Setting_model->get_current();
+
+ /* Load current voucher details */
+ if ( ! $cur_voucher = $this->Voucher_model->get_voucher($voucher_id, $voucher_type))
+ {
+ $this->messages->add('Invalid Voucher.', 'error');
+ redirect('voucher/show/' . $voucher_type);
+ return;
+ }
+
+ $data['voucher_type'] = $voucher_type;
+ $data['voucher_number'] = $cur_voucher->number;
+ $data['voucher_date'] = date_mysql_to_php_display($cur_voucher->date);
+ $data['voucher_dr_total'] = $cur_voucher->dr_total;
+ $data['voucher_cr_total'] = $cur_voucher->cr_total;
+ $data['voucher_narration'] = $cur_voucher->narration;
+ $data['voucher_draft'] = $cur_voucher->draft;
+
+ /* Getting Ledger details */
+ $ledger_q = $this->db->query("SELECT * FROM voucher_items WHERE voucher_id = ? ORDER BY dc DESC", $voucher_id);
+
+ $counter = 0;
+ $data['ledger_data'] = array();
+ if ($ledger_q->num_rows() > 0)
+ {
+ foreach ($ledger_q->result() as $row)
+ {
+ $data['ledger_data'][$counter] = array(
+ 'id' => $row->ledger_id,
+ 'name' => $this->Ledger_model->get_name($row->ledger_id),
+ 'dc' => $row->dc,
+ 'amount' => $row->amount,
+ );
+ $counter++;
+ }
+ }
+
+ /* Download Voucher */
+ $file_name = $voucher_type . '_voucher_' . $cur_voucher->number . ".html";
+ $download_data = $this->load->view('voucher/downloadpreview', $data, TRUE);
+ force_download($file_name, $download_data);
+ return;
+ }
+
function printpreview($voucher_type, $voucher_id)
{
$this->load->model('Setting_model');
diff --git a/system/application/views/voucher/downloadpreview.php b/system/application/views/voucher/downloadpreview.php
new file mode 100644
index 0000000..8ab7043
--- /dev/null
+++ b/system/application/views/voucher/downloadpreview.php
@@ -0,0 +1,105 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+<title><?php echo ucfirst($voucher_type); ?> Voucher Number <?php echo $voucher_number; ?></title>
+
+<style type="text/css">
+ body {
+ color:#000000;
+ font:14px "Helvetica Neue","Lucida Grande","Helvetica Neue",Arial,sans-serif;
+ margin:20px;
+ padding:0;
+ }
+
+ #print-account-name {
+ text-align:center;
+ font-size:17px;
+ }
+
+ #print-account-address {
+ text-align:center;
+ font-size:14px;
+ }
+
+ #print-voucher-type {
+ text-align:center;
+ font-size:15px;
+ }
+
+ table#print-voucher-table {
+ border:1px solid #000000;
+ border-collapse: collapse;
+ }
+
+ table#print-voucher-table tr.tr-title {
+ text-align:left;
+ border:1px solid #000000;
+ padding:5px 0 5px 2px;
+ }
+
+ table#print-voucher-table tr.tr-title th {
+ padding:5px 0 5px 5px;
+ }
+
+ table#print-voucher-table td {
+ padding:5px 0 5px 5px;
+ }
+
+ table#print-voucher-table td.item {
+ padding-right:35px;
+ }
+
+ table#print-voucher-table td.last-item {
+ padding-right:5px;
+ }
+
+ table#print-voucher-table tr.tr-total {
+ border:1px solid #000000;
+ }
+</style>
+
+</head>
+<body>
+ <div id="print-account-name"><span class="value"><?php echo $this->config->item('account_name'); ?></span></div>
+ <div id="print-account-address"><span class="value"><?php echo $this->config->item('account_address'); ?></span></div>
+ <br />
+ <div id="print-voucher-type"><span class="value"><?php echo ucfirst($voucher_type); ?> Voucher</span></div>
+ <br />
+ <div id="print-voucher-number"><?php echo ucfirst($voucher_type); ?> Voucher Number : <span class="value"><?php echo voucher_number_prefix($voucher_type) . $voucher_number; ?></span></div>
+ <div id="print-voucher-number"><?php echo ucfirst($voucher_type); ?> Voucher Date : <span class="value"><?php echo $voucher_date; ?></span></div>
+ <br />
+ <table id="print-voucher-table">
+ <thead>
+ <tr class="tr-title"><th>Ledger A/C</th><th>Dr Amount</th><th>Cr Amount</th></tr>
+ </thead>
+ <tbody>
+ <?php
+ $currency = $this->config->item('account_currency_symbol');
+ foreach ($ledger_data as $id => $row)
+ {
+ echo "<tr class=\"tr-ledger\">";
+ if ($row['dc'] == "D")
+ {
+ echo "<td class=\"ledger-name item\">By " . $row['name'] . "</td>";
+ } else {
+ echo "<td class=\"ledger-name item\"> To " . $row['name'] . "</td>";
+ }
+ if ($row['dc'] == "D")
+ {
+ echo "<td class=\"ledger-dr item\">" . $currency . " " . $row['amount'] . "</td>";
+ echo "<td class=\"ledger-cr last-item\"></td>";
+ } else {
+ echo "<td class=\"ledger-dr item\"></td>";
+ echo "<td class=\"ledger-cr last-item\">" . $currency . " " . $row['amount'] . "</td>";
+ }
+ echo "</tr>";
+ }
+ echo "<tr class=\"tr-total\"><td class=\"total-name\">Total</td><td class=\"total-dr\">" . $currency . " " . $voucher_dr_total . "</td><td class=\"total-cr\">" . $currency . " " . $voucher_cr_total . "</td></tr>";
+ ?>
+ </tbody>
+ </table>
+ <br />
+ <div id="print-voucher-narration">Narration : <span class="value"><?php echo $voucher_narration; ?></span></div>
+ <br />
+</body>
+</html>
commit 73ed31ecf5d48ee922161b31fbf26b02d8a5ee39
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sun Dec 19 11:27:11 2010 +0530
Reset the $config['index_page'] to "index.php"
- Now it works with bitnami lamp stack
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
diff --git a/system/application/config/config.php b/system/application/config/config.php
index 5c95641..96245f0 100644
--- a/system/application/config/config.php
+++ b/system/application/config/config.php
@@ -37,7 +37,7 @@ $config['base_url'] .= str_replace(basename($_SERVER['SCRIPT_NAME']),"",$_SERVER
| variable so that it is blank.
|
*/
-$config['index_page'] = "";
+$config['index_page'] = "index.php";
/*
|--------------------------------------------------------------------------
commit 55c6056c9b6ae91981e06869e240cedc1402f15a
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sun Dec 19 10:45:36 2010 +0530
Added a . to end of every message
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
diff --git a/system/application/controllers/account.php b/system/application/controllers/account.php
index d5f259e..309bb41 100644
--- a/system/application/controllers/account.php
+++ b/system/application/controllers/account.php
@@ -11,9 +11,9 @@ class Account extends Controller {
$total_op = $this->Ledger_model->get_diff_op_balance();
if ($total_op > 0)
{
- $this->messages->add("Difference in Opening Balance is Dr " . convert_cur($total_op), 'error');
+ $this->messages->add("Difference in Opening Balance is Dr " . convert_cur($total_op) . '.', 'error');
} else if ($total_op < 0) {
- $this->messages->add("Difference in Opening Balance is Cr " . convert_cur(-$total_op), 'error');
+ $this->messages->add("Difference in Opening Balance is Cr " . convert_cur(-$total_op) . '.', 'error');
}
$this->template->load('template', 'account/index');
diff --git a/system/application/controllers/admin/active.php b/system/application/controllers/admin/active.php
index f6780fb..5fdbf84 100644
--- a/system/application/controllers/admin/active.php
+++ b/system/application/controllers/admin/active.php
@@ -69,7 +69,7 @@ class Active extends Controller {
/* Check if database ini file exists */
if ( ! get_file_info($ini_file))
{
- $this->messages->add("Account setting file is missing", 'error');
+ $this->messages->add("Account setting file is missing.", 'error');
$this->template->load('admin_template', 'admin/active', $data);
return;
}
@@ -78,7 +78,7 @@ class Active extends Controller {
$active_accounts = parse_ini_file($ini_file);
if ( ! $active_accounts)
{
- $this->messages->add("Invalid account setting file", 'error');
+ $this->messages->add("Invalid account setting file.", 'error');
$this->template->load('admin_template', 'admin/active', $data);
return;
}
@@ -86,38 +86,38 @@ class Active extends Controller {
/* Check if all needed variables are set in ini file */
if ( ! isset($active_accounts['db_hostname']))
{
- $this->messages->add("Hostname missing from account setting file", 'error');
+ $this->messages->add("Hostname missing from account setting file.", 'error');
$this->template->load('admin_template', 'admin/active', $data);
return;
}
if ( ! isset($active_accounts['db_port']))
{
- $this->messages->add("Port missing from account setting file. Default MySQL port is 3306", 'error');
+ $this->messages->add("Port missing from account setting file. Default MySQL port is 3306.", 'error');
$this->template->load('admin_template', 'admin/active', $data);
return;
}
if ( ! isset($active_accounts['db_name']))
{
- $this->messages->add("Database name missing from account setting file", 'error');
+ $this->messages->add("Database name missing from account setting file.", 'error');
$this->template->load('admin_template', 'admin/active', $data);
return;
}
if ( ! isset($active_accounts['db_username']))
{
- $this->messages->add("Database username missing from account setting file", 'error');
+ $this->messages->add("Database username missing from account setting file.", 'error');
$this->template->load('admin_template', 'admin/active', $data);
return;
}
if ( ! isset($active_accounts['db_password']))
{
- $this->messages->add("Database password missing from account setting file", 'error');
+ $this->messages->add("Database password missing from account setting file.", 'error');
$this->template->load('admin_template', 'admin/active', $data);
return;
}
/* Setting new account database details in session */
$this->session->set_userdata('db_active_label', $db_label);
- $this->messages->add("Active account settings changed", 'success');
+ $this->messages->add("Active account settings changed.", 'success');
redirect('admin');
}
return;
diff --git a/system/application/controllers/admin/create.php b/system/application/controllers/admin/create.php
index 6157126..11a2317 100644
--- a/system/application/controllers/admin/create.php
+++ b/system/application/controllers/admin/create.php
@@ -204,7 +204,7 @@ class Create extends Controller {
/* Check if database ini file exists */
if (get_file_info($ini_file))
{
- $this->messages->add("Account with same label already exists", 'error');
+ $this->messages->add("Account with same label already exists.", 'error');
$this->template->load('admin_template', 'admin/create', $data);
return;
}
@@ -212,7 +212,7 @@ class Create extends Controller {
/* Check if start date is less than end date */
if ($data_fy_end <= $data_fy_start)
{
- $this->messages->add("Financial start date cannot be greater than end date", 'error');
+ $this->messages->add("Financial start date cannot be greater than end date.", 'error');
$this->template->load('admin_template', 'admin/create', $data);
return;
}
@@ -234,12 +234,12 @@ class Create extends Controller {
{
if ($newacc->query("CREATE DATABASE " . mysql_real_escape_string($data_database_name)))
{
- $this->messages->add("New database created", 'success');
+ $this->messages->add("New database created.", 'success');
/* Retrying to connect to new database */
$newacc = $this->load->database($dsn, TRUE);
$conn_error = $newacc->_error_message();
} else {
- $this->messages->add("Cannot create database", 'error');
+ $this->messages->add("Cannot create database.", 'error');
$this->template->load('admin_template', 'admin/create', $data);
return;
}
@@ -248,7 +248,7 @@ class Create extends Controller {
if ( ! $newacc->conn_id)
{
- $this->messages->add("Cannot connecting to database", 'error');
+ $this->messages->add("Cannot connecting to database.", 'error');
$this->template->load('admin_template', 'admin/create', $data);
return;
} else if ($conn_error != "") {
@@ -256,7 +256,7 @@ class Create extends Controller {
$this->template->load('admin_template', 'admin/create', $data);
return;
} else if ($newacc->query("SHOW TABLES")->num_rows() > 0) {
- $this->messages->add("Selected database in not empty", 'error');
+ $this->messages->add("Selected database in not empty.", 'error');
$this->template->load('admin_template', 'admin/create', $data);
return;
} else {
@@ -274,7 +274,7 @@ class Create extends Controller {
/* Adding the account settings */
$newacc->query("INSERT INTO settings (id, name, address, email, fy_start, fy_end, currency_symbol, date_format, timezone, database_version) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", array(1, $data_account_name, $data_account_address, $data_account_email, $data_fy_start, $data_fy_end, $data_account_currency, $data_account_date, $data_account_timezone, 1));
- $this->messages->add("Successfully created webzash account", 'success');
+ $this->messages->add("Successfully created webzash account.", 'success');
/* Adding account settings to file. Code copied from manage controller */
$con_details = "[database]" . "\r\n" . "db_hostname = \"" . $data_database_host . "\"" . "\r\n" . "db_port = \"" . $data_database_port . "\"" . "\r\n" . "db_name = \"" . $data_database_name . "\"" . "\r\n" . "db_username = \"" . $data_database_username . "\"" . "\r\n" . "db_password = \"" . $data_database_password . "\"" . "\r\n";
@@ -284,10 +284,10 @@ class Create extends Controller {
/* Writing the connection string to end of file - writing in 'a' append mode */
if ( ! write_file($ini_file, $con_details))
{
- $this->messages->add("Failed to add account settings file. Please check if \"" . $ini_file . "\" file is writable", 'error');
+ $this->messages->add("Failed to add account settings file. Please check if \"" . $ini_file . "\" file is writable.", 'error');
$this->messages->add("You can manually create a text file \"" . $ini_file . "\" with the following content :<br /><br />" . $con_details_html, 'error');
} else {
- $this->messages->add("Successfully added webzash account settings file to list of active accounts", 'success');
+ $this->messages->add("Successfully added webzash account settings file to list of active accounts.", 'success');
}
redirect('admin');
diff --git a/system/application/controllers/admin/manage.php b/system/application/controllers/admin/manage.php
index 689431e..5b24793 100644
--- a/system/application/controllers/admin/manage.php
+++ b/system/application/controllers/admin/manage.php
@@ -124,7 +124,7 @@ class Manage extends Controller {
/* Check if database ini file exists */
if (get_file_info($ini_file))
{
- $this->messages->add("Account with same label already exists", 'error');
+ $this->messages->add("Account with same label already exists.", 'error');
$this->template->load('admin_template', 'admin/manage/add', $data);
return;
}
@@ -136,12 +136,12 @@ class Manage extends Controller {
/* Writing the connection string to end of file - writing in 'a' append mode */
if ( ! write_file($ini_file, $con_details))
{
- $this->messages->add("Failed to add account settings file. Please check if \"" . $ini_file . "\" file is writable", 'error');
+ $this->messages->add("Failed to add account settings file. Please check if \"" . $ini_file . "\" file is writable.", 'error');
$this->messages->add("You can manually create a text file \"" . $ini_file . "\" with the following content :<br /><br />" . $con_details_html, 'error');
$this->template->load('admin_template', 'admin/manage/add', $data);
return;
} else {
- $this->messages->add("Successfully added webzash account to list of active accounts", 'success');
+ $this->messages->add("Successfully added webzash account to list of active accounts.", 'success');
redirect('admin/manage');
return;
}
@@ -209,7 +209,7 @@ class Manage extends Controller {
/* Check if database ini file exists */
if ( ! get_file_info($ini_file))
{
- $this->messages->add("Invalid account. Account setting file labeled " . $database_label . " does not exists", 'error');
+ $this->messages->add("Invalid account. Account setting file labeled " . $database_label . " does not exists.", 'error');
} else {
/* Parsing database ini file */
$active_accounts = parse_ini_file($ini_file);
@@ -271,12 +271,12 @@ class Manage extends Controller {
/* Writing the connection string to end of file - writing in 'a' append mode */
if ( ! write_file($ini_file, $con_details))
{
- $this->messages->add("Failed to edit account settings file. Please check if \"" . $ini_file . "\" file is writable", 'error');
+ $this->messages->add("Failed to edit account settings file. Please check if \"" . $ini_file . "\" file is writable.", 'error');
$this->messages->add("You can manually update the text file \"" . $ini_file . "\" with the following content :<br /><br />" . $con_details_html, 'error');
$this->template->load('admin_template', 'admin/manage/edit', $data);
return;
} else {
- $this->messages->add("Successfully updated webzash account settings", 'success');
+ $this->messages->add("Successfully updated webzash account settings.", 'success');
redirect('admin/manage');
return;
}
@@ -289,18 +289,18 @@ class Manage extends Controller {
$this->template->set('page_title', 'Delete a webzash account');
$ini_file = $this->config->item('config_path') . "accounts/" . $database_label . ".ini";
- $this->messages->add("Please delete " . $ini_file . " file manually", 'error');
- $this->messages->add("Note that only the settings file will be delete. Account database will have to be deleted manually", 'status');
+ $this->messages->add("Please delete " . $ini_file . " file manually.", 'error');
+ $this->messages->add("Note that only the settings file will be delete. Account database will have to be deleted manually.", 'status');
/*
if ( ! get_file_info($ini_file))
{
- $this->messages->add("Cannot delete account settings. Account setting file labeled " . $database_label . " does not exists", 'error');
+ $this->messages->add("Cannot delete account settings. Account setting file labeled " . $database_label . " does not exists.", 'error');
} else {
if (unlink($ini_file))
{
$this->messages->add("Account settings file delete", 'success');
} else {
- $this->messages->add("Cannot delete account settings. Please delete " . $ini_file . " file manually", 'error');
+ $this->messages->add("Cannot delete account settings. Please delete " . $ini_file . " file manually.", 'error');
}
} */
redirect('admin/manage');
diff --git a/system/application/controllers/admin/setting.php b/system/application/controllers/admin/setting.php
index 0f70ab5..b65a247 100644
--- a/system/application/controllers/admin/setting.php
+++ b/system/application/controllers/admin/setting.php
@@ -60,7 +60,7 @@ class Setting extends Controller {
if ($data_row_count < 0 || $data_row_count > 200)
{
- $this->messages->add('Invalid value for Row Count', 'error');
+ $this->messages->add('Invalid value for Row Count.', 'error');
$this->template->load('admin_template', 'admin/setting');
return;
}
@@ -72,12 +72,12 @@ class Setting extends Controller {
/* Writing the connection string to end of file - writing in 'a' append mode */
if ( ! write_file($ini_file, $new_setting))
{
- $this->messages->add("Failed to update settings file. Please check if \"" . $ini_file . "\" file is writable", 'error');
+ $this->messages->add("Failed to update settings file. Please check if \"" . $ini_file . "\" file is writable.", 'error');
$this->messages->add("You can manually create a text file \"" . $ini_file . "\" with the following content :<br /><br />" . $new_setting_html, 'error');
$this->template->load('admin_template', 'admin/setting', $data);
return;
} else {
- $this->messages->add('General settings updated successfully', 'success');
+ $this->messages->add('General settings updated successfully.', 'success');
redirect('admin/setting');
return;
}
diff --git a/system/application/controllers/admin/welcome.php b/system/application/controllers/admin/welcome.php
index 4db7c31..a32238d 100644
--- a/system/application/controllers/admin/welcome.php
+++ b/system/application/controllers/admin/welcome.php
@@ -27,40 +27,40 @@ class Welcome extends Controller {
/* Check if database ini file exists */
if ( ! get_file_info($ini_file))
{
- $this->messages->add("Account setting file is missing", 'error');
+ $this->messages->add("Account setting file is missing.", 'error');
} else {
/* Parsing database ini file */
$active_accounts = parse_ini_file($ini_file);
if ( ! $active_accounts)
{
- $this->messages->add("Invalid account setting file", 'error');
+ $this->messages->add("Invalid account setting file.", 'error');
} else {
/* Check if all needed variables are set in ini file */
$ini_ok = TRUE;
if ( ! isset($active_accounts['db_hostname']))
{
$ini_ok = FALSE;
- $this->messages->add("Hostname missing from account setting file", 'error');
+ $this->messages->add("Hostname missing from account setting file.", 'error');
}
if ( ! isset($active_accounts['db_port']))
{
$ini_ok = FALSE;
- $this->messages->add("Port missing from account setting file. Default MySQL port is 3306", 'error');
+ $this->messages->add("Port missing from account setting file. Default MySQL port is 3306.", 'error');
}
if ( ! isset($active_accounts['db_name']))
{
$ini_ok = FALSE;
- $this->messages->add("Database name missing from account setting file", 'error');
+ $this->messages->add("Database name missing from account setting file.", 'error');
}
if ( ! isset($active_accounts['db_username']))
{
$ini_ok = FALSE;
- $this->messages->add("Database username missing from account setting file", 'error');
+ $this->messages->add("Database username missing from account setting file.", 'error');
}
if ( ! isset($active_accounts['db_password']))
{
$ini_ok = FALSE;
- $this->messages->add("Database password missing from account setting file", 'error');
+ $this->messages->add("Database password missing from account setting file.", 'error');
}
if ($ini_ok)
@@ -85,7 +85,7 @@ class Welcome extends Controller {
}
} else {
$is_label_set = FALSE;
- $this->messages->add('Please select a Webzash database', 'error');
+ $this->messages->add('Please select a Webzash database.', 'error');
}
if ($is_label_set)
@@ -105,7 +105,7 @@ class Welcome extends Controller {
if ( ! $valid_db_q)
{
$valid_webzash_db = FALSE;
- $this->messages->add('Invalid Webzash database', 'error');
+ $this->messages->add('Invalid Webzash database.', 'error');
break;
}
}
@@ -129,10 +129,10 @@ class Welcome extends Controller {
}
}
} else {
- $this->messages->add('Invalid database connection settings. Please check whether the provided database name, username and password is valid', 'error');
+ $this->messages->add('Invalid database connection settings. Please check whether the provided database name, username and password is valid.', 'error');
}
} else {
- $this->messages->add('Cannot connect to database server. Please check whether database server is running', 'error');
+ $this->messages->add('Cannot connect to database server. Please check whether database server is running.', 'error');
}
}
diff --git a/system/application/controllers/group.php b/system/application/controllers/group.php
index 390a19b..af3c87c 100644
--- a/system/application/controllers/group.php
+++ b/system/application/controllers/group.php
@@ -71,13 +71,13 @@ class Group extends Controller {
if ( ! $this->db->query("INSERT INTO groups (name, parent_id, affects_gross) VALUES (?, ?, ?)", array($data_name, $data_parent_id, $data_affects_gross)))
{
$this->db->trans_rollback();
- $this->messages->add('Error addding ' . $data_name . ' - Group A/C', 'error');
+ $this->messages->add('Error addding ' . $data_name . ' - Group A/C.', 'error');
$this->logger->write_message("error", "Error adding Group A/C named " . $data_name);
$this->template->load('template', 'group/add', $data);
return;
} else {
$this->db->trans_complete();
- $this->messages->add($data_name . ' - Group A/C added successfully', 'success');
+ $this->messages->add($data_name . ' - Group A/C added successfully.', 'success');
$this->logger->write_message("success", "Added Group A/C named " . $data_name);
redirect('account');
return;
@@ -94,12 +94,12 @@ class Group extends Controller {
$id = $this->input->xss_clean($id);
$id = (int)$id;
if ($id < 1) {
- $this->messages->add('Invalid Group A/C', 'error');
+ $this->messages->add('Invalid Group A/C.', 'error');
redirect('account');
return;
}
if ($id < 5) {
- $this->messages->add('Cannot edit system created Group A/C', 'error');
+ $this->messages->add('Cannot edit system created Group A/C.', 'error');
redirect('account');
return;
}
@@ -108,7 +108,7 @@ class Group extends Controller {
$group_data_q = $this->db->query("SELECT * FROM groups WHERE id = ?", array($id));
if ($group_data_q->num_rows() < 1)
{
- $this->messages->add('Invalid Group A/C', 'error');
+ $this->messages->add('Invalid Group A/C.', 'error');
redirect('account');
return;
}
@@ -168,13 +168,13 @@ class Group extends Controller {
if ( ! $this->db->query("UPDATE groups SET name = ?, parent_id = ?, affects_gross = ? WHERE id = ?", array($data_name, $data_parent_id, $data_affects_gross, $data_id)))
{
$this->db->trans_rollback();
- $this->messages->add('Error updating ' . $data_name . ' - Group A/C', 'error');
+ $this->messages->add('Error updating ' . $data_name . ' - Group A/C.', 'error');
$this->logger->write_message("error", "Error updating Group A/C named " . $data_name . " [id:" . $data_id . "]");
$this->template->load('template', 'group/edit', $data);
return;
} else {
$this->db->trans_complete();
- $this->messages->add($data_name . ' - Group A/C updated successfully', 'success');
+ $this->messages->add($data_name . ' - Group A/C updated successfully.', 'success');
$this->logger->write_message("success", "Updated Group A/C named " . $data_name . " [id:" . $data_id . "]");
redirect('account');
return;
@@ -189,26 +189,26 @@ class Group extends Controller {
$id = $this->input->xss_clean($id);
$id = (int)$id;
if ($id < 1) {
- $this->messages->add('Invalid Group A/C', 'error');
+ $this->messages->add('Invalid Group A/C.', 'error');
redirect('account');
return;
}
if ($id < 5) {
- $this->messages->add('Cannot delete system created Group A/C', 'error');
+ $this->messages->add('Cannot delete system created Group A/C.', 'error');
redirect('account');
return;
}
$data_present_q = $this->db->query("SELECT * FROM groups WHERE parent_id = ?", array($id));
if ($data_present_q->num_rows() > 0)
{
- $this->messages->add('Cannot delete non-empty Group A/C', 'error');
+ $this->messages->add('Cannot delete non-empty Group A/C.', 'error');
redirect('account');
return;
}
$data_present_q = $this->db->query("SELECT * FROM ledgers WHERE group_id = ?", array($id));
if ($data_present_q->num_rows() > 0)
{
- $this->messages->add('Cannot delete non-empty Group A/C', 'error');
+ $this->messages->add('Cannot delete non-empty Group A/C.', 'error');
redirect('account');
return;
}
@@ -217,7 +217,7 @@ class Group extends Controller {
$group_q = $this->db->query("SELECT * FROM groups WHERE id = ?", array($id));
if ($group_q->num_rows() < 1)
{
- $this->messages->add('Invalid Group A/C', 'error');
+ $this->messages->add('Invalid Group A/C.', 'error');
redirect('account');
return;
} else {
@@ -229,13 +229,13 @@ class Group extends Controller {
if ( ! $this->db->query("DELETE FROM groups WHERE id = ?", array($id)))
{
$this->db->trans_rollback();
- $this->messages->add("Error deleting " . $group_data->name . " - Group A/C", 'error');
+ $this->messages->add("Error deleting " . $group_data->name . " - Group A/C.", 'error');
$this->logger->write_message("error", "Error deleting Group A/C named " . $group_data->name . " [id:" . $id . "]");
redirect('account');
return;
} else {
$this->db->trans_complete();
- $this->messages->add($group_data->name . ' - Group A/C deleted successfully', 'success');
+ $this->messages->add($group_data->name . ' - Group A/C deleted successfully.', 'success');
$this->logger->write_message("success", "Deleted Group A/C named " . $group_data->name . " [id:" . $id . "]");
redirect('account');
return;
diff --git a/system/application/controllers/ledger.php b/system/application/controllers/ledger.php
index a763725..9f92b45 100644
--- a/system/application/controllers/ledger.php
+++ b/system/application/controllers/ledger.php
@@ -73,7 +73,7 @@ class Ledger extends Controller {
if ($data_group_id < 5)
{
- $this->messages->add("Invalid parent group", 'error');
+ $this->messages->add("Invalid parent group.", 'error');
$this->template->load('template', 'ledger/add', $data);
return;
}
@@ -87,13 +87,13 @@ class Ledger extends Controller {
if ( ! $this->db->query("INSERT INTO ledgers (name, group_id, op_balance, op_balance_dc, type) VALUES (?, ?, ?, ?, ?)", array($data_name, $data_group_id, $data_op_balance, $data_op_balance_dc, $data_ledger_type_cashbank)))
{
$this->db->trans_rollback();
- $this->messages->add('Error addding ' . $data_name . ' - Ledger A/C', 'error');
+ $this->messages->add('Error addding ' . $data_name . ' - Ledger A/C.', 'error');
$this->logger->write_message("error", "Error adding Ledger A/C named " . $data_name);
$this->template->load('template', 'group/add', $data);
return;
} else {
$this->db->trans_complete();
- $this->messages->add($data_name . ' - Ledger A/C added successfully', 'success');
+ $this->messages->add($data_name . ' - Ledger A/C added successfully.', 'success');
$this->logger->write_message("success", "Added Ledger A/C named " . $data_name);
redirect('account');
return;
@@ -111,7 +111,7 @@ class Ledger extends Controller {
$id = (int)$id;
if ($id < 1)
{
- $this->messages->add('Invalid Ledger A/C', 'error');
+ $this->messages->add('Invalid Ledger A/C.', 'error');
redirect('account');
return;
}
@@ -120,7 +120,7 @@ class Ledger extends Controller {
$ledger_data_q = $this->db->query("SELECT * FROM ledgers WHERE id = ?", array($id));
if ($ledger_data_q->num_rows() < 1)
{
- $this->messages->add('Invalid Ledger A/C', 'error');
+ $this->messages->add('Invalid Ledger A/C.', 'error');
redirect('account');
return;
}
@@ -184,7 +184,7 @@ class Ledger extends Controller {
if ($data_group_id < 5)
{
- $this->messages->add("Invalid parent group", 'error');
+ $this->messages->add("Invalid parent group.", 'error');
$this->template->load('template', 'ledger/add', $data);
return;
}
@@ -198,13 +198,13 @@ class Ledger extends Controller {
if ( ! $this->db->query("UPDATE ledgers SET name = ?, group_id = ?, op_balance = ?, op_balance_dc = ?, type = ? WHERE id = ?", array($data_name, $data_group_id, $data_op_balance, $data_op_balance_dc, $data_ledger_type_cashbank, $data_id)))
{
$this->db->trans_rollback();
- $this->messages->add('Error updating ' . $data_name . ' - Ledger A/C', 'error');
+ $this->messages->add('Error updating ' . $data_name . ' - Ledger A/C.', 'error');
$this->logger->write_message("error", "Error updating Ledger A/C named " . $data_name . " [id:" . $data_id . "]");
$this->template->load('template', 'ledger/edit', $data);
return;
} else {
$this->db->trans_complete();
- $this->messages->add($data_name . ' - Ledger A/C updated successfully', 'success');
+ $this->messages->add($data_name . ' - Ledger A/C updated successfully.', 'success');
$this->logger->write_message("success", "Updated Ledger A/C named " . $data_name . " [id:" . $data_id . "]");
redirect('account');
return;
@@ -220,14 +220,14 @@ class Ledger extends Controller {
$id = (int)$id;
if ($id < 1)
{
- $this->messages->add('Invalid Ledger A/C', 'error');
+ $this->messages->add('Invalid Ledger A/C.', 'error');
redirect('account');
return;
}
$data_present_q = $this->db->query("SELECT * FROM voucher_items WHERE ledger_id = ?", array($id));
if ($data_present_q->num_rows() > 0)
{
- $this->messages->add('Cannot delete non-empty Ledger A/C', 'error');
+ $this->messages->add('Cannot delete non-empty Ledger A/C.', 'error');
redirect('account');
return;
}
@@ -236,7 +236,7 @@ class Ledger extends Controller {
$ledger_q = $this->db->query("SELECT * FROM ledgers WHERE id = ?", array($id));
if ($ledger_q->num_rows() < 1)
{
- $this->messages->add('Invalid Ledger A/C', 'error');
+ $this->messages->add('Invalid Ledger A/C.', 'error');
redirect('account');
return;
} else {
@@ -248,13 +248,13 @@ class Ledger extends Controller {
if ( ! $this->db->query("DELETE FROM ledgers WHERE id = ?", array($id)))
{
$this->db->trans_rollback();
- $this->messages->add("Error deleting " . $ledger_data->name . " - Ledger A/C", 'error');
+ $this->messages->add("Error deleting " . $ledger_data->name . " - Ledger A/C.", 'error');
$this->logger->write_message("error", "Error deleting Ledger A/C named " . $ledger_data->name . " [id:" . $id . "]");
redirect('account');
return;
} else {
$this->db->trans_complete();
- $this->messages->add($ledger_data->name . " - Ledger A/C deleted successfully", 'success');
+ $this->messages->add($ledger_data->name . " - Ledger A/C deleted successfully.", 'success');
$this->logger->write_message("success", "Deleted Ledger A/C named " . $ledger_data->name . " [id:" . $id . "]");
redirect('account');
return;
diff --git a/system/application/controllers/log.php b/system/application/controllers/log.php
index 66730d0..5416c8c 100644
--- a/system/application/controllers/log.php
+++ b/system/application/controllers/log.php
@@ -14,10 +14,10 @@ class Log extends Controller {
{
if ($this->db->query('DELETE FROM logs'))
{
- $this->messages->add('Log cleared', 'success');
+ $this->messages->add('Log cleared.', 'success');
redirect("log");
} else {
- $this->messages->add('Error clearing Log', 'error');
+ $this->messages->add('Error clearing Log.', 'error');
redirect("log");
}
return;
diff --git a/system/application/controllers/report.php b/system/application/controllers/report.php
index 4179524..ea86ee8 100644
--- a/system/application/controllers/report.php
+++ b/system/application/controllers/report.php
@@ -612,7 +612,7 @@ class Report extends Controller {
/* Checking for valid ledger id */
if ($data['ledger_id'] < 1)
{
- $this->messages->add("Invalid Ledger A/C", 'error');
+ $this->messages->add("Invalid Ledger A/C.", 'error');
redirect("report/ledgerst");
}
$data['report'] = "report/ledgerst";
diff --git a/system/application/controllers/setting.php b/system/application/controllers/setting.php
index 6162040..f6af99a 100644
--- a/system/application/controllers/setting.php
+++ b/system/application/controllers/setting.php
@@ -135,13 +135,13 @@ class Setting extends Controller {
if ( ! $this->db->query("UPDATE settings SET name = ?, address = ?, email = ?, currency_symbol = ?, date_format = ?, timezone = ? WHERE id = 1", array($data_account_name, $data_account_address, $data_account_email, $data_account_currency, $data_account_date, $data_account_timezone)))
{
$this->db->trans_rollback();
- $this->messages->add('Error updating settings', 'error');
+ $this->messages->add('Error updating settings.', 'error');
$this->logger->write_message("error", "Error updating account settings");
$this->template->load('template', 'setting/account', $data);
return;
} else {
$this->db->trans_complete();
- $this->messages->add('Settings updated successfully', 'success');
+ $this->messages->add('Settings updated successfully.', 'success');
$this->logger->write_message("success", "Updated account settings");
redirect('setting');
return;
@@ -299,7 +299,7 @@ class Setting extends Controller {
/* Check if database ini file exists */
if (get_file_info($ini_file))
{
- $this->messages->add("Account with same label already exists", 'error');
+ $this->messages->add("Account with same label already exists.", 'error');
$this->template->load('template', 'setting/cf', $data);
return;
}
@@ -307,7 +307,7 @@ class Setting extends Controller {
/* Check if start date is less than end date */
if ($data_fy_end <= $data_fy_start)
{
- $this->messages->add("Financial start date cannot be greater than end date", 'error');
+ $this->messages->add("Financial start date cannot be greater than end date.", 'error');
$this->template->load('template', 'setting/cf', $data);
return;
}
@@ -329,12 +329,12 @@ class Setting extends Controller {
{
if ($newacc->query("CREATE DATABASE " . mysql_real_escape_string($data_database_name)))
{
- $this->messages->add("New database created", 'success');
+ $this->messages->add("New database created.", 'success');
/* Retrying to connect to new database */
$newacc = $this->load->database($dsn, TRUE);
$conn_error = $newacc->_error_message();
} else {
- $this->messages->add("Cannot create database", 'error');
+ $this->messages->add("Cannot create database.", 'error');
$this->template->load('template', 'setting/cf', $data);
return;
}
@@ -343,7 +343,7 @@ class Setting extends Controller {
if ( ! $newacc->conn_id)
{
- $this->messages->add("Cannot connecting to database", 'error');
+ $this->messages->add("Cannot connecting to database.", 'error');
$this->template->load('template', 'setting/cf', $data);
return;
} else if ($conn_error != "") {
@@ -351,7 +351,7 @@ class Setting extends Controller {
$this->template->load('template', 'setting/cf', $data);
return;
} else if ($newacc->query("SHOW TABLES")->num_rows() > 0) {
- $this->messages->add("Selected database in not empty", 'error');
+ $this->messages->add("Selected database in not empty.", 'error');
$this->template->load('template', 'setting/cf', $data);
return;
} else {
@@ -370,7 +370,7 @@ class Setting extends Controller {
/* Adding the account settings */
$newacc->query("INSERT INTO settings (id, name, address, email, fy_start, fy_end, currency_symbol, date_format, timezone, email_protocol, email_host, email_port, email_username, email_password, database_version) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", array(1, $data_account_name, $data_account_address, $data_account_email, $data_fy_start, $data_fy_end, $data_account_currency, $data_account_date, $data_account_timezone, $data_account_email_protocol, $data_account_email_host, $data_account_email_port, $data_account_email_username, $data_account_email_password, 1));
- $this->messages->add("Successfully created webzash account", 'success');
+ $this->messages->add("Successfully created webzash account.", 'success');
/* Adding account settings to file. Code copied from manage controller */
$con_details = "[database]" . "\r\n" . "db_hostname = \"" . $data_database_host . "\"" . "\r\n" . "db_port = \"" . $data_database_port . "\"" . "\r\n" . "db_name = \"" . $data_database_name . "\"" . "\r\n" . "db_username = \"" . $data_database_username . "\"" . "\r\n" . "db_password = \"" . $data_database_password . "\"" . "\r\n";
@@ -386,7 +386,7 @@ class Setting extends Controller {
{
if ( ! $newacc->query("INSERT INTO groups (id, parent_id, name, affects_gross) VALUES (?, ?, ?, ?)", array($row->id, $row->parent_id, $row->name, $row->affects_gross)))
{
- $this->messages->add("Failed to add group " . $row->name, 'error');
+ $this->messages->add("Failed to add group " . $row->name . '.', 'error');
$cf_status = FALSE;
}
}
@@ -417,13 +417,13 @@ class Setting extends Controller {
}
if ( ! $newacc->query("INSERT INTO ledgers (id, group_id, name, op_balance, op_balance_dc, type) VALUES (?, ?, ?, ?, ?, ?)", array($row->id, $row->group_id, $row->name, $op_balance, $op_balance_dc, $row->type)))
{
- $this->messages->add("Failed to add ledger " . $row->name, 'error');
+ $this->messages->add("Failed to add ledger " . $row->name . '.', 'error');
$cf_status = FALSE;
}
} else {
if ( ! $newacc->query("INSERT INTO ledgers (id, group_id, name, op_balance, op_balance_dc, type) VALUES (?, ?, ?, ?, ?, ?)", array($row->id, $row->group_id, $row->name, 0, "D", $row->type)))
{
- $this->messages->add("Failed to add ledger " . $row->name, 'error');
+ $this->messages->add("Failed to add ledger " . $row->name . '.', 'error');
$cf_status = FALSE;
}
}
@@ -435,23 +435,23 @@ class Setting extends Controller {
{
if ( ! $newacc->query("INSERT INTO tags (id, title, color, background) VALUES (?, ?, ?, ?)", array($row->id, $row->title, $row->color, $row->background)))
{
- $this->messages->add("Failed to add tag " . $row->title, 'error');
+ $this->messages->add("Failed to add tag " . $row->title . '.', 'error');
$cf_status = FALSE;
}
}
if ($cf_status)
- $this->messages->add("Successfully carry forward to new account", 'success');
+ $this->messages->add("Successfully carry forward to new account.", 'success');
else
- $this->messages->add("Error in carry forward to new account", 'error');
+ $this->messages->add("Error in carry forward to new account.", 'error');
/* Writing the connection string to end of file - writing in 'a' append mode */
if ( ! write_file($ini_file, $con_details))
{
- $this->messages->add("Failed to add account settings file. Please check if \"" . $ini_file . "\" file is writable", 'error');
+ $this->messages->add("Failed to add account settings file. Please check if \"" . $ini_file . "\" file is writable.", 'error');
$this->messages->add("You can manually create a text file \"" . $ini_file . "\" with the following content :<br /><br />" . $con_details_html, 'error');
} else {
- $this->messages->add("Successfully added webzash account settings file to list of active accounts", 'success');
+ $this->messages->add("Successfully added webzash account settings file to list of active accounts.", 'success');
}
redirect('setting');
@@ -550,13 +550,13 @@ class Setting extends Controller {
if ( ! $this->db->query("UPDATE settings SET email_protocol = ?, email_host = ?, email_port = ?, email_username = ?, email_password = ? WHERE id = 1", array($data_email_protocol, $data_email_host, $data_email_port, $data_email_username, $data_email_password)))
{
$this->db->trans_rollback();
- $this->messages->add('Error updating settings', 'error');
+ $this->messages->add('Error updating settings.', 'error');
$this->logger->write_message("error", "Error updating email settings");
$this->template->load('template', 'setting/email', $data);
return;
} else {
$this->db->trans_complete();
- $this->messages->add('Email settings updated successfully', 'success');
+ $this->messages->add('Email settings updated successfully.', 'success');
$this->logger->write_message("success", "Updated email settings");
redirect('setting');
return;
@@ -764,13 +764,13 @@ class Setting extends Controller {
if ( ! $this->db->query("UPDATE settings SET print_paper_height = ?, print_paper_width = ?, print_margin_top = ?, print_margin_bottom = ?, print_margin_left = ?, print_margin_right = ?, print_orientation = ?, print_page_format = ?, print_page_layout = ?, print_logo = ? WHERE id = 1", array($data_paper_height, $data_paper_width, $data_margin_top, $data_margin_bottom, $data_margin_left, $data_margin_right, $data_orientation, $data_output_format, $data_page_layout, $data_logo)))
{
$this->db->trans_rollback();
- $this->messages->add('Error updating printer settings', 'error');
+ $this->messages->add('Error updating printer settings.', 'error');
$this->logger->write_message("error", "Error updating printer settings");
$this->template->load('template', 'setting/printer');
return;
} else {
$this->db->trans_complete();
- $this->messages->add('Printer settings updated successfully', 'success');
+ $this->messages->add('Printer settings updated successfully.', 'success');
$this->logger->write_message("success", "Updated printer settings");
redirect('setting');
return;
@@ -791,7 +791,7 @@ class Setting extends Controller {
/* Write the backup file to server */
if ( ! write_file($this->config->item('backup_path') . $backup_filename, $backup_data))
{
- $this->messages->add('Error saving backup file to server.' . ' Please check if "' . $this->config->item('backup_path') . '" folder is writable', 'error');
+ $this->messages->add('Error saving backup file to server.' . ' Please check if "' . $this->config->item('backup_path') . '" folder is writable.', 'error');
redirect('setting');
return;
}
@@ -877,13 +877,13 @@ class Setting extends Controller {
if ( ! $this->db->query("UPDATE settings SET receipt_voucher_prefix = ?, payment_voucher_prefix = ?, contra_voucher_prefix = ?, journal_voucher_prefix = ? WHERE id = 1", array($data_receipt_prefix, $data_payment_prefix, $data_contra_prefix, $data_journal_prefix)))
{
$this->db->trans_rollback();
- $this->messages->add('Error updating voucher settings', 'error');
+ $this->messages->add('Error updating voucher settings.', 'error');
$this->logger->write_message("error", "Error updating voucher settings");
$this->template->load('template', 'setting/voucher');
return;
} else {
$this->db->trans_complete();
- $this->messages->add('Voucher settings updated successfully', 'success');
+ $this->messages->add('Voucher settings updated successfully.', 'success');
$this->logger->write_message("success", "Updated voucher settings");
redirect('setting');
return;
diff --git a/system/application/controllers/tag.php b/system/application/controllers/tag.php
index 9358a0d..7730cb5 100644
--- a/system/application/controllers/tag.php
+++ b/system/application/controllers/tag.php
@@ -75,13 +75,13 @@ class Tag extends Controller {
if ( ! $this->db->query("INSERT INTO tags (title, color, background) VALUES (?, ?, ?)", array($data_tag_title, $data_tag_color, $data_tag_background)))
{
$this->db->trans_rollback();
- $this->messages->add('Error addding ' . $data_tag_title . ' - Tag', 'error');
+ $this->messages->add('Error addding ' . $data_tag_title . ' - Tag.', 'error');
$this->logger->write_message("error", "Error adding tag named " . $data_tag_title);
$this->template->load('template', 'tag/add', $data);
return;
} else {
$this->db->trans_complete();
- $this->messages->add("Added " . $data_tag_title . ' - Tag successfully', 'success');
+ $this->messages->add("Added " . $data_tag_title . ' - Tag successfully.', 'success');
$this->logger->write_message("success", "Added tag named " . $data_tag_title);
redirect('tag');
return;
@@ -99,7 +99,7 @@ class Tag extends Controller {
$id = $this->input->xss_clean($id);
$id = (int)$id;
if ($id < 1) {
- $this->messages->add('Invalid Tag', 'error');
+ $this->messages->add('Invalid Tag.', 'error');
redirect('tag');
return;
}
@@ -108,7 +108,7 @@ class Tag extends Controller {
$tag_data_q = $this->db->query("SELECT * FROM tags WHERE id = ?", array($id));
if ($tag_data_q->num_rows() < 1)
{
- $this->messages->add('Invalid Tag', 'error');
+ $this->messages->add('Invalid Tag.', 'error');
redirect('tag');
return;
}
@@ -169,13 +169,13 @@ class Tag extends Controller {
if ( ! $this->db->query("UPDATE tags SET title = ?, color = ?, background = ? WHERE id = ?", array($data_tag_title, $data_tag_color, $data_tag_background, $id)))
{
$this->db->trans_rollback();
- $this->messages->add('Error updating ' . $data_tag_title . ' - Tag', 'error');
+ $this->messages->add('Error updating ' . $data_tag_title . ' - Tag.', 'error');
$this->logger->write_message("error", "Error updating tag named " . $data_tag_title . " [id:" . $id . "]");
$this->template->load('template', 'tag/edit', $data);
return;
} else {
$this->db->trans_complete();
- $this->messages->add("Updated " . $data_tag_title . ' - Tag successfully', 'success');
+ $this->messages->add("Updated " . $data_tag_title . ' - Tag successfully.', 'success');
$this->logger->write_message("success", "Updated tag named " . $data_tag_title . " [id:" . $id . "]");
redirect('tag');
return;
@@ -191,14 +191,14 @@ class Tag extends Controller {
$id = $this->input->xss_clean($id);
$id = (int)$id;
if ($id < 1) {
- $this->messages->add('Invalid Tag', 'error');
+ $this->messages->add('Invalid Tag.', 'error');
redirect('tag');
return;
}
$data_valid_q = $this->db->query("SELECT * FROM tags WHERE id = ?", array($id));
if ($data_valid_q->num_rows() < 1)
{
- $this->messages->add('Invalid Tag specified', 'error');
+ $this->messages->add('Invalid Tag specified.', 'error');
redirect('tag');
return;
}
@@ -209,7 +209,7 @@ class Tag extends Controller {
if ( ! $this->db->query("UPDATE vouchers SET tag_id = 0 WHERE tag_id = ?", array($id)))
{
$this->db->trans_rollback();
- $this->messages->add('Error removing Tags', 'error');
+ $this->messages->add('Error removing Tags.', 'error');
$this->logger->write_message("error", "Error removing tag named " . $data_tag->title . " [id:" . $id . "] from vouchers");
redirect('tag');
return;
@@ -217,13 +217,13 @@ class Tag extends Controller {
if ( ! $this->db->query("DELETE FROM tags WHERE id = ?", array($id)))
{
$this->db->trans_rollback();
- $this->messages->add('Error deleting Tag', 'error');
+ $this->messages->add('Error deleting Tag.', 'error');
$this->logger->write_message("error", "Error deleting tag named " . $data_tag->title . " [id:" . $id . "]");
redirect('tag');
return;
} else {
$this->db->trans_complete();
- $this->messages->add('Tag deleted successfully', 'success');
+ $this->messages->add('Tag deleted successfully.', 'success');
$this->logger->write_message("success", "Deleted tag named " . $data_tag->title . " [id:" . $id . "]");
redirect('tag');
return;
diff --git a/system/application/controllers/voucher.php b/system/application/controllers/voucher.php
index 815d7f5..e6f8809 100644
--- a/system/application/controllers/voucher.php
+++ b/system/application/controllers/voucher.php
@@ -63,7 +63,7 @@ class Voucher extends Controller {
$data['voucher_type'] = "";
break;
default :
- $this->messages->add('Invalid voucher type', 'error');
+ $this->messages->add('Invalid voucher type.', 'error');
redirect('voucher/show/all');
return;
break;
@@ -118,7 +118,7 @@ class Voucher extends Controller {
if ($voucher_type_int > 5)
{
- $this->messages->add('Invalid voucher type', 'error');
+ $this->messages->add('Invalid voucher type.', 'error');
redirect('voucher/show/all');
return;
} else if ($voucher_type == "draft") {
@@ -216,7 +216,7 @@ class Voucher extends Controller {
$this->template->set('page_title', 'View Journal Voucher');
break;
default :
- $this->messages->add('Invalid voucher type', 'error');
+ $this->messages->add('Invalid voucher type.', 'error');
redirect('voucher/show/all');
return;
break;
@@ -225,14 +225,14 @@ class Voucher extends Controller {
/* Load current voucher details */
if ( ! $cur_voucher = $this->Voucher_model->get_voucher($voucher_id, $voucher_type))
{
- $this->messages->add('Invalid Voucher', 'error');
+ $this->messages->add('Invalid Voucher.', 'error');
redirect('voucher/show/' . $voucher_type);
return;
}
/* Load current voucher details */
if ( ! $cur_voucher_ledgers = $this->db->query("SELECT * FROM voucher_items WHERE voucher_id = ? ORDER BY id ASC", array($voucher_id)))
{
- $this->messages->add('Voucher has no associated ledger data', 'error');
+ $this->messages->add('Voucher has no associated ledger data.', 'error');
}
$data['cur_voucher'] = $cur_voucher;
$data['cur_voucher_ledgers'] = $cur_voucher_ledgers;
@@ -258,7 +258,7 @@ class Voucher extends Controller {
$this->template->set('page_title', 'New Journal Voucher');
break;
default :
- $this->messages->add('Invalid voucher type', 'error');
+ $this->messages->add('Invalid voucher type.', 'error');
redirect('voucher/show/all');
return;
break;
@@ -373,7 +373,7 @@ class Voucher extends Controller {
$this->template->load('template', 'voucher/add', $data);
return;
} else if ($dr_total == 0 && $cr_total == 0) {
- $this->messages->add('Cannot save empty voucher', 'error');
+ $this->messages->add('Cannot save empty voucher.', 'error');
$this->template->load('template', 'voucher/add', $data);
return;
}
@@ -405,7 +405,7 @@ class Voucher extends Controller {
if ( ! $this->db->query("INSERT INTO vouchers (number, date, narration, draft, type, tag_id) VALUES (?, ?, ?, ?, ?, ?)", array($data_number, $data_date, $data_narration, $data_draft, $data_type, $data_tag)))
{
$this->db->trans_rollback();
- $this->messages->add('Error addding Voucher A/C', 'error');
+ $this->messages->add('Error addding Voucher A/C.', 'error');
$this->logger->write_message("error", "Error adding " . ucfirst($voucher_type) . " Voucher number " . voucher_number_prefix($voucher_type) . $data_number . " since failed inserting voucher");
$this->template->load('template', 'voucher/add', $data);
return;
@@ -440,7 +440,7 @@ class Voucher extends Controller {
if ( ! $this->db->query("INSERT INTO voucher_items (voucher_id, ledger_id, amount, dc) VALUES (?, ?, ?, ?)", array($voucher_id, $data_ledger_id, $data_amount, $data_ledger_dc)))
{
$this->db->trans_rollback();
- $this->messages->add('Error addding Ledger A/C ' . $data_ledger_id, 'error');
+ $this->messages->add('Error addding Ledger A/C ' . $data_ledger_id . '.', 'error');
$this->logger->write_message("error", "Error adding " . ucfirst($voucher_type) . " Voucher number " . voucher_number_prefix($voucher_type) . $data_number . " since failed inserting voucher ledger items " . "[id:" . $data_ledger_id . "]");
$this->template->load('template', 'voucher/add', $data);
return;
@@ -451,7 +451,7 @@ class Voucher extends Controller {
if ( ! $this->db->query("UPDATE vouchers SET dr_total = ?, cr_total = ? WHERE id = ?", array($dr_total, $cr_total, $voucher_id)))
{
$this->db->trans_rollback();
- $this->messages->add('Error updating voucher total', 'error');
+ $this->messages->add('Error updating voucher total.', 'error');
$this->logger->write_message("error", "Error adding " . ucfirst($voucher_type) . " Voucher number " . voucher_number_prefix($voucher_type) . $data_number . " since failed updating debit and credit total");
$this->template->load('template', 'voucher/add', $data);
return;
@@ -459,7 +459,7 @@ class Voucher extends Controller {
/* Success */
$this->db->trans_complete();
- $this->messages->add(ucfirst($voucher_type) . ' Voucher number ' . voucher_number_prefix($voucher_type) . $data_number . ' added successfully', 'success');
+ $this->messages->add(ucfirst($voucher_type) . ' Voucher number ' . voucher_number_prefix($voucher_type) . $data_number . ' added successfully.', 'success');
$this->logger->write_message("success", "Added " . ucfirst($voucher_type) . " Voucher number " . voucher_number_prefix($voucher_type) . $data_number);
redirect('voucher/show/' . $voucher_type);
$this->template->load('template', 'voucher/add', $data);
@@ -485,7 +485,7 @@ class Voucher extends Controller {
$this->template->set('page_title', 'Edit Journal Voucher');
break;
default :
- $this->messages->add('Invalid voucher type', 'error');
+ $this->messages->add('Invalid voucher type.', 'error');
redirect('voucher/show/all');
return;
break;
@@ -494,7 +494,7 @@ class Voucher extends Controller {
/* Load current voucher details */
if ( ! $cur_voucher = $this->Voucher_model->get_voucher($voucher_id, $voucher_type))
{
- $this->messages->add('Invalid Voucher', 'error');
+ $this->messages->add('Invalid Voucher.', 'error');
redirect('voucher/show/' . $voucher_type);
return;
}
@@ -629,7 +629,7 @@ class Voucher extends Controller {
$this->template->load('template', 'voucher/edit', $data);
return;
} else if ($dr_total == 0 && $cr_total == 0) {
- $this->messages->add('Cannot save empty voucher', 'error');
+ $this->messages->add('Cannot save empty voucher.', 'error');
$this->template->load('template', 'voucher/edit', $data);
return;
}
@@ -660,7 +660,7 @@ class Voucher extends Controller {
if ( ! $this->db->query("UPDATE vouchers SET number = ?, date = ?, narration = ?, draft = ?, tag_id = ? WHERE id = ?", array($data_number, $data_date, $data_narration, $data_draft, $data_tag, $voucher_id)))
{
$this->db->trans_rollback();
- $this->messages->add('Error updating Voucher A/C', 'error');
+ $this->messages->add('Error updating Voucher A/C.', 'error');
$this->logger->write_message("error", "Error updating voucher details for " . ucfirst($voucher_type) . " Voucher number " . voucher_number_prefix($voucher_type) . $data_number . " [id:" . $voucher_id . "]");
$this->template->load('template', 'voucher/edit', $data);
return;
@@ -703,7 +703,7 @@ class Voucher extends Controller {
if ( ! $this->db->query("INSERT INTO voucher_items (voucher_id, ledger_id, amount, dc) VALUES (?, ?, ?, ?)", array($voucher_id, $data_ledger_id, $data_amount, $data_ledger_dc)))
{
$this->db->trans_rollback();
- $this->messages->add('Error updating Ledger A/C ' . $data_ledger_id, 'error');
+ $this->messages->add('Error updating Ledger A/C ' . $data_ledger_id . '.', 'error');
$this->logger->write_message("error", "Error updating new voucher item [id:" . $data_ledger_id . "] for " . ucfirst($voucher_type) . " Voucher number " . voucher_number_prefix($voucher_type) . $data_number . " [id:" . $voucher_id . "]");
$this->template->load('template', 'voucher/edit', $data);
return;
@@ -714,7 +714,7 @@ class Voucher extends Controller {
if ( ! $this->db->query("UPDATE vouchers SET dr_total = ?, cr_total = ? WHERE id = ?", array($dr_total, $cr_total, $voucher_id)))
{
$this->db->trans_rollback();
- $this->messages->add('Error updating voucher total', 'error');
+ $this->messages->add('Error updating voucher total.', 'error');
$this->logger->write_message("error", "Error updating voucher total for " . ucfirst($voucher_type) . " Voucher number " . voucher_number_prefix($voucher_type) . $data_number . " [id:" . $voucher_id . "]");
$this->template->load('template', 'voucher/edit', $data);
return;
@@ -722,7 +722,7 @@ class Voucher extends Controller {
/* Success */
$this->db->trans_complete();
- $this->messages->add(ucfirst($voucher_type) . ' Voucher number ' . voucher_number_prefix($voucher_type) . $data_number . ' updated successfully', 'success');
+ $this->messages->add(ucfirst($voucher_type) . ' Voucher number ' . voucher_number_prefix($voucher_type) . $data_number . ' updated successfully.', 'success');
$this->logger->write_message("success", "Updated " . ucfirst($voucher_type) . " Voucher number " . voucher_number_prefix($voucher_type) . $data_number . " [id:" . $voucher_id . "]");
redirect('voucher/show/' . $voucher_type);
return;
@@ -735,7 +735,7 @@ class Voucher extends Controller {
/* Load current voucher details */
if ( ! $cur_voucher = $this->Voucher_model->get_voucher($voucher_id, $voucher_type))
{
- $this->messages->add('Invalid Voucher', 'error');
+ $this->messages->add('Invalid Voucher.', 'error');
redirect('voucher/show/' . $voucher_type);
return;
}
@@ -744,7 +744,7 @@ class Voucher extends Controller {
if ( ! $this->db->query("DELETE FROM voucher_items WHERE voucher_id = ?", array($voucher_id)))
{
$this->db->trans_rollback();
- $this->messages->add('Error deleting Voucher - Ledgers entry', 'error');
+ $this->messages->add('Error deleting Voucher - Ledgers entry.', 'error');
$this->logger->write_message("error", "Error deleting ledger entries for " . ucfirst($voucher_type) . " Voucher number " . voucher_number_prefix($voucher_type) . $cur_voucher->number . " [id:" . $voucher_id . "]");
redirect('voucher/' . $voucher_type . '/' . $voucher_id);
return;
@@ -752,13 +752,13 @@ class Voucher extends Controller {
if ( ! $this->db->query("DELETE FROM vouchers WHERE id = ?", array($voucher_id)))
{
$this->db->trans_rollback();
- $this->messages->add('Error deleting Voucher entry', 'error');
+ $this->messages->add('Error deleting Voucher entry.', 'error');
$this->logger->write_message("error", "Error deleting voucher entry for " . ucfirst($voucher_type) . " Voucher number " . voucher_number_prefix($voucher_type) . $cur_voucher->number . " [id:" . $voucher_id . "]");
redirect('voucher/' . $voucher_type . '/' . $voucher_id);
return;
}
$this->db->trans_complete();
- $this->messages->add('Voucher deleted successfully', 'success');
+ $this->messages->add('Voucher deleted successfully.', 'success');
$this->logger->write_message("success", "Deleted " . ucfirst($voucher_type) . " Voucher number " . voucher_number_prefix($voucher_type) . $cur_voucher->number . " [id:" . $voucher_id . "]");
redirect('voucher/show/' . $voucher_type);
return;
@@ -774,7 +774,7 @@ class Voucher extends Controller {
/* Load current voucher details */
if ( ! $cur_voucher = $this->Voucher_model->get_voucher($voucher_id, $voucher_type))
{
- $this->messages->add('Invalid Voucher', 'error');
+ $this->messages->add('Invalid Voucher.', 'error');
redirect('voucher/show/' . $voucher_type);
return;
}
@@ -821,7 +821,7 @@ class Voucher extends Controller {
/* Load current voucher details */
if ( ! $cur_voucher = $this->Voucher_model->get_voucher($voucher_id, $voucher_type))
{
- $this->messages->add('Invalid Voucher', 'error');
+ $this->messages->add('Invalid Voucher.', 'error');
redirect('voucher/show/' . $voucher_type);
return;
}
commit 7026309d8dfdf4c4544141144e11789ee9b74a44
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sat Dec 18 11:52:29 2010 +0530
Added accounts backup
- Created backups directory
- Added .htaccess file to backups directory to prevent unauthorized
access
- Added config file settings backup_path
- Added permission checks for backups directory
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
diff --git a/backups/.htaccess b/backups/.htaccess
new file mode 100644
index 0000000..8d2f256
--- /dev/null
+++ b/backups/.htaccess
@@ -0,0 +1 @@
+deny from all
diff --git a/system/application/config/config.php b/system/application/config/config.php
index a5cd306..5c95641 100644
--- a/system/application/config/config.php
+++ b/system/application/config/config.php
@@ -358,5 +358,15 @@ $config['asset_path'] = 'system/application/assets/';
*/
$config['config_path'] = 'config/';
+/*
+|--------------------------------------------------------------------------
+| Custom : Backup Path
+|--------------------------------------------------------------------------
+|
+| Sets the base backup path for all account backups
+|
+*/
+$config['backup_path'] = 'backups/';
+
/* End of file config.php */
/* Location: ./system/application/config/config.php */
diff --git a/system/application/controllers/admin/welcome.php b/system/application/controllers/admin/welcome.php
index 2526902..4db7c31 100644
--- a/system/application/controllers/admin/welcome.php
+++ b/system/application/controllers/admin/welcome.php
@@ -152,15 +152,22 @@ class Welcome extends Controller {
$check_path = $this->config->item('config_path') . "settings/";
if (! is_writable($check_path))
{
- $this->messages->add('Application settings directory "' . $check_path . '" is not writable. You will not able able to save or edit any application related settings.', 'error');
+ $this->messages->add('Application settings directory "' . $check_path . '" is not writable. You will not able to save or edit any application related settings.', 'error');
}
$check_path = $this->config->item('config_path') . "accounts/";
if (! is_writable($check_path))
{
- $this->messages->add('Account settings directory "' . $check_path . '" is not writable. You will not able able to save or edit any account related settings.', 'error');
+ $this->messages->add('Account settings directory "' . $check_path . '" is not writable. You will not able to save or edit any account related settings.', 'error');
}
+ $check_path = $this->config->item('backup_path');
+ if (! is_writable($check_path))
+ {
+ $this->messages->add('Backup directory "' . $check_path . '" is not writable. You will not able to save or download any backups.', 'error');
+ }
+
+ /* Security checks */
$check_path = $this->config->item('config_path');
if (substr(symbolic_permissions(fileperms($check_path)), -3, 1) == "r")
{
@@ -190,6 +197,16 @@ class Welcome extends Controller {
{
$this->messages->add('Security Risk ! The application settings directory "' . $check_path . '" is world writeable.', 'error');
}
+
+ $check_path = $this->config->item('backup_path');
+ if (substr(symbolic_permissions(fileperms($check_path)), -3, 1) == "r")
+ {
+ $this->messages->add('Security Risk ! The application backup directory "' . $check_path . '" is world readable.', 'error');
+ }
+ if (substr(symbolic_permissions(fileperms($check_path)), -2, 1) == "W")
+ {
+ $this->messages->add('Security Risk ! The application backup directory "' . $check_path . '" is world writeable.', 'error');
+ }
}
}
diff --git a/system/application/controllers/setting.php b/system/application/controllers/setting.php
index 6eefd5f..6162040 100644
--- a/system/application/controllers/setting.php
+++ b/system/application/controllers/setting.php
@@ -789,9 +789,9 @@ class Setting extends Controller {
$backup_data =& $this->dbutil->backup();
/* Write the backup file to server */
- if ( ! write_file('system/application/backups/' . $backup_filename, $backup_data))
+ if ( ! write_file($this->config->item('backup_path') . $backup_filename, $backup_data))
{
- $this->messages->add('Error saving backup file to server.' . ' Please check if "system/application/backups/" folder is writable', 'error');
+ $this->messages->add('Error saving backup file to server.' . ' Please check if "' . $this->config->item('backup_path') . '" folder is writable', 'error');
redirect('setting');
return;
}
commit aa6bfd448e87d48ec5e6f4c3f83353a0b7340510
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sat Dec 18 11:34:32 2010 +0530
Check permissions of /config directory
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
diff --git a/system/application/controllers/admin/welcome.php b/system/application/controllers/admin/welcome.php
index a36d67a..2526902 100644
--- a/system/application/controllers/admin/welcome.php
+++ b/system/application/controllers/admin/welcome.php
@@ -139,9 +139,58 @@ class Welcome extends Controller {
if ($data['current_account'] == "")
$data['current_account'] = "No account is currently active. You can " . anchor('admin/create', 'create', array('title' => 'Create a new account', 'style' => 'color:#000000')) . " a new account or " . anchor('admin/active', 'activate', array('title' => 'Activate a existing account', 'style' => 'color:#000000')) . " an existing account";
+ /* check for permissions */
+ $this->_check_permissions();
+
$this->template->load('admin_template', 'admin/welcome', $data);
return;
}
+
+ /* Check application file permissions for any security related issues */
+ function _check_permissions()
+ {
+ $check_path = $this->config->item('config_path') . "settings/";
+ if (! is_writable($check_path))
+ {
+ $this->messages->add('Application settings directory "' . $check_path . '" is not writable. You will not able able to save or edit any application related settings.', 'error');
+ }
+
+ $check_path = $this->config->item('config_path') . "accounts/";
+ if (! is_writable($check_path))
+ {
+ $this->messages->add('Account settings directory "' . $check_path . '" is not writable. You will not able able to save or edit any account related settings.', 'error');
+ }
+
+ $check_path = $this->config->item('config_path');
+ if (substr(symbolic_permissions(fileperms($check_path)), -3, 1) == "r")
+ {
+ $this->messages->add('Security Risk ! The application config directory "' . $check_path . '" is world readable.', 'error');
+ }
+ if (substr(symbolic_permissions(fileperms($check_path)), -2, 1) == "W")
+ {
+ $this->messages->add('Security Risk ! The application config directory "' . $check_path . '" is world writeable.', 'error');
+ }
+
+ $check_path = $this->config->item('config_path') . "accounts/";
+ if (substr(symbolic_permissions(fileperms($check_path)), -3, 1) == "r")
+ {
+ $this->messages->add('Security Risk ! The application accounts directory "' . $check_path . '" is world readable.', 'error');
+ }
+ if (substr(symbolic_permissions(fileperms($check_path)), -2, 1) == "W")
+ {
+ $this->messages->add('Security Risk ! The application accounts directory "' . $check_path . '" is world writeable.', 'error');
+ }
+
+ $check_path = $this->config->item('config_path') . "settings/";
+ if (substr(symbolic_permissions(fileperms($check_path)), -3, 1) == "r")
+ {
+ $this->messages->add('Security Risk ! The application settings directory "' . $check_path . '" is world readable.', 'error');
+ }
+ if (substr(symbolic_permissions(fileperms($check_path)), -2, 1) == "W")
+ {
+ $this->messages->add('Security Risk ! The application settings directory "' . $check_path . '" is world writeable.', 'error');
+ }
+ }
}
/* End of file welcome.php */
commit 5b58fc9ec6e9b6b9ebb9b8023a5700d37b7b1ee7
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sat Dec 18 11:34:07 2010 +0530
Removed label column from settings table
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
diff --git a/system/application/controllers/admin/carryforward.sql b/system/application/controllers/admin/carryforward.sql
index 17ffdbe..d7b5037 100644
--- a/system/application/controllers/admin/carryforward.sql
+++ b/system/application/controllers/admin/carryforward.sql
@@ -18,7 +18,6 @@ CREATE TABLE IF NOT EXISTS ledgers (
CREATE TABLE IF NOT EXISTS settings (
id int(1) NOT NULL,
- label varchar(255) NOT NULL,
name varchar(100) NOT NULL,
address varchar(255) NOT NULL,
email varchar(100) NOT NULL,
diff --git a/system/application/controllers/admin/create.php b/system/application/controllers/admin/create.php
index 0f5a9d7..6157126 100644
--- a/system/application/controllers/admin/create.php
+++ b/system/application/controllers/admin/create.php
@@ -273,7 +273,7 @@ class Create extends Controller {
}
/* Adding the account settings */
- $newacc->query("INSERT INTO settings (id, label, name, address, email, fy_start, fy_end, currency_symbol, date_format, timezone, database_version) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", array(1, "", $data_account_name, $data_account_address, $data_account_email, $data_fy_start, $data_fy_end, $data_account_currency, $data_account_date, $data_account_timezone, 1));
+ $newacc->query("INSERT INTO settings (id, name, address, email, fy_start, fy_end, currency_symbol, date_format, timezone, database_version) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", array(1, $data_account_name, $data_account_address, $data_account_email, $data_fy_start, $data_fy_end, $data_account_currency, $data_account_date, $data_account_timezone, 1));
$this->messages->add("Successfully created webzash account", 'success');
/* Adding account settings to file. Code copied from manage controller */
diff --git a/system/application/controllers/admin/database.sql b/system/application/controllers/admin/database.sql
index db58541..ffdf48f 100644
--- a/system/application/controllers/admin/database.sql
+++ b/system/application/controllers/admin/database.sql
@@ -18,7 +18,6 @@ CREATE TABLE IF NOT EXISTS ledgers (
CREATE TABLE IF NOT EXISTS settings (
id int(1) NOT NULL,
- label varchar(255) NOT NULL,
name varchar(100) NOT NULL,
address varchar(255) NOT NULL,
email varchar(100) NOT NULL,
diff --git a/system/application/controllers/setting.php b/system/application/controllers/setting.php
index 4d9d1db..6eefd5f 100644
--- a/system/application/controllers/setting.php
+++ b/system/application/controllers/setting.php
@@ -368,7 +368,7 @@ class Setting extends Controller {
}
/* Adding the account settings */
- $newacc->query("INSERT INTO settings (id, label, name, address, email, fy_start, fy_end, currency_symbol, date_format, timezone, email_protocol, email_host, email_port, email_username, email_password, database_version) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", array(1, "", $data_account_name, $data_account_address, $data_account_email, $data_fy_start, $data_fy_end, $data_account_currency, $data_account_date, $data_account_timezone, $data_account_email_protocol, $data_account_email_host, $data_account_email_port, $data_account_email_username, $data_account_email_password, 1));
+ $newacc->query("INSERT INTO settings (id, name, address, email, fy_start, fy_end, currency_symbol, date_format, timezone, email_protocol, email_host, email_port, email_username, email_password, database_version) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", array(1, $data_account_name, $data_account_address, $data_account_email, $data_fy_start, $data_fy_end, $data_account_currency, $data_account_date, $data_account_timezone, $data_account_email_protocol, $data_account_email_host, $data_account_email_port, $data_account_email_username, $data_account_email_password, 1));
$this->messages->add("Successfully created webzash account", 'success');
commit 78c8c7e4902ed1ef0f2a8224f34ad8808f2e75fb
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sat Dec 18 10:47:49 2010 +0530
Moved the settings files in root folder
- Added the config directory to the root of application
- Added .htaccess to prevent direct access to it
- Added a config settings named config_path that can be changed
- Updated the application throughout to use this new config_path
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
diff --git a/config/.htaccess b/config/.htaccess
new file mode 100644
index 0000000..8d2f256
--- /dev/null
+++ b/config/.htaccess
@@ -0,0 +1 @@
+deny from all
diff --git a/config/accounts/index.html b/config/accounts/index.html
new file mode 100644
index 0000000..c942a79
--- /dev/null
+++ b/config/accounts/index.html
@@ -0,0 +1,10 @@
+<html>
+<head>
+ <title>403 Forbidden</title>
+</head>
+<body>
+
+<p>Directory access is forbidden.</p>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/config/accounts/sample.ini b/config/accounts/sample.ini
new file mode 100644
index 0000000..2f8fa22
--- /dev/null
+++ b/config/accounts/sample.ini
@@ -0,0 +1,7 @@
+[database]
+db_hostname = "localhost"
+db_port = "3306"
+db_name = "wz_webzash"
+db_username = "root"
+db_password = ""
+
diff --git a/config/accounts/test.ini b/config/accounts/test.ini
new file mode 100644
index 0000000..c04d401
--- /dev/null
+++ b/config/accounts/test.ini
@@ -0,0 +1,7 @@
+[database]
+db_hostname = "localhost"
+db_port = "3306"
+db_name = "testing"
+db_username = "root"
+db_password = ""
+
diff --git a/config/settings/general.ini b/config/settings/general.ini
new file mode 100644
index 0000000..037e2ae
--- /dev/null
+++ b/config/settings/general.ini
@@ -0,0 +1,3 @@
+[general]
+row_count = "10"
+
diff --git a/system/application/config/accounts/index.html b/system/application/config/accounts/index.html
deleted file mode 100644
index c942a79..0000000
--- a/system/application/config/accounts/index.html
+++ /dev/null
@@ -1,10 +0,0 @@
-<html>
-<head>
- <title>403 Forbidden</title>
-</head>
-<body>
-
-<p>Directory access is forbidden.</p>
-
-</body>
-</html>
\ No newline at end of file
diff --git a/system/application/config/accounts/sample.ini b/system/application/config/accounts/sample.ini
deleted file mode 100644
index 2f8fa22..0000000
--- a/system/application/config/accounts/sample.ini
+++ /dev/null
@@ -1,7 +0,0 @@
-[database]
-db_hostname = "localhost"
-db_port = "3306"
-db_name = "wz_webzash"
-db_username = "root"
-db_password = ""
-
diff --git a/system/application/config/accounts/test.ini b/system/application/config/accounts/test.ini
deleted file mode 100644
index c04d401..0000000
--- a/system/application/config/accounts/test.ini
+++ /dev/null
@@ -1,7 +0,0 @@
-[database]
-db_hostname = "localhost"
-db_port = "3306"
-db_name = "testing"
-db_username = "root"
-db_password = ""
-
diff --git a/system/application/config/config.php b/system/application/config/config.php
index 08e7d6d..a5cd306 100644
--- a/system/application/config/config.php
+++ b/system/application/config/config.php
@@ -348,5 +348,15 @@ $config['proxy_ips'] = '';
*/
$config['asset_path'] = 'system/application/assets/';
+/*
+|--------------------------------------------------------------------------
+| Custom : Config Path
+|--------------------------------------------------------------------------
+|
+| Sets the base config path for all account related settings
+|
+*/
+$config['config_path'] = 'config/';
+
/* End of file config.php */
/* Location: ./system/application/config/config.php */
diff --git a/system/application/config/general.ini b/system/application/config/general.ini
deleted file mode 100644
index 037e2ae..0000000
--- a/system/application/config/general.ini
+++ /dev/null
@@ -1,3 +0,0 @@
-[general]
-row_count = "10"
-
diff --git a/system/application/controllers/admin/active.php b/system/application/controllers/admin/active.php
index 30b2210..f6780fb 100644
--- a/system/application/controllers/admin/active.php
+++ b/system/application/controllers/admin/active.php
@@ -21,8 +21,8 @@ class Active extends Controller {
$data['account'] = "";
}
- /* Getting list of files in the config/accounts directory */
- $accounts_list = get_filenames('system/application/config/accounts');
+ /* Getting list of files in the config - accounts directory */
+ $accounts_list = get_filenames($this->config->item('config_path') . 'accounts');
$data['accounts'] = array();
if ($accounts_list)
{
@@ -64,7 +64,7 @@ class Active extends Controller {
} else {
$db_label = $this->input->post('account', TRUE);
}
- $ini_file = "system/application/config/accounts/" . $db_label . ".ini";
+ $ini_file = $this->config->item('config_path') . "accounts/" . $db_label . ".ini";
/* Check if database ini file exists */
if ( ! get_file_info($ini_file))
diff --git a/system/application/controllers/admin/create.php b/system/application/controllers/admin/create.php
index 22fb2ea..0f5a9d7 100644
--- a/system/application/controllers/admin/create.php
+++ b/system/application/controllers/admin/create.php
@@ -199,7 +199,7 @@ class Create extends Controller {
$data_database_username = $this->input->post('database_username', TRUE);
$data_database_password = $this->input->post('database_password', TRUE);
- $ini_file = "system/application/config/accounts/" . $data_account_label . ".ini";
+ $ini_file = $this->config->item('config_path') . "accounts/" . $data_account_label . ".ini";
/* Check if database ini file exists */
if (get_file_info($ini_file))
diff --git a/system/application/controllers/admin/manage.php b/system/application/controllers/admin/manage.php
index 33c3cc1..689431e 100644
--- a/system/application/controllers/admin/manage.php
+++ b/system/application/controllers/admin/manage.php
@@ -14,8 +14,8 @@ class Manage extends Controller {
$this->template->set('page_title', 'Manage webzash accounts');
$this->template->set('nav_links', array('admin/manage/add' => 'New account'));
- /* Getting list of files in the config/accounts directory */
- $accounts_list = get_filenames('system/application/config/accounts');
+ /* Getting list of files in the config - accounts directory */
+ $accounts_list = get_filenames($this->config->item('config_path') . 'accounts');
$data['accounts'] = array();
if ($accounts_list)
{
@@ -119,7 +119,7 @@ class Manage extends Controller {
$data_database_username = $this->input->post('database_username', TRUE);
$data_database_password = $this->input->post('database_password', TRUE);
- $ini_file = "system/application/config/accounts/" . $data_database_label . ".ini";
+ $ini_file = $this->config->item('config_path') . "accounts/" . $data_database_label . ".ini";
/* Check if database ini file exists */
if (get_file_info($ini_file))
@@ -153,7 +153,7 @@ class Manage extends Controller {
{
$this->template->set('page_title', 'Edit a webzash account');
- $ini_file = "system/application/config/accounts/" . $database_label . ".ini";
+ $ini_file = $this->config->item('config_path') . "accounts/" . $database_label . ".ini";
/* Form fields */
$data['database_name'] = array(
@@ -262,7 +262,7 @@ class Manage extends Controller {
$data_database_username = $this->input->post('database_username', TRUE);
$data_database_password = $this->input->post('database_password', TRUE);
- $ini_file = "system/application/config/accounts/" . $database_label . ".ini";
+ $ini_file = $this->config->item('config_path') . "accounts/" . $database_label . ".ini";
$con_details = "[database]" . "\r\n" . "db_hostname = \"" . $data_database_host . "\"" . "\r\n" . "db_port = \"" . $data_database_port . "\"" . "\r\n" . "db_name = \"" . $data_database_name . "\"" . "\r\n" . "db_username = \"" . $data_database_username . "\"" . "\r\n" . "db_password = \"" . $data_database_password . "\"" . "\r\n";
@@ -288,7 +288,7 @@ class Manage extends Controller {
{
$this->template->set('page_title', 'Delete a webzash account');
- $ini_file = "system/application/config/accounts/" . $database_label . ".ini";
+ $ini_file = $this->config->item('config_path') . "accounts/" . $database_label . ".ini";
$this->messages->add("Please delete " . $ini_file . " file manually", 'error');
$this->messages->add("Note that only the settings file will be delete. Account database will have to be deleted manually", 'status');
/*
diff --git a/system/application/controllers/admin/setting.php b/system/application/controllers/admin/setting.php
index 0ab3611..0f70ab5 100644
--- a/system/application/controllers/admin/setting.php
+++ b/system/application/controllers/admin/setting.php
@@ -16,7 +16,7 @@ class Setting extends Controller {
$data['row_count'] = 20;
/* Loading settings from ini file */
- $ini_file = "system/application/config/general.ini";
+ $ini_file = $this->config->item('config_path') . "settings/general.ini";
/* Check if database ini file exists */
if (get_file_info($ini_file))
diff --git a/system/application/controllers/admin/welcome.php b/system/application/controllers/admin/welcome.php
index 59112b1..a36d67a 100644
--- a/system/application/controllers/admin/welcome.php
+++ b/system/application/controllers/admin/welcome.php
@@ -22,7 +22,7 @@ class Welcome extends Controller {
/* Fetching database label details from session */
$db_active_label = $this->session->userdata('db_active_label');
- $ini_file = "system/application/config/accounts/" . $db_active_label . ".ini";
+ $ini_file = $this->config->item('config_path') . "accounts/" . $db_active_label . ".ini";
/* Check if database ini file exists */
if ( ! get_file_info($ini_file))
diff --git a/system/application/controllers/setting.php b/system/application/controllers/setting.php
index 2722ceb..4d9d1db 100644
--- a/system/application/controllers/setting.php
+++ b/system/application/controllers/setting.php
@@ -294,7 +294,7 @@ class Setting extends Controller {
$data_database_username = $this->input->post('database_username', TRUE);
$data_database_password = $this->input->post('database_password', TRUE);
- $ini_file = "system/application/config/accounts/" . $data_account_label . ".ini";
+ $ini_file = $this->config->item('config_path') . "accounts/" . $data_account_label . ".ini";
/* Check if database ini file exists */
if (get_file_info($ini_file))
diff --git a/system/application/libraries/Startup.php b/system/application/libraries/Startup.php
index f7b52ea..1c9129b 100644
--- a/system/application/libraries/Startup.php
+++ b/system/application/libraries/Startup.php
@@ -24,7 +24,7 @@ class Startup
{
/* Fetching database label details from session */
$db_active_label = $CI->session->userdata('db_active_label');
- $ini_file = "system/application/config/accounts/" . $db_active_label . ".ini";
+ $ini_file = $CI->config->item('config_path') . "accounts/" . $db_active_label . ".ini";
/* Check if database ini file exists */
if ( ! get_file_info($ini_file))
@@ -150,7 +150,7 @@ class Startup
$CI->config->set_item('account_journal_prefix', $account_d->journal_voucher_prefix);
/************** Load general application settings *************/
- $setting_ini_file = "system/application/config/general.ini";
+ $setting_ini_file = $CI->config->item('config_path') . "settings/general.ini";
$CI->config->set_item('row_count', 20);
/* Check if general application settings ini file exists */
diff --git a/system/application/views/admin/manage/index.php b/system/application/views/admin/manage/index.php
index 23d07af..8c7561e 100644
--- a/system/application/views/admin/manage/index.php
+++ b/system/application/views/admin/manage/index.php
@@ -10,7 +10,7 @@ echo "<tbody>";
$odd_even = "odd";
foreach ($accounts as $label)
{
- $ini_file = "system/application/config/accounts/" . $label . ".ini";
+ $ini_file = $this->config->item('config_path') . "accounts/" . $label . ".ini";
/* Check if database ini file exists */
if (get_file_info($ini_file))
commit 42bc119ae13153087e28efa3e81f357e39b5f6fe
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Fri Dec 17 17:28:12 2010 +0530
Added Download Voucher links and icon
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
diff --git a/system/application/assets/images/icons/download.png b/system/application/assets/images/icons/download.png
new file mode 100644
index 0000000..9b36fc3
Binary files /dev/null and b/system/application/assets/images/icons/download.png differ
diff --git a/system/application/controllers/voucher.php b/system/application/controllers/voucher.php
index efa302c..815d7f5 100644
--- a/system/application/controllers/voucher.php
+++ b/system/application/controllers/voucher.php
@@ -183,7 +183,9 @@ class Voucher extends Controller {
$html .= " " . anchor_popup('voucher/printpreview/' . strtolower($html_voucher_type) . "/" . $row->id , img(array('src' => asset_url() . "images/icons/print.png", 'border' => '0', 'alt' => 'Print ' . ucfirst($html_voucher_type) . ' Voucher')), array('title' => 'Print ' . ucfirst($html_voucher_type) . ' Voucher', 'width' => '600', 'height' => '600')) . " ";
- $html .= " " . anchor_popup('voucher/email/' . strtolower($html_voucher_type) . "/" . $row->id , img(array('src' => asset_url() . "images/icons/email.png", 'border' => '0', 'alt' => 'Email ' . ucfirst($html_voucher_type) . ' Voucher')), array('title' => 'Email ' . ucfirst($html_voucher_type) . ' Voucher', 'width' => '500', 'height' => '300')) . "</td>";
+ $html .= " " . anchor_popup('voucher/email/' . strtolower($html_voucher_type) . "/" . $row->id , img(array('src' => asset_url() . "images/icons/email.png", 'border' => '0', 'alt' => 'Email ' . ucfirst($html_voucher_type) . ' Voucher')), array('title' => 'Email ' . ucfirst($html_voucher_type) . ' Voucher', 'width' => '500', 'height' => '300')) . " ";
+
+ $html .= " " . anchor('voucher/download/' . strtolower($html_voucher_type) . "/" . $row->id , img(array('src' => asset_url() . "images/icons/save.png", 'border' => '0', 'alt' => 'Download ' . ucfirst($html_voucher_type) . ' Voucher', 'title' => "Download voucher")), array('title' => 'Download ' . ucfirst($html_voucher_type) . ' Voucher')) . "</td>";
$html .= "</tr>";
$odd_even = ($odd_even == "odd") ? "even" : "odd";
diff --git a/system/application/views/voucher/add.php b/system/application/views/voucher/add.php
index 37b097f..d094129 100644
--- a/system/application/views/voucher/add.php
+++ b/system/application/views/voucher/add.php
@@ -251,7 +251,7 @@ $(document).ready(function() {
echo " ";
echo form_checkbox('voucher_email', 1, $voucher_email) . "Email";
echo " ";
- echo form_checkbox('voucher_pdf', 1, $voucher_pdf) . "Download PDF";
+ echo form_checkbox('voucher_pdf', 1, $voucher_pdf) . "Download";
echo form_fieldset_close();
echo "</p>";
echo "<br /><br />";
diff --git a/system/application/views/voucher/edit.php b/system/application/views/voucher/edit.php
index 202f776..1171012 100644
--- a/system/application/views/voucher/edit.php
+++ b/system/application/views/voucher/edit.php
@@ -251,7 +251,7 @@ $(document).ready(function() {
echo " ";
echo form_checkbox('voucher_email', 1, $voucher_email) . "Email";
echo " ";
- echo form_checkbox('voucher_pdf', 1, $voucher_pdf) . "Download PDF";
+ echo form_checkbox('voucher_pdf', 1, $voucher_pdf) . "Download";
echo form_fieldset_close();
echo "</p>";
echo "<br /><br />";
diff --git a/system/application/views/voucher/view.php b/system/application/views/voucher/view.php
index f4f2710..35c3da0 100644
--- a/system/application/views/voucher/view.php
+++ b/system/application/views/voucher/view.php
@@ -62,4 +62,6 @@ else
echo anchor_popup('voucher/printpreview/' . $voucher_type . "/" . $cur_voucher->id, 'Print', array('title' => 'Print this ' . ucfirst($voucher_type) . ' Voucher', 'width' => '600', 'height' => '600'));
echo " | ";
echo anchor_popup('voucher/email/' . $voucher_type . "/" . $cur_voucher->id, 'Email', array('title' => 'Email this ' . ucfirst($voucher_type) . ' Voucher', 'width' => '400', 'height' => '200'));
+ echo " | ";
+ echo anchor('voucher/download/' . $voucher_type . "/" . $cur_voucher->id, 'Download', array('title' => "Download voucher", 'title' => 'Download this ' . ucfirst($voucher_type) . ' Voucher'));
commit adabf2de0fff76ad9773f254335004a23401664d
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Fri Dec 17 16:46:51 2010 +0530
Added index.html for security
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
diff --git a/system/application/config/accounts/index.html b/system/application/config/accounts/index.html
new file mode 100644
index 0000000..c942a79
--- /dev/null
+++ b/system/application/config/accounts/index.html
@@ -0,0 +1,10 @@
+<html>
+<head>
+ <title>403 Forbidden</title>
+</head>
+<body>
+
+<p>Directory access is forbidden.</p>
+
+</body>
+</html>
\ No newline at end of file
commit e0605d094eda27b95bf2da621a82517938a86545
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Fri Dec 17 16:40:08 2010 +0530
Replaced echo_value with print_value
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
diff --git a/system/application/controllers/setting.php b/system/application/controllers/setting.php
index 86a82b3..2722ceb 100644
--- a/system/application/controllers/setting.php
+++ b/system/application/controllers/setting.php
@@ -38,40 +38,53 @@ class Setting extends Controller {
'id' => 'account_name',
'maxlength' => '100',
'size' => '40',
- 'value' => ($account_data) ? echo_value($account_data->name) : '',
+ 'value' => '',
);
$data['account_address'] = array(
'name' => 'account_address',
'id' => 'account_address',
'rows' => '4',
'cols' => '47',
- 'value' => ($account_data) ? echo_value($account_data->address) : '',
+ 'value' => '',
);
$data['account_email'] = array(
'name' => 'account_email',
'id' => 'account_email',
'maxlength' => '100',
'size' => '40',
- 'value' => ($account_data) ? echo_value($account_data->email) : '',
+ 'value' => '',
);
- $data['fy_start'] = ($account_data) ? date_mysql_to_php(echo_value($account_data->fy_start)) : "error";
- $data['fy_end'] = ($account_data) ? date_mysql_to_php(echo_value($account_data->fy_end)) : "error";
+ $data['fy_start'] = '';
+ $data['fy_end'] = '';
$data['account_currency'] = array(
'name' => 'account_currency',
'id' => 'account_currency',
'maxlength' => '10',
'size' => '10',
- 'value' => ($account_data) ? echo_value($account_data->currency_symbol) : '',
+ 'value' => '',
);
$data['account_date_options'] = array(
'dd/mm/yyyy' => 'Day / Month / Year',
'mm/dd/yyyy' => 'Month / Day / Year',
'yyyy/mm/dd' => 'Year / Month / Day',
);
- $data['account_date'] = ($account_data) ? echo_value($account_data->date_format) : 'dd/mm/yyyy';
- $data['account_timezone'] = ($account_data) ? echo_value($account_data->timezone) : 'UTC';
+ $data['account_date'] = 'dd/mm/yyyy';
+ $data['account_timezone'] = 'UTC';
+
+ /* Current account settings */
+ if ($account_data)
+ {
+ $data['account_name']['value'] = print_value($account_data->name);
+ $data['account_address']['value'] = print_value($account_data->address);
+ $data['account_email']['value'] = print_value($account_data->email);
+ $data['account_currency']['value'] = print_value($account_data->currency_symbol);
+ $data['account_date'] = print_value($account_data->date_format);
+ $data['account_timezone'] = print_value($account_data->timezone);
+ $data['fy_start'] = date_mysql_to_php(print_value($account_data->fy_start));
+ $data['fy_end'] = date_mysql_to_php(print_value($account_data->fy_end));
+ }
/* Form validations */
$this->form_validation->set_rules('account_name', 'Account Name', 'trim|required|min_length[2]|max_length[100]');
@@ -490,10 +503,10 @@ class Setting extends Controller {
if ($account_data)
{
- $data['email_protocol'] = ($account_data->email_protocol) ? echo_value($account_data->email_protocol) : 'smtp';
- $data['email_host']['value'] = ($account_data->email_host) ? echo_value($account_data->email_host) : '';
- $data['email_port']['value'] = ($account_data->email_port) ? echo_value($account_data->email_port) : '';
- $data['email_username']['value'] = ($account_data->email_username) ? echo_value($account_data->email_username) : '';
+ $data['email_protocol'] = ($account_data->email_protocol) ? print_value($account_data->email_protocol) : 'smtp';
+ $data['email_host']['value'] = ($account_data->email_host) ? print_value($account_data->email_host) : '';
+ $data['email_port']['value'] = ($account_data->email_port) ? print_value($account_data->email_port) : '';
+ $data['email_username']['value'] = ($account_data->email_username) ? print_value($account_data->email_username) : '';
}
/* Form validations */
@@ -641,14 +654,14 @@ class Setting extends Controller {
if ($account_data)
{
- $data['paper_height']['value'] = ($account_data->print_paper_height) ? echo_value($account_data->print_paper_height) : '';
- $data['paper_width']['value'] = ($account_data->print_paper_width) ? echo_value($account_data->print_paper_width) : '';
- $data['margin_top']['value'] = ($account_data->print_margin_top) ? echo_value($account_data->print_margin_top) : '';
- $data['margin_bottom']['value'] = ($account_data->print_margin_bottom) ? echo_value($account_data->print_margin_bottom) : '';
- $data['margin_left']['value'] = ($account_data->print_margin_left) ? echo_value($account_data->print_margin_left) : '';
- $data['margin_right']['value'] = ($account_data->print_margin_right) ? echo_value($account_data->print_margin_right) : '';
- $data['page_layout']['value'] = ($account_data->print_page_layout) ? echo_value($account_data->print_page_layout) : '';
- $data['logo']['value'] = ($account_data->print_logo) ? echo_value($account_data->print_logo) : '';
+ $data['paper_height']['value'] = ($account_data->print_paper_height) ? print_value($account_data->print_paper_height) : '';
+ $data['paper_width']['value'] = ($account_data->print_paper_width) ? print_value($account_data->print_paper_width) : '';
+ $data['margin_top']['value'] = ($account_data->print_margin_top) ? print_value($account_data->print_margin_top) : '';
+ $data['margin_bottom']['value'] = ($account_data->print_margin_bottom) ? print_value($account_data->print_margin_bottom) : '';
+ $data['margin_left']['value'] = ($account_data->print_margin_left) ? print_value($account_data->print_margin_left) : '';
+ $data['margin_right']['value'] = ($account_data->print_margin_right) ? print_value($account_data->print_margin_right) : '';
+ $data['page_layout']['value'] = ($account_data->print_page_layout) ? print_value($account_data->print_page_layout) : '';
+ $data['logo']['value'] = ($account_data->print_logo) ? print_value($account_data->print_logo) : '';
if ($account_data->print_orientation)
{
if ($account_data->print_orientation == "P")
diff --git a/system/application/controllers/voucher.php b/system/application/controllers/voucher.php
index 7e9b51c..efa302c 100644
--- a/system/application/controllers/voucher.php
+++ b/system/application/controllers/voucher.php
@@ -293,7 +293,7 @@ class Voucher extends Controller {
$data['voucher_tag'] = 0;
/* Form validations */
- $this->form_validation->set_rules('voucher_number', 'Voucher Number', 'trim|is_natural|uniquevoucherno[' . v_to_n($voucher_type) . ']');
+ $this->form_validation->set_rules('voucher_number', 'Voucher Number', 'trim|required|is_natural_no_zero|uniquevoucherno[' . v_to_n($voucher_type) . ']');
$this->form_validation->set_rules('voucher_date', 'Voucher Date', 'trim|required|is_date|is_date_within_range');
$this->form_validation->set_rules('voucher_narration', 'trim');
$this->form_validation->set_rules('voucher_tag', 'Tag', 'trim|is_natural');
@@ -565,7 +565,7 @@ class Voucher extends Controller {
}
/* Form validations */
- $this->form_validation->set_rules('voucher_number', 'Voucher Number', 'trim|is_natural|uniquevouchernowithid[' . v_to_n($voucher_type) . '.' . $voucher_id . ']');
+ $this->form_validation->set_rules('voucher_number', 'Voucher Number', 'trim|required|is_natural_no_zero|uniquevouchernowithid[' . v_to_n($voucher_type) . '.' . $voucher_id . ']');
$this->form_validation->set_rules('voucher_date', 'Voucher Date', 'trim|required|is_date|is_date_within_range');
$this->form_validation->set_rules('voucher_narration', 'trim');
$this->form_validation->set_rules('voucher_tag', 'Tag', 'trim|is_natural');
diff --git a/system/application/helpers/custom_helper.php b/system/application/helpers/custom_helper.php
index d8de602..5a3617f 100644
--- a/system/application/helpers/custom_helper.php
+++ b/system/application/helpers/custom_helper.php
@@ -85,9 +85,9 @@ if ( ! function_exists('convert_cur'))
* @param a varaible
* @return string value
*/
-if ( ! function_exists('echo_value'))
+if ( ! function_exists('print_value'))
{
- function echo_value($value = NULL, $default = "")
+ function print_value($value = NULL, $default = "")
{
if (isset($value))
return $value;
diff --git a/system/application/views/voucher/add.php b/system/application/views/voucher/add.php
index 1bf5b6a..37b097f 100644
--- a/system/application/views/voucher/add.php
+++ b/system/application/views/voucher/add.php
@@ -245,13 +245,13 @@ $(document).ready(function() {
echo "<p>";
echo form_fieldset('Options', array('class' => "fieldset-auto-width"));
- echo form_checkbox('voucher_draft', 1, echo_value($voucher_draft, FALSE)) . "Draft";
+ echo form_checkbox('voucher_draft', 1, $voucher_draft) . "Draft";
echo "<br /><br />";
- echo form_checkbox('voucher_print', 1, echo_value($voucher_print, FALSE)) . "Print";
+ echo form_checkbox('voucher_print', 1, $voucher_print) . "Print";
echo " ";
- echo form_checkbox('voucher_email', 1, echo_value($voucher_email, FALSE)) . "Email";
+ echo form_checkbox('voucher_email', 1, $voucher_email) . "Email";
echo " ";
- echo form_checkbox('voucher_pdf', 1, echo_value($voucher_pdf, FALSE)) . "Download PDF";
+ echo form_checkbox('voucher_pdf', 1, $voucher_pdf) . "Download PDF";
echo form_fieldset_close();
echo "</p>";
echo "<br /><br />";
diff --git a/system/application/views/voucher/edit.php b/system/application/views/voucher/edit.php
index 24a92ac..202f776 100644
--- a/system/application/views/voucher/edit.php
+++ b/system/application/views/voucher/edit.php
@@ -245,13 +245,13 @@ $(document).ready(function() {
echo "<p>";
echo form_fieldset('Options', array('class' => "fieldset-auto-width"));
- echo form_checkbox('voucher_draft', 1, echo_value($voucher_draft, FALSE)) . "Draft";
+ echo form_checkbox('voucher_draft', 1, $voucher_draft) . "Draft";
echo "<br /><br />";
- echo form_checkbox('voucher_print', 1, echo_value($voucher_print, FALSE)) . "Print";
+ echo form_checkbox('voucher_print', 1, $voucher_print) . "Print";
echo " ";
- echo form_checkbox('voucher_email', 1, echo_value($voucher_email, FALSE)) . "Email";
+ echo form_checkbox('voucher_email', 1, $voucher_email) . "Email";
echo " ";
- echo form_checkbox('voucher_pdf', 1, echo_value($voucher_pdf, FALSE)) . "Download PDF";
+ echo form_checkbox('voucher_pdf', 1, $voucher_pdf) . "Download PDF";
echo form_fieldset_close();
echo "</p>";
echo "<br /><br />";
commit a465c63d471985ae48079a22191d7cbb4837acee
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Thu Dec 16 21:33:57 2010 +0530
Added Print report statement for Ledger St
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
diff --git a/system/application/assets/css/printreport.css b/system/application/assets/css/printreport.css
index f874ce4..1c31462 100644
--- a/system/application/assets/css/printreport.css
+++ b/system/application/assets/css/printreport.css
@@ -102,12 +102,39 @@ table.profit-loss-table tr td {
padding:5px 30px 5px 5px;
}
+table.profit-loss-table td.td-group {
+ font-weight:bold;
+}
+
table.profit-loss-total-table {
border:1px solid #000000;
background-color:#EEEEEE;
}
-table.profit-loss-table td.td-group {
+/**************************** LEDGER ACCOUNT ST *******************************/
+table.ledgerst-table {
+ border:1px solid #000000;
+ border-collapse: collapse;
+}
+
+table.ledgerst-table tr th {
+ text-align:left;
+ border:1px solid #000000;
+ padding:5px 30px 5px 5px;
+ background-color:#EEEEEE;
+}
+
+table.ledgerst-table tr td {
+ border:1px solid #000000;
+ padding:5px 30px 5px 5px;
+}
+
+table.ledgerst-total-table {
+ border:1px solid #000000;
+ background-color:#EEEEEE;
+}
+
+table.ledgerst-table td.td-group {
font-weight:bold;
}
diff --git a/system/application/controllers/report.php b/system/application/controllers/report.php
index 04ce8c5..4179524 100644
--- a/system/application/controllers/report.php
+++ b/system/application/controllers/report.php
@@ -54,13 +54,14 @@ class Report extends Controller {
$this->template->set('page_title', 'Ledger Statement');
if ($ledger_id != 0)
- $this->template->set('nav_links', array('report/download/ledgerst/' . $ledger_id => 'Download CSV'));
+ $this->template->set('nav_links', array('report/download/ledgerst/' . $ledger_id => 'Download CSV', 'report/printpreview/ledgerst/' . $ledger_id => 'Print Preview'));
if ($_POST)
{
$ledger_id = $this->input->post('ledger_id', TRUE);
redirect('report/ledgerst/' . $ledger_id);
}
+ $data['print_preview'] = FALSE;
$data['ledger_id'] = $ledger_id;
$this->template->load('template', 'report/ledgerst', $data);
return;
@@ -602,6 +603,24 @@ class Report extends Controller {
$this->load->view('report/report_template', $data);
return;
}
+
+ if ($statement == "ledgerst")
+ {
+ /* Pagination setup */
+ $this->load->library('pagination');
+ $data['ledger_id'] = $this->uri->segment(4);
+ /* Checking for valid ledger id */
+ if ($data['ledger_id'] < 1)
+ {
+ $this->messages->add("Invalid Ledger A/C", 'error');
+ redirect("report/ledgerst");
+ }
+ $data['report'] = "report/ledgerst";
+ $data['title'] = "Ledger Statement for '" . $this->Ledger_model->get_name($data['ledger_id']) . "'";
+ $data['print_preview'] = TRUE;
+ $this->load->view('report/report_template', $data);
+ return;
+ }
return;
}
}
diff --git a/system/application/views/report/ledgerst.php b/system/application/views/report/ledgerst.php
index 37b77c7..6c0007d 100644
--- a/system/application/views/report/ledgerst.php
+++ b/system/application/views/report/ledgerst.php
@@ -1,43 +1,49 @@
<?php
$this->load->model('Ledger_model');
- echo form_open('report/ledgerst/' . $ledger_id);
- echo "<p>";
- echo form_input_ledger('ledger_id', $ledger_id);
- echo " ";
- echo form_submit('submit', 'Show');
- echo "</p>";
- echo form_close();
+ if ( ! $print_preview)
+ {
+ echo form_open('report/ledgerst/' . $ledger_id);
+ echo "<p>";
+ echo form_input_ledger('ledger_id', $ledger_id);
+ echo " ";
+ echo form_submit('submit', 'Show');
+ echo "</p>";
+ echo form_close();
+ }
/* Pagination configuration */
- $pagination_counter = $this->config->item('row_count');
- $page_count = (int)$this->uri->segment(4);
- $page_count = $this->input->xss_clean($page_count);
- if ( ! $page_count)
- $page_count = "0";
- $config['base_url'] = site_url('report/ledgerst/' . $ledger_id);
- $config['num_links'] = 10;
- $config['per_page'] = $pagination_counter;
- $config['uri_segment'] = 4;
- $config['total_rows'] = $this->db->query('SELECT * FROM vouchers join voucher_items on vouchers.id = voucher_items.voucher_id WHERE voucher_items.ledger_id = ?', array($ledger_id))->num_rows();
- $config['full_tag_open'] = '<ul id="pagination-flickr">';
- $config['full_close_open'] = '</ul>';
- $config['num_tag_open'] = '<li>';
- $config['num_tag_close'] = '</li>';
- $config['cur_tag_open'] = '<li class="active">';
- $config['cur_tag_close'] = '</li>';
- $config['next_link'] = 'Next »';
- $config['next_tag_open'] = '<li class="next">';
- $config['next_tag_close'] = '</li>';
- $config['prev_link'] = '« Previous';
- $config['prev_tag_open'] = '<li class="previous">';
- $config['prev_tag_close'] = '</li>';
- $config['first_link'] = 'First';
- $config['first_tag_open'] = '<li class="first">';
- $config['first_tag_close'] = '</li>';
- $config['last_link'] = 'Last';
- $config['last_tag_open'] = '<li class="last">';
- $config['last_tag_close'] = '</li>';
- $this->pagination->initialize($config);
+ if ( ! $print_preview)
+ {
+ $pagination_counter = $this->config->item('row_count');
+ $page_count = (int)$this->uri->segment(4);
+ $page_count = $this->input->xss_clean($page_count);
+ if ( ! $page_count)
+ $page_count = "0";
+ $config['base_url'] = site_url('report/ledgerst/' . $ledger_id);
+ $config['num_links'] = 10;
+ $config['per_page'] = $pagination_counter;
+ $config['uri_segment'] = 4;
+ $config['total_rows'] = $this->db->query('SELECT * FROM vouchers join voucher_items on vouchers.id = voucher_items.voucher_id WHERE voucher_items.ledger_id = ?', array($ledger_id))->num_rows();
+ $config['full_tag_open'] = '<ul id="pagination-flickr">';
+ $config['full_close_open'] = '</ul>';
+ $config['num_tag_open'] = '<li>';
+ $config['num_tag_close'] = '</li>';
+ $config['cur_tag_open'] = '<li class="active">';
+ $config['cur_tag_close'] = '</li>';
+ $config['next_link'] = 'Next »';
+ $config['next_tag_open'] = '<li class="next">';
+ $config['next_tag_close'] = '</li>';
+ $config['prev_link'] = '« Previous';
+ $config['prev_tag_open'] = '<li class="previous">';
+ $config['prev_tag_close'] = '</li>';
+ $config['first_link'] = 'First';
+ $config['first_tag_open'] = '<li class="first">';
+ $config['first_tag_close'] = '</li>';
+ $config['last_link'] = 'Last';
+ $config['last_tag_open'] = '<li class="last">';
+ $config['last_tag_close'] = '</li>';
+ $this->pagination->initialize($config);
+ }
if ($ledger_id != 0)
{
@@ -54,8 +60,12 @@
echo "</tr>";
echo "</table>";
echo "<br />";
-
- $ledgerst_q = $this->db->query("SELECT vouchers.id as vid, vouchers.number as vnumber, vouchers.date as vdate, vouchers.draft as vdraft, vouchers.type as vtype, voucher_items.amount as lamount, voucher_items.dc as ldc FROM vouchers join voucher_items on vouchers.id = voucher_items.voucher_id WHERE voucher_items.ledger_id = ? ORDER BY vouchers.date ASC, vouchers.number ASC LIMIT ${page_count}, ${pagination_counter}", array($ledger_id));
+ if ( ! $print_preview) {
+ $ledgerst_q = $this->db->query("SELECT vouchers.id as vid, vouchers.number as vnumber, vouchers.date as vdate, vouchers.draft as vdraft, vouchers.type as vtype, voucher_items.amount as lamount, voucher_items.dc as ldc FROM vouchers join voucher_items on vouchers.id = voucher_items.voucher_id WHERE voucher_items.ledger_id = ? ORDER BY vouchers.date ASC, vouchers.number ASC LIMIT ${page_count}, ${pagination_counter}", array($ledger_id));
+ } else {
+ $page_count = 0;
+ $ledgerst_q = $this->db->query("SELECT vouchers.id as vid, vouchers.number as vnumber, vouchers.date as vdate, vouchers.draft as vdraft, vouchers.type as vtype, voucher_items.amount as lamount, voucher_items.dc as ldc FROM vouchers join voucher_items on vouchers.id = voucher_items.voucher_id WHERE voucher_items.ledger_id = ? ORDER BY vouchers.date ASC, vouchers.number ASC", array($ledger_id));
+ }
echo "<table border=0 cellpadding=5 class=\"simple-table ledgerst-table\">";
@@ -186,5 +196,6 @@
echo "</table>";
}
?>
-
+<?php if ( ! $print_preview) { ?>
<div id="pagination-container"><?php echo $this->pagination->create_links(); ?></div>
+<?php } ?>
diff --git a/system/application/views/template.php b/system/application/views/template.php
index 64e1a8e..dfec3e2 100644
--- a/system/application/views/template.php
+++ b/system/application/views/template.php
@@ -124,7 +124,7 @@ $(document).ready(function() {
echo "<ul id=\"main-links-nav\">";
foreach ($nav_links as $link => $title) {
if ($title == "Print Preview")
- echo "<li>" . anchor_popup($link, $title, array('title' => $title, 'class' => 'nav-links-item', 'style' => 'background-image:url(\'' . asset_url() . 'images/buttons/navlink.png\');')) . "</li>";
+ echo "<li>" . anchor_popup($link, $title, array('title' => $title, 'class' => 'nav-links-item', 'style' => 'background-image:url(\'' . asset_url() . 'images/buttons/navlink.png\');', 'width' => '1024')) . "</li>";
else
echo "<li>" . anchor($link, $title, array('title' => $title, 'class' => 'nav-links-item', 'style' => 'background-image:url(\'' . asset_url() . 'images/buttons/navlink.png\');')) . "</li>";
}
commit 3d2fb05034b343c42c0720964cc781e359e0f3a9
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Thu Dec 16 21:08:06 2010 +0530
Variable table width for Balance Sheet and P & L
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
diff --git a/system/application/controllers/report.php b/system/application/controllers/report.php
index bc63bb8..04ce8c5 100644
--- a/system/application/controllers/report.php
+++ b/system/application/controllers/report.php
@@ -21,7 +21,9 @@ class Report extends Controller {
{
$this->template->set('page_title', 'Balance Sheet');
$this->template->set('nav_links', array('report/download/balancesheet' => 'Download CSV', 'report/printpreview/balancesheet' => 'Print Preview'));
- $this->template->load('template', 'report/balancesheet');
+ $data['left_width'] = "450";
+ $data['right_width'] = "450";
+ $this->template->load('template', 'report/balancesheet', $data);
return;
}
@@ -29,7 +31,9 @@ class Report extends Controller {
{
$this->template->set('page_title', 'Profit And Loss Statement');
$this->template->set('nav_links', array('report/download/profitandloss' => 'Download CSV', 'report/printpreview/profitandloss' => 'Print Preview'));
- $this->template->load('template', 'report/profitandloss');
+ $data['left_width'] = "450";
+ $data['right_width'] = "450";
+ $this->template->load('template', 'report/profitandloss', $data);
return;
}
@@ -583,6 +587,8 @@ class Report extends Controller {
{
$data['report'] = "report/balancesheet";
$data['title'] = "Balance Sheet";
+ $data['left_width'] = "";
+ $data['right_width'] = "";
$this->load->view('report/report_template', $data);
return;
}
@@ -591,6 +597,8 @@ class Report extends Controller {
{
$data['report'] = "report/profitandloss";
$data['title'] = "Profit and Loss Statement";
+ $data['left_width'] = "";
+ $data['right_width'] = "";
$this->load->view('report/report_template', $data);
return;
}
diff --git a/system/application/views/report/balancesheet.php b/system/application/views/report/balancesheet.php
index daad730..d9b40ad 100644
--- a/system/application/views/report/balancesheet.php
+++ b/system/application/views/report/balancesheet.php
@@ -5,9 +5,9 @@
echo "<tr valign=\"top\">";
$liability = new Accountlist();
- echo "<td>";
+ echo "<td width=\"" . $left_width . "\">";
$liability->init(2);
- echo "<table border=0 cellpadding=5 class=\"simple-table balance-sheet-table\" width=\"450\">";
+ echo "<table border=0 cellpadding=5 class=\"simple-table balance-sheet-table\" width=\"100%\">";
echo "<thead><tr><th>Liabilities</th><th align=\"right\">Amount</th></tr></thead>";
$liability->account_st_short(0);
echo "</table>";
@@ -15,9 +15,9 @@
$liability_total = -$liability->total;
$asset = new Accountlist();
- echo "<td>";
+ echo "<td width=\"" . $right_width . "\">";
$asset->init(1);
- echo "<table border=0 cellpadding=5 class=\"simple-table balance-sheet-table\" width=\"450\">";
+ echo "<table border=0 cellpadding=5 class=\"simple-table balance-sheet-table\" width=\"100%\">";
echo "<thead><tr><th>Assets</th><th align=\"right\">Amount</th></tr></thead>";
$asset->account_st_short(0);
echo "</table>";
@@ -44,7 +44,7 @@
echo "<tr class=\"total-area\">";
echo "<td>";
- echo "<table border=0 cellpadding=5 class=\"balance-sheet-total-table\" width=\"450\">";
+ echo "<table border=0 cellpadding=5 class=\"balance-sheet-total-table\" width=\"100%\">";
echo "<tr valign=\"top\">";
echo "<td class=\"bold\">Liability Total</td>";
echo "<td align=\"right\" class=\"bold\">" . convert_cur($liability_total) . "</td>";
@@ -98,7 +98,7 @@
$total = $asset_total;
echo "<td>";
- echo "<table border=0 cellpadding=5 class=\"balance-sheet-total-table\" width=\"450\">";
+ echo "<table border=0 cellpadding=5 class=\"balance-sheet-total-table\" width=\"100%\">";
echo "<tr valign=\"top\">";
echo "<td class=\"bold\">Asset Total</td>";
echo "<td align=\"right\" class=\"bold\">" . convert_cur($asset_total) . "</td>";
diff --git a/system/application/views/report/profitandloss.php b/system/application/views/report/profitandloss.php
index f60d9e5..e21baf9 100644
--- a/system/application/views/report/profitandloss.php
+++ b/system/application/views/report/profitandloss.php
@@ -10,8 +10,8 @@
/* Gross P/L : Expenses */
$gross_expense_total = 0;
$gross_expense_list_q = $this->db->query("SELECT * FROM groups WHERE parent_id = 4 AND affects_gross = 1");
- echo "<td>";
- echo "<table border=0 cellpadding=5 class=\"simple-table profit-loss-table\" width=\"450\">";
+ echo "<td width=\"" . $left_width . "\">";
+ echo "<table border=0 cellpadding=5 class=\"simple-table profit-loss-table\" width=\"100%\">";
echo "<thead><tr><th>Expenses (Gross)</th><th align=\"right\">Amount</th></tr></thead>";
foreach ($gross_expense_list_q->result() as $row)
{
@@ -26,8 +26,8 @@
/* Gross P/L : Incomes */
$gross_income_total = 0;
$gross_income_list_q = $this->db->query("SELECT * FROM groups WHERE parent_id = 3 AND affects_gross = 1");
- echo "<td>";
- echo "<table border=0 cellpadding=5 class=\"simple-table profit-loss-table\" width=\"450\">";
+ echo "<td width=\"" . $right_width . "\">";
+ echo "<table border=0 cellpadding=5 class=\"simple-table profit-loss-table\" width=\"100%\">";
echo "<thead><tr><th>Incomes (Gross)</th><th align=\"right\">Amount</th></tr></thead>";
foreach ($gross_income_list_q->result() as $row)
{
@@ -49,7 +49,7 @@
$grosstotal = $gross_expense_total;
echo "<tr class=\"total-area\">";
echo "<td>";
- echo "<table border=0 cellpadding=5 class=\"simple-table profit-loss-total-table\" width=\"450\">";
+ echo "<table border=0 cellpadding=5 class=\"simple-table profit-loss-total-table\" width=\"100%\">";
echo "<tr valign=\"top\">";
echo "<td class=\"bold\">Total Gross Expenses</td>";
echo "<td align=\"right\" class=\"bold\">" . convert_cur($gross_expense_total) . "</td>";
@@ -78,7 +78,7 @@
/* Showing Gross P/L : Incomes */
$grosstotal = $gross_income_total;
echo "<td>";
- echo "<table border=0 cellpadding=5 class=\"simple-table profit-loss-total-table\" width=\"450\">";
+ echo "<table border=0 cellpadding=5 class=\"simple-table profit-loss-total-table\" width=\"100%\">";
echo "<tr valign=\"top\">";
echo "<td class=\"bold\">Total Gross Incomes</td>";
echo "<td align=\"right\" class=\"bold\">" . convert_cur($gross_income_total) . "</td>";
@@ -114,7 +114,7 @@
$net_expense_total = 0;
$net_expense_list_q = $this->db->query("SELECT * FROM groups WHERE parent_id = 4 AND affects_gross != 1");
echo "<td>";
- echo "<table border=0 cellpadding=5 class=\"simple-table profit-loss-table\" width=\"450\">";
+ echo "<table border=0 cellpadding=5 class=\"simple-table profit-loss-table\" width=\"100%\">";
echo "<thead><tr><th>Expenses (Net)</th><th align=\"right\">Amount</th></tr></thead>";
foreach ($net_expense_list_q->result() as $row)
{
@@ -130,7 +130,7 @@
$net_income_total = 0;
$net_income_list_q = $this->db->query("SELECT * FROM groups WHERE parent_id = 3 AND affects_gross != 1");
echo "<td>";
- echo "<table border=0 cellpadding=5 class=\"simple-table profit-loss-table\" width=\"450\">";
+ echo "<table border=0 cellpadding=5 class=\"simple-table profit-loss-table\" width=\"100%\">";
echo "<thead><tr><th>Incomes (Net)</th><th align=\"right\">Amount</th></tr></thead>";
foreach ($net_income_list_q->result() as $row)
{
@@ -152,7 +152,7 @@
$nettotal = $net_expense_total;
echo "<tr class=\"total-area\">";
echo "<td>";
- echo "<table border=0 cellpadding=5 class=\"simple-table profit-loss-total-table\" width=\"450\">";
+ echo "<table border=0 cellpadding=5 class=\"simple-table profit-loss-total-table\" width=\"100%\">";
echo "<tr valign=\"top\">";
echo "<td class=\"bold\">Total Expenses</td>";
echo "<td align=\"right\" class=\"bold\">" . convert_cur($nettotal) . "</td>";
@@ -194,7 +194,7 @@
/* Showing Net P/L : Incomes */
$nettotal = $net_income_total;
echo "<td>";
- echo "<table border=0 cellpadding=5 class=\"simple-table profit-loss-total-table\" width=\"450\">";
+ echo "<table border=0 cellpadding=5 class=\"simple-table profit-loss-total-table\" width=\"100%\">";
echo "<tr valign=\"top\">";
echo "<td class=\"bold\">Total Incomes</td>";
echo "<td align=\"right\" class=\"bold\">" . convert_cur($nettotal) . "</td>";
commit 166965591f463a8851c043a2cf184892fd7573e8
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Thu Dec 16 12:17:10 2010 +0530
Added basic Print Statment for Balance Sheet and P and L
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
diff --git a/system/application/assets/css/printreport.css b/system/application/assets/css/printreport.css
index 7abbc57..f874ce4 100644
--- a/system/application/assets/css/printreport.css
+++ b/system/application/assets/css/printreport.css
@@ -28,31 +28,87 @@ body {
font-size:15px;
}
-table.simple-table {
+/************************************ COMMON **********************************/
+table.simple-table a {
+ text-decoration:none;
+ color:#000000;
+}
+
+/********************************* TRIAL BALANCE ******************************/
+table.trial-balance-table {
border:1px solid #000000;
border-collapse: collapse;
}
-table.simple-table tr th {
+table.trial-balance-table tr th {
text-align:left;
border:1px solid #000000;
padding:5px 30px 5px 5px;
background-color:#EEEEEE;
}
-table.simple-table tr td {
+table.trial-balance-table tr td {
text-align:left;
border:1px solid #000000;
padding:5px 30px 5px 5px;
}
-table.simple-table a {
- text-decoration:none;
- color:#000000;
+table.trial-balance-table tr.tr-total {
+ border:1px solid #000000;
+}
+
+/********************************* BALANCE SHEET ******************************/
+table.balance-sheet-table {
+ border:1px solid #000000;
+ border-collapse: collapse;
+}
+
+table.balance-sheet-table tr th {
+ text-align:left;
+ border:1px solid #000000;
+ padding:5px 30px 5px 5px;
+ background-color:#EEEEEE;
+}
+
+table.balance-sheet-table tr td {
+ border:1px solid #000000;
+ padding:5px 30px 5px 5px;
}
-table.simple-table tr.tr-total {
+table.balance-sheet-total-table {
border:1px solid #000000;
+ background-color:#EEEEEE;
+}
+
+table.balance-sheet-table td.td-group {
+ font-weight:bold;
+}
+
+/**************************** PROFIT AND LOSS ST ******************************/
+table.profit-loss-table {
+ border:1px solid #000000;
+ border-collapse: collapse;
+}
+
+table.profit-loss-table tr th {
+ text-align:left;
+ border:1px solid #000000;
+ padding:5px 30px 5px 5px;
+ background-color:#EEEEEE;
+}
+
+table.profit-loss-table tr td {
+ border:1px solid #000000;
+ padding:5px 30px 5px 5px;
+}
+
+table.profit-loss-total-table {
+ border:1px solid #000000;
+ background-color:#EEEEEE;
+}
+
+table.profit-loss-table td.td-group {
+ font-weight:bold;
}
@media print {
diff --git a/system/application/controllers/report.php b/system/application/controllers/report.php
index 9f64932..bc63bb8 100644
--- a/system/application/controllers/report.php
+++ b/system/application/controllers/report.php
@@ -20,7 +20,7 @@ class Report extends Controller {
function balancesheet($period = NULL)
{
$this->template->set('page_title', 'Balance Sheet');
- $this->template->set('nav_links', array('report/download/balancesheet' => 'Download CSV'));
+ $this->template->set('nav_links', array('report/download/balancesheet' => 'Download CSV', 'report/printpreview/balancesheet' => 'Print Preview'));
$this->template->load('template', 'report/balancesheet');
return;
}
@@ -28,7 +28,7 @@ class Report extends Controller {
function profitandloss($period = NULL)
{
$this->template->set('page_title', 'Profit And Loss Statement');
- $this->template->set('nav_links', array('report/download/profitandloss' => 'Download CSV'));
+ $this->template->set('nav_links', array('report/download/profitandloss' => 'Download CSV', 'report/printpreview/profitandloss' => 'Print Preview'));
$this->template->load('template', 'report/profitandloss');
return;
}
@@ -578,6 +578,22 @@ class Report extends Controller {
$this->load->view('report/report_template', $data);
return;
}
+
+ if ($statement == "balancesheet")
+ {
+ $data['report'] = "report/balancesheet";
+ $data['title'] = "Balance Sheet";
+ $this->load->view('report/report_template', $data);
+ return;
+ }
+
+ if ($statement == "profitandloss")
+ {
+ $data['report'] = "report/profitandloss";
+ $data['title'] = "Profit and Loss Statement";
+ $this->load->view('report/report_template', $data);
+ return;
+ }
return;
}
}
commit 3d356daea9d75d877fabff210bce4d7488ce0b47
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Thu Dec 16 11:59:08 2010 +0530
Added Print report statement for Trial balance
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
diff --git a/system/application/assets/css/printreport.css b/system/application/assets/css/printreport.css
new file mode 100644
index 0000000..7abbc57
--- /dev/null
+++ b/system/application/assets/css/printreport.css
@@ -0,0 +1,62 @@
+/*********************************** COMMON ***********************************/
+body {
+ color:#000000;
+ font:14px "Helvetica Neue","Lucida Grande","Helvetica Neue",Arial,sans-serif;
+ margin:20px;
+ padding:0;
+}
+
+/******************************** SPECIFIC ************************************/
+
+#print-account-name {
+ text-align:center;
+ font-size:17px;
+}
+
+#print-account-address {
+ text-align:center;
+ font-size:14px;
+}
+
+#print-report-title {
+ text-align:center;
+ font-size:17px;
+}
+
+#print-report-period {
+ text-align:center;
+ font-size:15px;
+}
+
+table.simple-table {
+ border:1px solid #000000;
+ border-collapse: collapse;
+}
+
+table.simple-table tr th {
+ text-align:left;
+ border:1px solid #000000;
+ padding:5px 30px 5px 5px;
+ background-color:#EEEEEE;
+}
+
+table.simple-table tr td {
+ text-align:left;
+ border:1px solid #000000;
+ padding:5px 30px 5px 5px;
+}
+
+table.simple-table a {
+ text-decoration:none;
+ color:#000000;
+}
+
+table.simple-table tr.tr-total {
+ border:1px solid #000000;
+}
+
+@media print {
+ .hide-print {
+ display: none;
+ }
+}
\ No newline at end of file
diff --git a/system/application/controllers/report.php b/system/application/controllers/report.php
index 61e0cad..9f64932 100644
--- a/system/application/controllers/report.php
+++ b/system/application/controllers/report.php
@@ -36,7 +36,7 @@ class Report extends Controller {
function trialbalance($period = NULL)
{
$this->template->set('page_title', 'Trial Balance');
- $this->template->set('nav_links', array('report/download/trialbalance' => 'Download CSV'));
+ $this->template->set('nav_links', array('report/download/trialbalance' => 'Download CSV', 'report/printpreview/trialbalance' => 'Print Preview'));
$this->load->library('accountlist');
$this->template->load('template', 'report/trialbalance');
@@ -566,6 +566,20 @@ class Report extends Controller {
}
return;
}
+
+ function printpreview($statement, $id = NULL)
+ {
+ /********************** TRIAL BALANCE *************************/
+ if ($statement == "trialbalance")
+ {
+ $this->load->library('accountlist');
+ $data['report'] = "report/trialbalance";
+ $data['title'] = "Trial Balance";
+ $this->load->view('report/report_template', $data);
+ return;
+ }
+ return;
+ }
}
/* End of file report.php */
diff --git a/system/application/views/report/report_template.php b/system/application/views/report/report_template.php
new file mode 100644
index 0000000..01d2333
--- /dev/null
+++ b/system/application/views/report/report_template.php
@@ -0,0 +1,28 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+<title>Webzash<?php if (isset($page_title)) echo ' | ' . $page_title; ?></title>
+<?php echo link_tag(asset_url() . 'images/favicon.ico', 'shortcut icon', 'image/ico'); ?>
+<link type="text/css" rel="stylesheet" href="<?php echo asset_url(); ?>css/printreport.css">
+</head>
+<body>
+ <div id="print-account-name"><span class="value"><?php echo $this->config->item('account_name'); ?></span></div>
+ <div id="print-account-address"><span class="value"><?php echo $this->config->item('account_address'); ?></span></div>
+ <br />
+ <div id="print-report-title"><span class="value"><?php echo $title; ?></span></div>
+ <div id="print-report-period">
+ <span class="value">
+ Financial year<br />
+ <?php echo date_mysql_to_php_display($this->config->item('account_fy_start')); ?> - <?php echo date_mysql_to_php_display($this->config->item('account_fy_end')); ?>
+ </span>
+ </div>
+ <br />
+ <div id="main-content">
+ <?php $this->load->view($report); ?>
+ </div>
+ <br />
+ <form>
+ <input class="hide-print" type="button" onClick="window.print()" value="Print Statement">
+ </form>
+</body>
+</html>
diff --git a/system/application/views/template.php b/system/application/views/template.php
index 2eb72b3..64e1a8e 100644
--- a/system/application/views/template.php
+++ b/system/application/views/template.php
@@ -123,7 +123,10 @@ $(document).ready(function() {
<?php if (isset($nav_links)) {
echo "<ul id=\"main-links-nav\">";
foreach ($nav_links as $link => $title) {
- echo "<li>" . anchor($link, $title, array('title' => $title, 'class' => 'nav-links-item', 'style' => 'background-image:url(\'' . asset_url() . 'images/buttons/navlink.png\');')) . "</li>";
+ if ($title == "Print Preview")
+ echo "<li>" . anchor_popup($link, $title, array('title' => $title, 'class' => 'nav-links-item', 'style' => 'background-image:url(\'' . asset_url() . 'images/buttons/navlink.png\');')) . "</li>";
+ else
+ echo "<li>" . anchor($link, $title, array('title' => $title, 'class' => 'nav-links-item', 'style' => 'background-image:url(\'' . asset_url() . 'images/buttons/navlink.png\');')) . "</li>";
}
echo "</ul>";
} ?>
commit 45648e5ef736cced534ea5ba6fe9de7c43fac764
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Thu Dec 16 11:19:49 2010 +0530
Use helpers to display amount
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
diff --git a/system/application/helpers/custom_helper.php b/system/application/helpers/custom_helper.php
index bfbf915..d8de602 100644
--- a/system/application/helpers/custom_helper.php
+++ b/system/application/helpers/custom_helper.php
@@ -39,9 +39,32 @@ if ( ! function_exists('convert_amount_dc'))
if ($amount == "D")
return "0";
else if ($amount < 0)
- return "Cr " . -$amount;
+ return "Cr " . convert_cur(-$amount);
else
- return "Dr " . $amount;
+ return "Dr " . convert_cur($amount);
+ }
+}
+
+/**
+ * Converts Opening balance amount to Dr or Cr Value
+ *
+ * Covnerts the Opening balance amount to 0 or Dr or Cr value for display
+ *
+ * @access public
+ * @param amount
+ * @param debit or credit
+ * @return string
+ */
+if ( ! function_exists('convert_opening'))
+{
+ function convert_opening($amount, $dc)
+ {
+ if ($amount == 0)
+ return "0";
+ else if ($dc == 'D')
+ return "Dr " . convert_cur($amount);
+ else
+ return "Cr " . convert_cur($amount);
}
}
diff --git a/system/application/libraries/Accountlist.php b/system/application/libraries/Accountlist.php
index d9a52b3..8b9e578 100644
--- a/system/application/libraries/Accountlist.php
+++ b/system/application/libraries/Accountlist.php
@@ -81,17 +81,7 @@ class Accountlist
echo $this->print_space($this->counter);
echo " " . $this->name;
echo "</td>";
-
- echo "<td align=\"right\">";
- if ($this->total == 0)
- echo "0";
- else if ($this->total < 0)
- echo "Cr " . convert_cur(-$this->total);
- else
- echo "Dr " . convert_cur($this->total);
- echo $this->print_space($this->counter);
- echo "</td>";
-
+ echo "<td align=\"right\">" . convert_amount_dc($this->total) . $this->print_space($this->counter) . "</td>";
echo "</tr>";
}
foreach ($this->children_groups as $id => $data)
@@ -110,17 +100,7 @@ class Accountlist
echo $this->print_space($this->counter);
echo " " . anchor('report/ledgerst/' . $data['id'], $data['name'], array('title' => $data['name'] . ' Ledger Statement', 'style' => 'color:#000000'));
echo "</td>";
-
- echo "<td align=\"right\">";
- if ($data['total'] == 0)
- echo "0";
- else if ($data['total'] < 0)
- echo "Cr " . convert_cur(-$data['total']);
- else
- echo "Dr " . convert_cur($data['total']);
- echo $this->print_space($this->counter);
- echo "</td>";
-
+ echo "<td align=\"right\">" . convert_amount_dc($data['total']) . $this->print_space($this->counter) . "</td>";
echo "</tr>";
}
$this->counter--;
@@ -171,29 +151,8 @@ class Accountlist
echo " " . anchor('report/ledgerst/' . $data['id'], $data['name'], array('title' => $data['name'] . ' Ledger Statement', 'style' => 'color:#000000'));
echo "</td>";
echo "<td>Ledger A/C</td>";
-
- echo "<td>";
- if ($data['opbalance'] == 0)
- {
- echo "0";
- } else {
- echo ($data['optype'] == "D") ? "Dr " : "Cr ";
- echo convert_cur($data['opbalance']);
- }
- echo "</td>";
-
- echo "<td>";
- if ($data['total'] == 0)
- {
- echo "0";
- } else if ($data['total'] > 0)
- {
- echo "Dr " . convert_cur($data['total']);
- } else {
- echo "Cr " . convert_cur(-$data['total']);
- }
- echo "</td>";
-
+ echo "<td>" . convert_opening($data['opbalance'], $data['optype']) . "</td>";
+ echo "<td>" . convert_amount_dc($data['total']) . "</td>";
echo "<td class=\"td-actions\">" . anchor('ledger/edit/' . $data['id'], 'Edit', array('title' => "Edit Ledger", 'class' => 'red-link'));
echo " " . anchor('ledger/delete/' . $data['id'], img(array('src' => asset_url() . "images/icons/delete.png", 'border' => '0', 'alt' => 'Delete Ledger')), array('class' => "confirmClick", 'title' => "Delete Ledger")) . "</td>";
echo "</tr>";
diff --git a/system/application/views/report/ledgerst.php b/system/application/views/report/ledgerst.php
index 636fa45..37b77c7 100644
--- a/system/application/views/report/ledgerst.php
+++ b/system/application/views/report/ledgerst.php
@@ -47,16 +47,10 @@
/* Ledger Summary */
echo "<table class=\"ledger-summary\">";
echo "<tr>";
- if ($optype == "D")
- echo "<td><b>Opening Balance</b></td><td>Dr " . $opbalance . "</td>";
- else
- echo "<td><b>Opening Balance</b></td><td>Cr " . $opbalance . "</td>";
+ echo "<td><b>Opening Balance</b></td><td>" . convert_opening($opbalance, $optype) . "</td>";
echo "</tr>";
echo "<tr>";
- if ($clbalance < 0)
- echo "<td><b>Closing Balance</b></td><td>Cr " . convert_cur(-$clbalance) . "</td>";
- else
- echo "<td><b>Closing Balance</b></td><td>Dr " . convert_cur($clbalance) . "</td>";
+ echo "<td><b>Closing Balance</b></td><td>" . convert_amount_dc($clbalance) . "</td>";
echo "</tr>";
echo "</table>";
echo "<br />";
@@ -75,10 +69,10 @@
/* Opening balance */
if ($optype == "D")
{
- echo "<tr class=\"tr-balance\"><td colspan=7>Opening Balance</td><td>" . convert_dc($optype) . " " . $opbalance . "</td></tr>";
+ echo "<tr class=\"tr-balance\"><td colspan=7>Opening Balance</td><td>" . convert_opening($opbalance, $optype) . "</td></tr>";
$cur_balance += $opbalance;
} else {
- echo "<tr class=\"tr-balance\"><td colspan=7>Opening Balance</td><td>" . convert_dc($optype) . " " . $opbalance . "</td></tr>";
+ echo "<tr class=\"tr-balance\"><td colspan=7>Opening Balance</td><td>" . convert_opening($opbalance, $optype) . "</td></tr>";
$cur_balance -= $opbalance;
}
} else {
@@ -104,12 +98,7 @@
}
/* Show new current total */
- if ($cur_balance < 0)
- {
- echo "<tr class=\"tr-balance\"><td colspan=7>Opening</td><td>Cr " . convert_cur(-$cur_balance) . "</td></tr>";
- } else {
- echo "<tr class=\"tr-balance\"><td colspan=7>Opening</td><td>Dr " . convert_cur($cur_balance) . "</td></tr>";
- }
+ echo "<tr class=\"tr-balance\"><td colspan=7>Opening</td><td>" . convert_amount_dc($cur_balance) . "</td></tr>";
}
foreach ($ledgerst_q->result() as $row)
@@ -184,7 +173,7 @@
}
echo "<td>";
if ($row->vdraft == 0)
- echo ($cur_balance < 0) ? "Cr " . convert_cur(-$cur_balance) : "Dr " . convert_cur($cur_balance);
+ echo convert_amount_dc($cur_balance);
else
echo "-";
echo "</td>";
@@ -193,13 +182,7 @@
}
/* Current Page Closing Balance */
- if ($cur_balance < 0)
- {
- echo "<tr class=\"tr-balance\"><td colspan=7>Closing</td><td>Cr " . convert_cur(-$cur_balance) . "</td></tr>";
- } else {
- echo "<tr class=\"tr-balance\"><td colspan=7>Closing</td><td>Dr " . convert_cur($cur_balance) . "</td></tr>";
- }
-
+ echo "<tr class=\"tr-balance\"><td colspan=7>Closing</td><td>" . convert_amount_dc($cur_balance) . "</td></tr>";
echo "</table>";
}
?>
diff --git a/system/application/views/report/trialbalance.php b/system/application/views/report/trialbalance.php
index 540e9bf..5fe7878 100644
--- a/system/application/views/report/trialbalance.php
+++ b/system/application/views/report/trialbalance.php
@@ -18,20 +18,12 @@
echo "<td>";
list ($opbal_amount, $opbal_type) = $this->Ledger_model->get_op_balance($ledger_id);
- if ($opbal_amount == 0)
- echo "0";
- else
- echo convert_dc($opbal_type) . " " . $opbal_amount;
+ echo convert_opening($opbal_amount, $opbal_type);
echo "</td>";
echo "<td>";
$clbal_amount = $this->Ledger_model->get_ledger_balance($ledger_id);
- if ($clbal_amount == 0)
- echo "0";
- else if ($clbal_amount < 0)
- echo "Cr " . convert_cur(-$clbal_amount);
- else
- echo "Dr " . convert_cur($clbal_amount);
+ echo convert_amount_dc($clbal_amount);
echo "</td>";
echo "<td>";
diff --git a/system/application/views/welcome_message.php b/system/application/views/welcome_message.php
index b9a2f99..5f9e14e 100644
--- a/system/application/views/welcome_message.php
+++ b/system/application/views/welcome_message.php
@@ -109,14 +109,7 @@ jQuery(document).ready(function () {
{
echo "<tr>";
echo "<td>" . anchor('report/ledgerst/' . $row['id'], $row['name'], array('title' => $row['name'] . ' Statement')) . "</td>";
- echo "<td>";
- if ($row['balance'] == 0)
- echo "0";
- else if ($row['balance'] > 0)
- echo "Dr " . $row['balance'];
- else
- echo "Cr " . -$row['balance'];
- echo "</td>";
+ echo "<td>" . convert_amount_dc($row['balance']) . "</td>";
echo "</tr>";
}
echo "</tbody>";
commit c000c6faf257d930d03c5e971c55b853c3b290ce
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Wed Dec 15 11:44:14 2010 +0530
Updated Voucher Settings
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
diff --git a/system/application/views/setting/index.php b/system/application/views/setting/index.php
index 2088162..e925798 100644
--- a/system/application/views/setting/index.php
+++ b/system/application/views/setting/index.php
@@ -52,7 +52,7 @@
</div>
<div class="settings-container">
<div class="settings-title">
- <?php echo anchor('setting/voucher', 'Voucher', array('title' => 'Voucher Settings')); ?>
+ <?php echo anchor('setting/voucher', 'Voucher Settings', array('title' => 'Voucher Settings')); ?>
</div>
<div class="settings-desc">
Voucher settings
commit 5f9cca98834b7dc9b1154b29dae5817858dcfd3e
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Wed Dec 15 11:40:18 2010 +0530
Updated Logger
- Ability to clear Log
- Display full RSS feed of the log
- Display full log information
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
diff --git a/system/application/assets/css/custom.css b/system/application/assets/css/custom.css
index bb634e0..e4b737b 100644
--- a/system/application/assets/css/custom.css
+++ b/system/application/assets/css/custom.css
@@ -33,6 +33,10 @@ a.anchor-link-b {
text-decoration:none;
}
+.float-right {
+ float:right;
+}
+
/* Fieldset */
.fieldset-auto-width {
display:inline;
@@ -214,10 +218,6 @@ ul#pagination-flickr {
border-radius:5px;
}
-.tag-edit {
- float:right;
-}
-
/***************************** RECENT ACTIVITY ********************************/
#recent-activity-list {
margin-left:30px;
diff --git a/system/application/assets/images/icons/rss.png b/system/application/assets/images/icons/rss.png
old mode 100755
new mode 100644
diff --git a/system/application/controllers/log.php b/system/application/controllers/log.php
new file mode 100644
index 0000000..66730d0
--- /dev/null
+++ b/system/application/controllers/log.php
@@ -0,0 +1,45 @@
+<?php
+
+class Log extends Controller {
+ function index()
+ {
+ $this->load->helper('text');
+ $this->template->set('page_title', 'Logs');
+ $this->template->set('nav_links', array('log/clear' => 'Clear Log'));
+ $this->template->load('template', 'log/index');
+ return;
+ }
+
+ function clear()
+ {
+ if ($this->db->query('DELETE FROM logs'))
+ {
+ $this->messages->add('Log cleared', 'success');
+ redirect("log");
+ } else {
+ $this->messages->add('Error clearing Log', 'error');
+ redirect("log");
+ }
+ return;
+ }
+
+ function feed()
+ {
+ $this->load->helper('xml');
+ $this->load->helper('text');
+ $data['feed_name'] = $this->config->item('account_name');
+ $data['feed_url'] = base_url();
+ $data['page_description'] = 'Accounting feed for ' . $data['feed_name'];
+ $data['page_language'] = 'en-en';
+ $data['creator_email'] = $this->config->item('account_email');
+
+ $this->db->order_by("id", "desc");
+ $data['feed_data'] = $this->db->get('logs');
+
+ header("Content-Type: application/rss+xml");
+ $this->load->view('rss', $data);
+ }
+}
+
+/* End of file account.php */
+/* Location: ./system/application/controllers/account.php */
diff --git a/system/application/libraries/Logger.php b/system/application/libraries/Logger.php
index 4a980c5..8adb7da 100644
--- a/system/application/libraries/Logger.php
+++ b/system/application/libraries/Logger.php
@@ -29,7 +29,7 @@ class Logger
default: $data['level'] = 0; break;
}
$data['host_ip'] = $CI->input->ip_address();
- $data['url'] = current_url();
+ $data['url'] = uri_string();
$data['user_agent'] = $CI->input->user_agent();
$data['message_title'] = $title;
$data['message_desc'] = $desc;
diff --git a/system/application/views/log/index.php b/system/application/views/log/index.php
new file mode 100644
index 0000000..a1c4777
--- /dev/null
+++ b/system/application/views/log/index.php
@@ -0,0 +1,16 @@
+<?php
+ $this->db->order_by("id", "desc");
+ $logs_q = $this->db->get('logs');
+ echo "<table border=0 class=\"simple-table\">";
+ echo "<thead><tr><th width=\"90\">Date</th><th>Host IP</th><th>Message</th><th width=\"30\">URL</th><th>Browser</th></tr></thead>";
+ foreach ($logs_q->result() as $row)
+ {
+ echo "<tr>";
+ echo "<td>" . date_mysql_to_php_display($row->date) . "</td>";
+ echo "<td>" . $row->host_ip . "</td>";
+ echo "<td>" . $row->message_title . "</td>";
+ echo "<td>" . anchor($row->url, "Link", array('title' => 'Link to action', 'class' => 'anchor-link-a')) . "</td>";
+ echo "<td>" . character_limiter($row->user_agent, 25) . "</td>";
+ echo "</tr>";
+ }
+ echo "</table>";
diff --git a/system/application/views/rss.php b/system/application/views/rss.php
new file mode 100644
index 0000000..920d23e
--- /dev/null
+++ b/system/application/views/rss.php
@@ -0,0 +1,31 @@
+<?php echo '<?xml version="1.0" encoding="utf-8"?>' . "\n"; ?>
+<rss version="2.0"
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
+ xmlns:admin="http://webns.net/mvcb/"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:content="http://purl.org/rss/1.0/modules/content/">
+
+ <channel>
+ <title><?php echo $feed_name; ?></title>
+ <link><?php echo $feed_url; ?></link>
+ <description><?php echo $page_description; ?></description>
+ <dc:language><?php echo $page_language; ?></dc:language>
+ <dc:creator><?php echo $creator_email; ?></dc:creator>
+
+ <dc:rights>Copyright <?php echo gmdate("Y", time()); ?></dc:rights>
+ <admin:generatorAgent rdf:resource="http://www.codeigniter.com/" />
+
+ <?php foreach($feed_data->result() as $row): ?>
+ <item>
+ <title><?php echo xml_convert($row->message_title); ?></title>
+ <link><?php echo site_url($row->url); ?></link>
+ <guid><?php echo site_url($row->url); ?></guid>
+ <description><![CDATA[
+ <?php echo $row->message_title; ?>
+ ]]></description>
+ <pubDate><?php echo $row->date; ?></pubDate>
+ </item>
+ <?php endforeach; ?>
+ </channel>
+</rss>
diff --git a/system/application/views/sidebar/tag.php b/system/application/views/sidebar/tag.php
index 4ee56cf..a49650c 100644
--- a/system/application/views/sidebar/tag.php
+++ b/system/application/views/sidebar/tag.php
@@ -1,5 +1,5 @@
<?php
-echo "<div class=\"tag-title\">Tags<span class=\"tag-edit\">" . anchor("tag", "Edit") . "</span></div>";
+echo "<div class=\"tag-title\">Tags<span class=\"float-right\">" . anchor("tag", "Edit") . "</span></div>";
echo "<div class=\"tag-content\">";
$tags = $this->Tag_model->get_all_tags($allow_none = FALSE);
echo "<ul id=\"tag-list\">";
diff --git a/system/application/views/welcome_message.php b/system/application/views/welcome_message.php
index 7c344fd..b9a2f99 100644
--- a/system/application/views/welcome_message.php
+++ b/system/application/views/welcome_message.php
@@ -170,7 +170,7 @@ jQuery(document).ready(function () {
</div>
<div id="dashboard-log">
<div id="dashboard-recent-log" class="dashboard-log-item">
- <div class="dashboard-log-title">Recent Activity</div>
+ <div class="dashboard-log-title">Recent Activity <span class="float-right"><?php echo anchor('log/feed', img(array('src'=> asset_url() . "images/icons/rss.png", 'border' => '0', 'alt' => 'Log Feed', 'width' => '16px',))); ?></span></div>
<div class="dashboard-log-content">
<?php
if ($logs)
@@ -191,7 +191,7 @@ jQuery(document).ready(function () {
{
echo "<div class=\"dashboard-log-footer\">";
echo "<span>";
- echo anchor("", "more...", array('class' => 'anchor-link-a no-underline'));
+ echo anchor("log", "more...", array('class' => 'anchor-link-a'));
echo "</span>";
}
?>
commit f175fcc0ef7682c9ff4e816fb4fcd7e681f41dfb
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Wed Dec 15 11:39:15 2010 +0530
Added user column to logs
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
diff --git a/system/application/controllers/admin/carryforward.sql b/system/application/controllers/admin/carryforward.sql
index 4df5623..17ffdbe 100644
--- a/system/application/controllers/admin/carryforward.sql
+++ b/system/application/controllers/admin/carryforward.sql
@@ -85,6 +85,7 @@ CREATE TABLE IF NOT EXISTS logs (
date datetime NOT NULL,
level int(1) NOT NULL,
host_ip varchar(25) NOT NULL,
+ user varchar(25) NOT NULL,
url varchar(255) NOT NULL,
user_agent varchar(100) NOT NULL,
message_title varchar(255) NOT NULL,
diff --git a/system/application/controllers/admin/database.sql b/system/application/controllers/admin/database.sql
index b474c21..db58541 100644
--- a/system/application/controllers/admin/database.sql
+++ b/system/application/controllers/admin/database.sql
@@ -85,6 +85,7 @@ CREATE TABLE IF NOT EXISTS logs (
date datetime NOT NULL,
level int(1) NOT NULL,
host_ip varchar(25) NOT NULL,
+ user varchar(25) NOT NULL,
url varchar(255) NOT NULL,
user_agent varchar(100) NOT NULL,
message_title varchar(255) NOT NULL,
commit 6cbba60d45091cf3e4f0ce59b023c0e481eab799
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Wed Dec 15 11:15:15 2010 +0530
Added Feed icon
From http://www.feedicons.com
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
diff --git a/system/application/assets/images/icons/rss.png b/system/application/assets/images/icons/rss.png
new file mode 100755
index 0000000..d64c669
Binary files /dev/null and b/system/application/assets/images/icons/rss.png differ
commit 22b22844f43265f2bae94d20774fa85e3c914896
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Tue Dec 14 21:33:20 2010 +0530
Added Voucher email template
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
diff --git a/system/application/controllers/voucher.php b/system/application/controllers/voucher.php
index 0095e82..7e9b51c 100644
--- a/system/application/controllers/voucher.php
+++ b/system/application/controllers/voucher.php
@@ -850,40 +850,35 @@ class Voucher extends Controller {
}
else
{
-
- /* Preparing message */
- $message = "";
- $message .= "<h3>" . ucfirst($voucher_type) . " Voucher</h3>";
- $message .= "<p><b>" . $this->config->item('account_name') . "</b></p>";
- $message .= "<p>" . $this->config->item('account_address') . "</p>";
- $message .= "<p>Voucher Number : " . voucher_number_prefix($voucher_type) . $cur_voucher->number . "</p>";
- $message .= "<p>Voucher Date : " . date_mysql_to_php_display($cur_voucher->date) . "</p>";
- $message .= "<table border=1>";
- $message .= "<thead><tr><th>Ledger A/C</th><th>Dr Amount</th><th>Cr Amount</th></tr></thead>";
-
- $ledger_q;
- if ($voucher_type == "receipt" || $voucher_type == "contra")
- $ledger_q = $this->db->query("SELECT * FROM voucher_items WHERE voucher_id = ? ORDER BY dc DESC", $voucher_id);
- else
- $ledger_q = $this->db->query("SELECT * FROM voucher_items WHERE voucher_id = ? ORDER BY dc ASC", $voucher_id);
+ $voucher_data['voucher_type'] = $voucher_type;
+ $voucher_data['voucher_number'] = $cur_voucher->number;
+ $voucher_data['voucher_date'] = date_mysql_to_php_display($cur_voucher->date);
+ $voucher_data['voucher_dr_total'] = $cur_voucher->dr_total;
+ $voucher_data['voucher_cr_total'] = $cur_voucher->cr_total;
+ $voucher_data['voucher_narration'] = $cur_voucher->narration;
+ $voucher_data['voucher_draft'] = $cur_voucher->draft;
- foreach ($ledger_q->result() as $row)
+ /* Getting Ledger details */
+ $ledger_q = $this->db->query("SELECT * FROM voucher_items WHERE voucher_id = ? ORDER BY dc DESC", $voucher_id);
+
+ $counter = 0;
+ $voucher_data['ledger_data'] = array();
+ if ($ledger_q->num_rows() > 0)
{
- $message .= "<tr>";
- $message .= "<td>" . $this->Ledger_model->get_name($row->ledger_id) . "</td>";
- if ($row->dc == "D")
+ foreach ($ledger_q->result() as $row)
{
- $message .= "<td>" . $row->amount . "</td>";
- $message .= "<td>-</td>";
- } else {
- $message .= "<td>-</td>";
- $message .= "<td>" . $row->amount . "</td>";
+ $voucher_data['ledger_data'][$counter] = array(
+ 'id' => $row->ledger_id,
+ 'name' => $this->Ledger_model->get_name($row->ledger_id),
+ 'dc' => $row->dc,
+ 'amount' => $row->amount,
+ );
+ $counter++;
}
- $message .= "</tr>";
}
- $message .= "<tr><td><b>TOTAL</b></td><td><b>" . $cur_voucher->dr_total . "</b></td><td><b>" . $cur_voucher->cr_total . "</b></td></tr>";
- $message .= "</table>";
- $message .= "<p>" . "Narration : " . $cur_voucher->narration . "</p>";
+
+ /* Preparing message */
+ $message = $this->load->view('voucher/emailpreview', $voucher_data, TRUE);
/* Sending email */
$config['protocol'] = $this->config->item('account_email_protocol');
diff --git a/system/application/views/voucher/emailpreview.php b/system/application/views/voucher/emailpreview.php
new file mode 100644
index 0000000..f925edd
--- /dev/null
+++ b/system/application/views/voucher/emailpreview.php
@@ -0,0 +1,46 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+<title>Print - <?php echo ucfirst($voucher_type); ?> Voucher Number <?php echo $voucher_number; ?></title>
+</head>
+<body>
+ <p><?php echo $this->config->item('account_name'); ?></p>
+ <p><?php echo $this->config->item('account_address'); ?></p>
+ <p><strong><?php echo ucfirst($voucher_type); ?> Voucher</strong></p>
+ <p><?php echo ucfirst($voucher_type); ?> Voucher Number : <strong><?php echo voucher_number_prefix($voucher_type) . $voucher_number; ?></strong></p>
+ <p><?php echo ucfirst($voucher_type); ?> Voucher Date : <strong><?php echo $voucher_date; ?></strong></p>
+ <table border=1 cellpadding=6>
+ <thead>
+ <tr><th align="left">Ledger A/C</th><th>Dr Amount</th><th>Cr Amount</th></tr>
+ </thead>
+ <tbody>
+ <?php
+ $currency = $this->config->item('account_currency_symbol');
+ foreach ($ledger_data as $id => $row)
+ {
+ echo "<tr>";
+ if ($row['dc'] == "D")
+ {
+ echo "<td>By " . $row['name'] . "</td>";
+ } else {
+ echo "<td> To " . $row['name'] . "</td>";
+ }
+ if ($row['dc'] == "D")
+ {
+ echo "<td>" . $currency . " " . $row['amount'] . "</td>";
+ echo "<td></td>";
+ } else {
+ echo "<td></td>";
+ echo "<td>" . $currency . " " . $row['amount'] . "</td>";
+ }
+ echo "</tr>";
+ }
+ echo "<tr><td>Total</td><td>" . $currency . " " . $voucher_dr_total . "</td><td>" . $currency . " " . $voucher_cr_total . "</td></tr>";
+ ?>
+ </tbody>
+ </table>
+ <br />
+ <p>Narration : <span class="value"><?php echo $voucher_narration; ?></p>
+ <br />
+</body>
+</html>
commit 4e6a0bbb494801a4a8665878032fbc37bea95617
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Tue Dec 14 15:34:18 2010 +0530
Added Voucher prefix to Logger and error messages
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
diff --git a/system/application/controllers/voucher.php b/system/application/controllers/voucher.php
index d604293..0095e82 100644
--- a/system/application/controllers/voucher.php
+++ b/system/application/controllers/voucher.php
@@ -404,7 +404,7 @@ class Voucher extends Controller {
{
$this->db->trans_rollback();
$this->messages->add('Error addding Voucher A/C', 'error');
- $this->logger->write_message("error", "Error adding " . ucfirst($voucher_type) . " Voucher number " . $data_number . " since failed inserting voucher");
+ $this->logger->write_message("error", "Error adding " . ucfirst($voucher_type) . " Voucher number " . voucher_number_prefix($voucher_type) . $data_number . " since failed inserting voucher");
$this->template->load('template', 'voucher/add', $data);
return;
} else {
@@ -439,7 +439,7 @@ class Voucher extends Controller {
{
$this->db->trans_rollback();
$this->messages->add('Error addding Ledger A/C ' . $data_ledger_id, 'error');
- $this->logger->write_message("error", "Error adding " . ucfirst($voucher_type) . " Voucher number " . $data_number . " since failed inserting voucher ledger items " . "[id:" . $data_ledger_id . "]");
+ $this->logger->write_message("error", "Error adding " . ucfirst($voucher_type) . " Voucher number " . voucher_number_prefix($voucher_type) . $data_number . " since failed inserting voucher ledger items " . "[id:" . $data_ledger_id . "]");
$this->template->load('template', 'voucher/add', $data);
return;
}
@@ -450,15 +450,15 @@ class Voucher extends Controller {
{
$this->db->trans_rollback();
$this->messages->add('Error updating voucher total', 'error');
- $this->logger->write_message("error", "Error adding " . ucfirst($voucher_type) . " Voucher number " . $data_number . " since failed updating debit and credit total");
+ $this->logger->write_message("error", "Error adding " . ucfirst($voucher_type) . " Voucher number " . voucher_number_prefix($voucher_type) . $data_number . " since failed updating debit and credit total");
$this->template->load('template', 'voucher/add', $data);
return;
}
/* Success */
$this->db->trans_complete();
- $this->messages->add(ucfirst($voucher_type) . ' Voucher number ' . $data_number . ' added successfully', 'success');
- $this->logger->write_message("success", "Added " . ucfirst($voucher_type) . " Voucher number " . $data_number);
+ $this->messages->add(ucfirst($voucher_type) . ' Voucher number ' . voucher_number_prefix($voucher_type) . $data_number . ' added successfully', 'success');
+ $this->logger->write_message("success", "Added " . ucfirst($voucher_type) . " Voucher number " . voucher_number_prefix($voucher_type) . $data_number);
redirect('voucher/show/' . $voucher_type);
$this->template->load('template', 'voucher/add', $data);
return;
@@ -659,7 +659,7 @@ class Voucher extends Controller {
{
$this->db->trans_rollback();
$this->messages->add('Error updating Voucher A/C', 'error');
- $this->logger->write_message("error", "Error updating voucher details for " . ucfirst($voucher_type) . " Voucher number " . $data_number . " [id:" . $voucher_id . "]");
+ $this->logger->write_message("error", "Error updating voucher details for " . ucfirst($voucher_type) . " Voucher number " . voucher_number_prefix($voucher_type) . $data_number . " [id:" . $voucher_id . "]");
$this->template->load('template', 'voucher/edit', $data);
return;
}
@@ -669,7 +669,7 @@ class Voucher extends Controller {
{
$this->db->trans_rollback();
$this->messages->add('Error deleting old Ledger A/C\'s', 'error');
- $this->logger->write_message("error", "Error updating old voucher items for " . ucfirst($voucher_type) . " Voucher number " . $data_number . " [id:" . $voucher_id . "]");
+ $this->logger->write_message("error", "Error updating old voucher items for " . ucfirst($voucher_type) . " Voucher number " . voucher_number_prefix($voucher_type) . $data_number . " [id:" . $voucher_id . "]");
$this->template->load('template', 'voucher/edit', $data);
return;
}
@@ -702,7 +702,7 @@ class Voucher extends Controller {
{
$this->db->trans_rollback();
$this->messages->add('Error updating Ledger A/C ' . $data_ledger_id, 'error');
- $this->logger->write_message("error", "Error updating new voucher item [id:" . $data_ledger_id . "] for " . ucfirst($voucher_type) . " Voucher number " . $data_number . " [id:" . $voucher_id . "]");
+ $this->logger->write_message("error", "Error updating new voucher item [id:" . $data_ledger_id . "] for " . ucfirst($voucher_type) . " Voucher number " . voucher_number_prefix($voucher_type) . $data_number . " [id:" . $voucher_id . "]");
$this->template->load('template', 'voucher/edit', $data);
return;
}
@@ -713,15 +713,15 @@ class Voucher extends Controller {
{
$this->db->trans_rollback();
$this->messages->add('Error updating voucher total', 'error');
- $this->logger->write_message("error", "Error updating voucher total for " . ucfirst($voucher_type) . " Voucher number " . $data_number . " [id:" . $voucher_id . "]");
+ $this->logger->write_message("error", "Error updating voucher total for " . ucfirst($voucher_type) . " Voucher number " . voucher_number_prefix($voucher_type) . $data_number . " [id:" . $voucher_id . "]");
$this->template->load('template', 'voucher/edit', $data);
return;
}
/* Success */
$this->db->trans_complete();
- $this->messages->add(ucfirst($voucher_type) . ' Voucher number ' . $data_number . ' updated successfully', 'success');
- $this->logger->write_message("success", "Updated " . ucfirst($voucher_type) . " Voucher number " . $cur_voucher->number . " [id:" . $voucher_id . "]");
+ $this->messages->add(ucfirst($voucher_type) . ' Voucher number ' . voucher_number_prefix($voucher_type) . $data_number . ' updated successfully', 'success');
+ $this->logger->write_message("success", "Updated " . ucfirst($voucher_type) . " Voucher number " . voucher_number_prefix($voucher_type) . $data_number . " [id:" . $voucher_id . "]");
redirect('voucher/show/' . $voucher_type);
return;
}
@@ -743,7 +743,7 @@ class Voucher extends Controller {
{
$this->db->trans_rollback();
$this->messages->add('Error deleting Voucher - Ledgers entry', 'error');
- $this->logger->write_message("error", "Error deleting ledger entries for " . ucfirst($voucher_type) . " Voucher number " . $cur_voucher->number . " [id:" . $voucher_id . "]");
+ $this->logger->write_message("error", "Error deleting ledger entries for " . ucfirst($voucher_type) . " Voucher number " . voucher_number_prefix($voucher_type) . $cur_voucher->number . " [id:" . $voucher_id . "]");
redirect('voucher/' . $voucher_type . '/' . $voucher_id);
return;
}
@@ -751,13 +751,13 @@ class Voucher extends Controller {
{
$this->db->trans_rollback();
$this->messages->add('Error deleting Voucher entry', 'error');
- $this->logger->write_message("error", "Error deleting voucher entry for " . ucfirst($voucher_type) . " Voucher number " . $cur_voucher->number . " [id:" . $voucher_id . "]");
+ $this->logger->write_message("error", "Error deleting voucher entry for " . ucfirst($voucher_type) . " Voucher number " . voucher_number_prefix($voucher_type) . $cur_voucher->number . " [id:" . $voucher_id . "]");
redirect('voucher/' . $voucher_type . '/' . $voucher_id);
return;
}
$this->db->trans_complete();
$this->messages->add('Voucher deleted successfully', 'success');
- $this->logger->write_message("success", "Deleted " . ucfirst($voucher_type) . " Voucher number " . $cur_voucher->number . " [id:" . $voucher_id . "]");
+ $this->logger->write_message("success", "Deleted " . ucfirst($voucher_type) . " Voucher number " . voucher_number_prefix($voucher_type) . $cur_voucher->number . " [id:" . $voucher_id . "]");
redirect('voucher/show/' . $voucher_type);
return;
}
@@ -899,15 +899,15 @@ class Voucher extends Controller {
$this->email->from('', 'Webzash');
$this->email->to($this->input->post('email_to', TRUE));
- $this->email->subject(ucfirst($voucher_type) . ' Voucher No. ' . $cur_voucher->number);
+ $this->email->subject(ucfirst($voucher_type) . ' Voucher No. ' . voucher_number_prefix($voucher_type) . $cur_voucher->number);
$this->email->message($message);
if ($this->email->send())
{
$data['message'] = "Successfully sent email !";
- $this->logger->write_message("success", "Emailed " . ucfirst($voucher_type) . " Voucher number " . $cur_voucher->number . " [id:" . $voucher_id . "]");
+ $this->logger->write_message("success", "Emailed " . ucfirst($voucher_type) . " Voucher number " . voucher_number_prefix($voucher_type) . $cur_voucher->number . " [id:" . $voucher_id . "]");
} else {
$data['error'] = "Error sending email. Please check you email settings";
- $this->logger->write_message("error", "Error emailing " . ucfirst($voucher_type) . " Voucher number " . $cur_voucher->number . " [id:" . $voucher_id . "]");
+ $this->logger->write_message("error", "Error emailing " . ucfirst($voucher_type) . " Voucher number " . voucher_number_prefix($voucher_type) . $cur_voucher->number . " [id:" . $voucher_id . "]");
}
$this->load->view('voucher/email', $data);
return;
commit 2d1c177307cd8850248f3c5f51ed83e9e86e1229
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Tue Dec 14 15:20:18 2010 +0530
Added Voucher Prefix
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
diff --git a/system/application/controllers/report.php b/system/application/controllers/report.php
index 22fd4f6..61e0cad 100644
--- a/system/application/controllers/report.php
+++ b/system/application/controllers/report.php
@@ -213,7 +213,7 @@ class Report extends Controller {
foreach ($ledgerst_q->result() as $row)
{
$ledgerst[$counter][0] = date_mysql_to_php($row->vdate);
- $ledgerst[$counter][1] = $row->vid;
+ $ledgerst[$counter][1] = voucher_number_prefix(n_to_v($row->vtype)) . $row->vnumber;
/* Opposite voucher name */
if ($row->ldc == "D")
diff --git a/system/application/controllers/voucher.php b/system/application/controllers/voucher.php
index 9bb55c9..d604293 100644
--- a/system/application/controllers/voucher.php
+++ b/system/application/controllers/voucher.php
@@ -158,7 +158,7 @@ class Voucher extends Controller {
$html .= "\">";
$html .= "<td>" . date_mysql_to_php_display($row->date) . "</td>";
- $html .= "<td>" . anchor('voucher/view/' . strtolower($html_voucher_type) . "/" . $row->id, $row->number, array('title' => 'View ' . ucfirst($html_voucher_type) . ' Voucher', 'class' => 'anchor-link-a')) . "</td>";
+ $html .= "<td>" . anchor('voucher/view/' . strtolower($html_voucher_type) . "/" . $row->id, voucher_number_prefix($html_voucher_type) . $row->number, array('title' => 'View ' . ucfirst($html_voucher_type) . ' Voucher', 'class' => 'anchor-link-a')) . "</td>";
$html .= "<td>";
$html .= $this->Tag_model->show_voucher_tag($row->tag_id);
@@ -856,7 +856,7 @@ class Voucher extends Controller {
$message .= "<h3>" . ucfirst($voucher_type) . " Voucher</h3>";
$message .= "<p><b>" . $this->config->item('account_name') . "</b></p>";
$message .= "<p>" . $this->config->item('account_address') . "</p>";
- $message .= "<p>Voucher Number : " . $cur_voucher->number . "</p>";
+ $message .= "<p>Voucher Number : " . voucher_number_prefix($voucher_type) . $cur_voucher->number . "</p>";
$message .= "<p>Voucher Date : " . date_mysql_to_php_display($cur_voucher->date) . "</p>";
$message .= "<table border=1>";
$message .= "<thead><tr><th>Ledger A/C</th><th>Dr Amount</th><th>Cr Amount</th></tr></thead>";
diff --git a/system/application/helpers/custom_helper.php b/system/application/helpers/custom_helper.php
index ffe1363..bfbf915 100644
--- a/system/application/helpers/custom_helper.php
+++ b/system/application/helpers/custom_helper.php
@@ -119,5 +119,39 @@ if ( ! function_exists('v_to_n'))
}
}
+/**
+ * Converts Voucher number to proper voucher prefix formats
+ *
+ * @access public
+ * @param voucher type
+ * @return string
+ */
+if ( ! function_exists('voucher_number_prefix'))
+{
+ function voucher_number_prefix($voucher_type)
+ {
+ $CI =& get_instance();
+
+ $voucher_prefix = "";
+
+ switch ($voucher_type)
+ {
+ case "receipt":
+ $voucher_prefix = $CI->config->item('account_receipt_prefix');
+ break;
+ case "payment":
+ $voucher_prefix = $CI->config->item('account_payment_prefix');
+ break;
+ case "contra":
+ $voucher_prefix = $CI->config->item('account_contra_prefix');
+ break;
+ case "journal":
+ $voucher_prefix = $CI->config->item('account_journal_prefix');
+ break;
+ }
+ return $voucher_prefix;
+ }
+}
+
/* End of file custom_helper.php */
/* Location: ./system/application/helpers/custom_helper.php */
diff --git a/system/application/libraries/Startup.php b/system/application/libraries/Startup.php
index 43bb741..f7b52ea 100644
--- a/system/application/libraries/Startup.php
+++ b/system/application/libraries/Startup.php
@@ -144,6 +144,10 @@ class Startup
$CI->config->set_item('account_email_port', $account_d->email_port);
$CI->config->set_item('account_email_username', $account_d->email_username);
$CI->config->set_item('account_email_password', $account_d->email_password);
+ $CI->config->set_item('account_receipt_prefix', $account_d->receipt_voucher_prefix);
+ $CI->config->set_item('account_payment_prefix', $account_d->payment_voucher_prefix);
+ $CI->config->set_item('account_contra_prefix', $account_d->contra_voucher_prefix);
+ $CI->config->set_item('account_journal_prefix', $account_d->journal_voucher_prefix);
/************** Load general application settings *************/
$setting_ini_file = "system/application/config/general.ini";
diff --git a/system/application/views/report/ledgerst.php b/system/application/views/report/ledgerst.php
index 0d5a15e..636fa45 100644
--- a/system/application/views/report/ledgerst.php
+++ b/system/application/views/report/ledgerst.php
@@ -121,7 +121,7 @@
echo date_mysql_to_php_display($row->vdate);
echo "</td>";
echo "<td>";
- echo anchor('voucher/view/' . n_to_v($row->vtype) . '/' . $row->vid, $row->vnumber, array('title' => 'View ' . ' Voucher', 'class' => 'anchor-link-a'));
+ echo anchor('voucher/view/' . n_to_v($row->vtype) . '/' . $row->vid, voucher_number_prefix(n_to_v($row->vtype)) . $row->vnumber, array('title' => 'View ' . ' Voucher', 'class' => 'anchor-link-a'));
echo "</td>";
/* Getting opposite Ledger name */
diff --git a/system/application/views/voucher/add.php b/system/application/views/voucher/add.php
index 08fb5f8..1bf5b6a 100644
--- a/system/application/views/voucher/add.php
+++ b/system/application/views/voucher/add.php
@@ -187,7 +187,7 @@ $(document).ready(function() {
echo "<p>";
echo form_label('Voucher Number', 'voucher_number');
echo " ";
- echo form_input($voucher_number);
+ echo voucher_number_prefix($voucher_type) . form_input($voucher_number);
echo " ";
echo form_label('Voucher Date', 'voucher_date');
echo " ";
diff --git a/system/application/views/voucher/edit.php b/system/application/views/voucher/edit.php
index 0a9bd5f..24a92ac 100644
--- a/system/application/views/voucher/edit.php
+++ b/system/application/views/voucher/edit.php
@@ -187,7 +187,7 @@ $(document).ready(function() {
echo "<p>";
echo form_label('Voucher Number', 'voucher_number');
echo " ";
- echo form_input($voucher_number);
+ echo voucher_number_prefix($voucher_type) . form_input($voucher_number);
echo " ";
echo form_label('Voucher Date', 'voucher_date');
echo " ";
diff --git a/system/application/views/voucher/printpreview.php b/system/application/views/voucher/printpreview.php
index d26daf3..8b27448 100644
--- a/system/application/views/voucher/printpreview.php
+++ b/system/application/views/voucher/printpreview.php
@@ -11,7 +11,7 @@
<br />
<div id="print-voucher-type"><span class="value"><?php echo ucfirst($voucher_type); ?> Voucher</span></div>
<br />
- <div id="print-voucher-number"><?php echo ucfirst($voucher_type); ?> Voucher Number : <span class="value"><?php echo $voucher_number; ?></span></div>
+ <div id="print-voucher-number"><?php echo ucfirst($voucher_type); ?> Voucher Number : <span class="value"><?php echo voucher_number_prefix($voucher_type) . $voucher_number; ?></span></div>
<div id="print-voucher-number"><?php echo ucfirst($voucher_type); ?> Voucher Date : <span class="value"><?php echo $voucher_date; ?></span></div>
<br />
<table id="print-voucher-table">
diff --git a/system/application/views/voucher/view.php b/system/application/views/voucher/view.php
index 4f95b47..f4f2710 100644
--- a/system/application/views/voucher/view.php
+++ b/system/application/views/voucher/view.php
@@ -1,4 +1,4 @@
-<p>Voucher Number : <span class="bold"><?php echo $cur_voucher->number; ?></span>
+<p>Voucher Number : <span class="bold"><?php echo voucher_number_prefix($voucher_type) . $cur_voucher->number; ?></span>
Voucher Date : <span class="bold"><?php echo date_mysql_to_php_display($cur_voucher->date); ?></span>
</p>
commit 6aea12aa0ee2155288f32efdea8a7f77c38ddd54
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Tue Dec 14 14:41:45 2010 +0530
Renamed gensetting to setting
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
diff --git a/system/application/controllers/admin/gensetting.php b/system/application/controllers/admin/gensetting.php
deleted file mode 100644
index 85b2578..0000000
--- a/system/application/controllers/admin/gensetting.php
+++ /dev/null
@@ -1,90 +0,0 @@
-<?php
-
-class Gensetting extends Controller {
-
- function Gensetting()
- {
- parent::Controller();
- return;
- }
-
- function index()
- {
- $this->template->set('page_title', 'General Settings');
-
- /* Default settings */
- $data['row_count'] = 20;
-
- /* Loading settings from ini file */
- $ini_file = "system/application/config/general.ini";
-
- /* Check if database ini file exists */
- if (get_file_info($ini_file))
- {
- /* Parsing database ini file */
- $cur_setting = parse_ini_file($ini_file);
- if ($cur_setting)
- {
- $data['row_count'] = isset($cur_setting['row_count']) ? $cur_setting['row_count'] : "20";
- }
- }
-
- /* Form fields */
- $data['row_count_options'] = array(
- '10' => 10,
- '20' => 20,
- '50' => 50,
- '100' => 100,
- '200' => 200,
- );
-
- /* Form validations */
- $this->form_validation->set_rules('row_count', 'Row Count', 'trim|required|is_natural_no_zero');
-
- /* Repopulating form */
- if ($_POST)
- {
- $data['row_count'] = $this->input->post('row_count', TRUE);
- }
-
- /* Validating form */
- if ($this->form_validation->run() == FALSE)
- {
- $this->messages->add(validation_errors(), 'error');
- $this->template->load('admin_template', 'admin/gensetting', $data);
- return;
- }
- else
- {
- $data_row_count = $this->input->post('row_count', TRUE);
-
- if ($data_row_count < 0 || $data_row_count > 200)
- {
- $this->messages->add('Invalid value for Row Count', 'error');
- $this->template->load('admin_template', 'admin/gensetting');
- return;
- }
-
- $new_setting = "[general]" . "\r\n" . "row_count = \"" . $data_row_count . "\"" . "\r\n";
-
- $new_setting_html = '[general]<br />row_count = "' . $data_row_count . '"<br />';
-
- /* Writing the connection string to end of file - writing in 'a' append mode */
- if ( ! write_file($ini_file, $new_setting))
- {
- $this->messages->add("Failed to update settings file. Please check if \"" . $ini_file . "\" file is writable", 'error');
- $this->messages->add("You can manually create a text file \"" . $ini_file . "\" with the following content :<br /><br />" . $new_setting_html, 'error');
- $this->template->load('admin_template', 'admin/gensetting', $data);
- return;
- } else {
- $this->messages->add('General settings updated successfully', 'success');
- redirect('admin/gensetting');
- return;
- }
- }
- return;
- }
-}
-
-/* End of file gensetting.php */
-/* Location: ./system/application/controllers/admin/gensetting.php */
diff --git a/system/application/controllers/admin/setting.php b/system/application/controllers/admin/setting.php
new file mode 100644
index 0000000..0ab3611
--- /dev/null
+++ b/system/application/controllers/admin/setting.php
@@ -0,0 +1,90 @@
+<?php
+
+class Setting extends Controller {
+
+ function Setting()
+ {
+ parent::Controller();
+ return;
+ }
+
+ function index()
+ {
+ $this->template->set('page_title', 'General Settings');
+
+ /* Default settings */
+ $data['row_count'] = 20;
+
+ /* Loading settings from ini file */
+ $ini_file = "system/application/config/general.ini";
+
+ /* Check if database ini file exists */
+ if (get_file_info($ini_file))
+ {
+ /* Parsing database ini file */
+ $cur_setting = parse_ini_file($ini_file);
+ if ($cur_setting)
+ {
+ $data['row_count'] = isset($cur_setting['row_count']) ? $cur_setting['row_count'] : "20";
+ }
+ }
+
+ /* Form fields */
+ $data['row_count_options'] = array(
+ '10' => 10,
+ '20' => 20,
+ '50' => 50,
+ '100' => 100,
+ '200' => 200,
+ );
+
+ /* Form validations */
+ $this->form_validation->set_rules('row_count', 'Row Count', 'trim|required|is_natural_no_zero');
+
+ /* Repopulating form */
+ if ($_POST)
+ {
+ $data['row_count'] = $this->input->post('row_count', TRUE);
+ }
+
+ /* Validating form */
+ if ($this->form_validation->run() == FALSE)
+ {
+ $this->messages->add(validation_errors(), 'error');
+ $this->template->load('admin_template', 'admin/setting', $data);
+ return;
+ }
+ else
+ {
+ $data_row_count = $this->input->post('row_count', TRUE);
+
+ if ($data_row_count < 0 || $data_row_count > 200)
+ {
+ $this->messages->add('Invalid value for Row Count', 'error');
+ $this->template->load('admin_template', 'admin/setting');
+ return;
+ }
+
+ $new_setting = "[general]" . "\r\n" . "row_count = \"" . $data_row_count . "\"" . "\r\n";
+
+ $new_setting_html = '[general]<br />row_count = "' . $data_row_count . '"<br />';
+
+ /* Writing the connection string to end of file - writing in 'a' append mode */
+ if ( ! write_file($ini_file, $new_setting))
+ {
+ $this->messages->add("Failed to update settings file. Please check if \"" . $ini_file . "\" file is writable", 'error');
+ $this->messages->add("You can manually create a text file \"" . $ini_file . "\" with the following content :<br /><br />" . $new_setting_html, 'error');
+ $this->template->load('admin_template', 'admin/setting', $data);
+ return;
+ } else {
+ $this->messages->add('General settings updated successfully', 'success');
+ redirect('admin/setting');
+ return;
+ }
+ }
+ return;
+ }
+}
+
+/* End of file setting.php */
+/* Location: ./system/application/controllers/admin/setting.php */
diff --git a/system/application/views/admin/gensetting.php b/system/application/views/admin/gensetting.php
deleted file mode 100644
index 07e3da8..0000000
--- a/system/application/views/admin/gensetting.php
+++ /dev/null
@@ -1,17 +0,0 @@
-<?php
- echo form_open('admin/gensetting');
-
- echo "<p>";
- echo form_label('Number of rows to display per page', 'row_count');
- echo "<br />";
- echo form_dropdown('row_count', $row_count_options, $row_count);
- echo "</p>";
-
- echo "<p>";
- echo form_submit('submit', 'Update');
- echo " ";
- echo anchor('admin', 'Back', array('title' => 'Back to admin'));
- echo "</p>";
-
- echo form_close();
-
diff --git a/system/application/views/admin/setting.php b/system/application/views/admin/setting.php
new file mode 100644
index 0000000..f365f0a
--- /dev/null
+++ b/system/application/views/admin/setting.php
@@ -0,0 +1,17 @@
+<?php
+ echo form_open('admin/setting');
+
+ echo "<p>";
+ echo form_label('Number of rows to display per page', 'row_count');
+ echo "<br />";
+ echo form_dropdown('row_count', $row_count_options, $row_count);
+ echo "</p>";
+
+ echo "<p>";
+ echo form_submit('submit', 'Update');
+ echo " ";
+ echo anchor('admin', 'Back', array('title' => 'Back to admin'));
+ echo "</p>";
+
+ echo form_close();
+
diff --git a/system/application/views/admin/welcome.php b/system/application/views/admin/welcome.php
index 2a8b841..d6f34de 100644
--- a/system/application/views/admin/welcome.php
+++ b/system/application/views/admin/welcome.php
@@ -32,7 +32,7 @@
<div id="right-col">
<div class="settings-container">
<div class="settings-title">
- <?php echo anchor('admin/gensetting', 'General Settings', array('title' => 'General Application Settings')); ?>
+ <?php echo anchor('admin/setting', 'General Settings', array('title' => 'General Application Settings')); ?>
</div>
<div class="settings-desc">
General application settings
commit d435cdb5cc49a288e5b19c428d22acfb54999c3d
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Tue Dec 14 14:36:34 2010 +0530
Added voucher prefix settings
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
diff --git a/system/application/controllers/setting.php b/system/application/controllers/setting.php
index 91ffd7d..86a82b3 100644
--- a/system/application/controllers/setting.php
+++ b/system/application/controllers/setting.php
@@ -789,6 +789,95 @@ class Setting extends Controller {
redirect('setting');
return;
}
+
+ function voucher()
+ {
+ $this->template->set('page_title', 'Voucher Settings');
+ $account_data = $this->Setting_model->get_current();
+
+ $data['receipt_prefix'] = array(
+ 'name' => 'receipt_prefix',
+ 'id' => 'receipt_prefix',
+ 'maxlength' => '10',
+ 'size' => '10',
+ 'value' => '',
+ );
+ $data['payment_prefix'] = array(
+ 'name' => 'payment_prefix',
+ 'id' => 'payment_prefix',
+ 'maxlength' => '10',
+ 'size' => '10',
+ 'value' => '',
+ );
+ $data['contra_prefix'] = array(
+ 'name' => 'contra_prefix',
+ 'id' => 'contra_prefix',
+ 'maxlength' => '10',
+ 'size' => '10',
+ 'value' => '',
+ );
+ $data['journal_prefix'] = array(
+ 'name' => 'journal_prefix',
+ 'id' => 'journal_prefix',
+ 'maxlength' => '10',
+ 'size' => '10',
+ 'value' => '',
+ );
+
+ if ($account_data)
+ {
+ $data['receipt_prefix']['value'] = $account_data->receipt_voucher_prefix;
+ $data['payment_prefix']['value'] = $account_data->payment_voucher_prefix;
+ $data['contra_prefix']['value'] = $account_data->contra_voucher_prefix;
+ $data['journal_prefix']['value'] = $account_data->journal_voucher_prefix;
+ }
+
+ /* Form validations */
+ $this->form_validation->set_rules('receipt_prefix', 'Prefix Receipt Vouchers', 'trim');
+ $this->form_validation->set_rules('payment_prefix', 'Prefix Payment Vouchers', 'trim');
+ $this->form_validation->set_rules('contra_prefix', 'Prefix Contra Vouchers', 'trim');
+ $this->form_validation->set_rules('journal_prefix', 'Prefix Journal Vouchers', 'trim');
+
+ /* Repopulating form */
+ if ($_POST)
+ {
+ $data['receipt_prefix']['value'] = $this->input->post('receipt_prefix', TRUE);
+ $data['payment_prefix']['value'] = $this->input->post('payment_prefix', TRUE);
+ $data['contra_prefix']['value'] = $this->input->post('contra_prefix', TRUE);
+ $data['journal_prefix']['value'] = $this->input->post('journal_prefix', TRUE);
+ }
+
+ /* Validating form */
+ if ($this->form_validation->run() == FALSE)
+ {
+ $this->messages->add(validation_errors(), 'error');
+ $this->template->load('template', 'setting/voucher', $data);
+ return;
+ } else {
+ $data_receipt_prefix = $this->input->post('receipt_prefix', TRUE);
+ $data_payment_prefix = $this->input->post('payment_prefix', TRUE);
+ $data_contra_prefix = $this->input->post('contra_prefix', TRUE);
+ $data_journal_prefix = $this->input->post('journal_prefix', TRUE);
+
+ /* Update settings */
+ $this->db->trans_start();
+ if ( ! $this->db->query("UPDATE settings SET receipt_voucher_prefix = ?, payment_voucher_prefix = ?, contra_voucher_prefix = ?, journal_voucher_prefix = ? WHERE id = 1", array($data_receipt_prefix, $data_payment_prefix, $data_contra_prefix, $data_journal_prefix)))
+ {
+ $this->db->trans_rollback();
+ $this->messages->add('Error updating voucher settings', 'error');
+ $this->logger->write_message("error", "Error updating voucher settings");
+ $this->template->load('template', 'setting/voucher');
+ return;
+ } else {
+ $this->db->trans_complete();
+ $this->messages->add('Voucher settings updated successfully', 'success');
+ $this->logger->write_message("success", "Updated voucher settings");
+ redirect('setting');
+ return;
+ }
+ }
+ return;
+ }
}
/* End of file setting.php */
diff --git a/system/application/views/setting/index.php b/system/application/views/setting/index.php
index c203961..2088162 100644
--- a/system/application/views/setting/index.php
+++ b/system/application/views/setting/index.php
@@ -26,7 +26,7 @@
</div>
<div class="settings-container">
<div class="settings-title">
- <?php echo anchor('setting/printer', 'Printer Settings', array('title' => 'Printer Settings')); ?>
+ <?php echo anchor('setting/printer', 'Printer Settings', array('title' => 'Printer Settings')); ?>
</div>
<div class="settings-desc">
Setup printing options for vouchers, reports, etc.
@@ -50,6 +50,14 @@
Manage Voucher Tags
</div>
</div>
+ <div class="settings-container">
+ <div class="settings-title">
+ <?php echo anchor('setting/voucher', 'Voucher', array('title' => 'Voucher Settings')); ?>
+ </div>
+ <div class="settings-desc">
+ Voucher settings
+ </div>
+ </div>
</div>
</div>
<div class="clear">
diff --git a/system/application/views/setting/voucher.php b/system/application/views/setting/voucher.php
new file mode 100644
index 0000000..e629be6
--- /dev/null
+++ b/system/application/views/setting/voucher.php
@@ -0,0 +1,41 @@
+<?php
+ echo form_open('setting/voucher');
+
+ echo "<p>";
+ echo form_fieldset('Prefix Settings', array('class' => "fieldset-auto-width"));
+
+ echo "<p>";
+ echo form_label('Prefix Receipt Vouchers', 'receipt_prefix');
+ echo "<br />";
+ echo form_input($receipt_prefix);
+ echo "</p>";
+
+ echo "<p>";
+ echo form_label('Prefix Payment Vouchers', 'payment_prefix');
+ echo "<br />";
+ echo form_input($payment_prefix);
+ echo "</p>";
+
+ echo "<p>";
+ echo form_label('Prefix Contra Vouchers', 'contra_prefix');
+ echo "<br />";
+ echo form_input($contra_prefix);
+ echo "</p>";
+
+ echo "<p>";
+ echo form_label('Prefix Journal Vouchers', 'journal_prefix');
+ echo "<br />";
+ echo form_input($journal_prefix);
+ echo "</p>";
+
+ echo form_fieldset_close();
+ echo "</p>";
+
+ echo "<p>";
+ echo form_submit('submit', 'Update');
+ echo " ";
+ echo anchor('setting', 'Back', array('title' => 'Back to settings'));
+ echo "</p>";
+
+ echo form_close();
+
commit 0ebe94b55c00e9a8b2d67be8fe434b21fc6848f9
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Tue Dec 14 13:54:10 2010 +0530
Check if Financial start date is less than end date
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
diff --git a/system/application/controllers/admin/create.php b/system/application/controllers/admin/create.php
index 8c47a7c..22fb2ea 100644
--- a/system/application/controllers/admin/create.php
+++ b/system/application/controllers/admin/create.php
@@ -209,6 +209,14 @@ class Create extends Controller {
return;
}
+ /* Check if start date is less than end date */
+ if ($data_fy_end <= $data_fy_start)
+ {
+ $this->messages->add("Financial start date cannot be greater than end date", 'error');
+ $this->template->load('admin_template', 'admin/create', $data);
+ return;
+ }
+
if ($data_database_host == "")
$data_database_host = "localhost";
if ($data_database_port == "")
diff --git a/system/application/controllers/setting.php b/system/application/controllers/setting.php
index e2c4f29..91ffd7d 100644
--- a/system/application/controllers/setting.php
+++ b/system/application/controllers/setting.php
@@ -291,6 +291,14 @@ class Setting extends Controller {
return;
}
+ /* Check if start date is less than end date */
+ if ($data_fy_end <= $data_fy_start)
+ {
+ $this->messages->add("Financial start date cannot be greater than end date", 'error');
+ $this->template->load('template', 'setting/cf', $data);
+ return;
+ }
+
if ($data_database_host == "")
$data_database_host = "localhost";
if ($data_database_port == "")
commit 5821cf05d5b7dddfb7c29be3445a7cd19bebb23e
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Tue Dec 14 13:45:07 2010 +0530
Added Currency to Voucher printing
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
diff --git a/system/application/controllers/voucher.php b/system/application/controllers/voucher.php
index 060e887..9bb55c9 100644
--- a/system/application/controllers/voucher.php
+++ b/system/application/controllers/voucher.php
@@ -181,7 +181,7 @@ class Voucher extends Controller {
$html .= " " . anchor('voucher/delete/' . strtolower($html_voucher_type) . "/" . $row->id , img(array('src' => asset_url() . "images/icons/delete.png", 'border' => '0', 'alt' => 'Delete ' . ucfirst($html_voucher_type) . ' Voucher', 'class' => "confirmClick", 'title' => "Delete voucher")), array('title' => 'Delete ' . ucfirst($html_voucher_type) . ' Voucher')) . " ";
- $html .= " " . anchor_popup('voucher/printpreview/' . strtolower($html_voucher_type) . "/" . $row->id , img(array('src' => asset_url() . "images/icons/print.png", 'border' => '0', 'alt' => 'Print ' . ucfirst($html_voucher_type) . ' Voucher')), array('title' => 'Print ' . ucfirst($html_voucher_type) . ' Voucher')) . " ";
+ $html .= " " . anchor_popup('voucher/printpreview/' . strtolower($html_voucher_type) . "/" . $row->id , img(array('src' => asset_url() . "images/icons/print.png", 'border' => '0', 'alt' => 'Print ' . ucfirst($html_voucher_type) . ' Voucher')), array('title' => 'Print ' . ucfirst($html_voucher_type) . ' Voucher', 'width' => '600', 'height' => '600')) . " ";
$html .= " " . anchor_popup('voucher/email/' . strtolower($html_voucher_type) . "/" . $row->id , img(array('src' => asset_url() . "images/icons/email.png", 'border' => '0', 'alt' => 'Email ' . ucfirst($html_voucher_type) . ' Voucher')), array('title' => 'Email ' . ucfirst($html_voucher_type) . ' Voucher', 'width' => '500', 'height' => '300')) . "</td>";
diff --git a/system/application/views/voucher/printpreview.php b/system/application/views/voucher/printpreview.php
index da45fb5..d26daf3 100644
--- a/system/application/views/voucher/printpreview.php
+++ b/system/application/views/voucher/printpreview.php
@@ -20,6 +20,7 @@
</thead>
<tbody>
<?php
+ $currency = $this->config->item('account_currency_symbol');
foreach ($ledger_data as $id => $row)
{
echo "<tr class=\"tr-ledger\">";
@@ -31,15 +32,15 @@
}
if ($row['dc'] == "D")
{
- echo "<td class=\"ledger-dr item\">Dr " . $row['amount'] . "</td>";
+ echo "<td class=\"ledger-dr item\">" . $currency . " " . $row['amount'] . "</td>";
echo "<td class=\"ledger-cr last-item\"></td>";
} else {
echo "<td class=\"ledger-dr item\"></td>";
- echo "<td class=\"ledger-cr last-item\">Cr " . $row['amount'] . "</td>";
+ echo "<td class=\"ledger-cr last-item\">" . $currency . " " . $row['amount'] . "</td>";
}
echo "</tr>";
}
- echo "<tr class=\"tr-total\"><td class=\"total-name\">Total</td><td class=\"total-dr\">Dr " . $voucher_dr_total . "</td><td class=\"total-cr\">Cr " . $voucher_cr_total . "</td></tr>";
+ echo "<tr class=\"tr-total\"><td class=\"total-name\">Total</td><td class=\"total-dr\">" . $currency . " " . $voucher_dr_total . "</td><td class=\"total-cr\">" . $currency . " " . $voucher_cr_total . "</td></tr>";
?>
</tbody>
</table>
diff --git a/system/application/views/voucher/view.php b/system/application/views/voucher/view.php
index 09c36c0..4f95b47 100644
--- a/system/application/views/voucher/view.php
+++ b/system/application/views/voucher/view.php
@@ -59,7 +59,7 @@ else
echo " | ";
echo anchor('voucher/delete/' . $voucher_type . "/" . $cur_voucher->id, 'Delete', array('class' => "confirmClick", 'title' => "Delete voucher", 'title' => 'Delete this ' . ucfirst($voucher_type) . ' Voucher'));
echo " | ";
- echo anchor_popup('voucher/printpreview/' . $voucher_type . "/" . $cur_voucher->id, 'Print', array('title' => 'Print this ' . ucfirst($voucher_type) . ' Voucher'));
+ echo anchor_popup('voucher/printpreview/' . $voucher_type . "/" . $cur_voucher->id, 'Print', array('title' => 'Print this ' . ucfirst($voucher_type) . ' Voucher', 'width' => '600', 'height' => '600'));
echo " | ";
echo anchor_popup('voucher/email/' . $voucher_type . "/" . $cur_voucher->id, 'Email', array('title' => 'Email this ' . ucfirst($voucher_type) . ' Voucher', 'width' => '400', 'height' => '200'));
commit d07518fc3ac8b297cfe58930423f9f6c8a5261f3
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Tue Dec 14 13:38:58 2010 +0530
Renamed to printpreview
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
diff --git a/system/application/controllers/voucher.php b/system/application/controllers/voucher.php
index c3a3242..060e887 100644
--- a/system/application/controllers/voucher.php
+++ b/system/application/controllers/voucher.php
@@ -181,7 +181,7 @@ class Voucher extends Controller {
$html .= " " . anchor('voucher/delete/' . strtolower($html_voucher_type) . "/" . $row->id , img(array('src' => asset_url() . "images/icons/delete.png", 'border' => '0', 'alt' => 'Delete ' . ucfirst($html_voucher_type) . ' Voucher', 'class' => "confirmClick", 'title' => "Delete voucher")), array('title' => 'Delete ' . ucfirst($html_voucher_type) . ' Voucher')) . " ";
- $html .= " " . anchor_popup('voucher/printview/' . strtolower($html_voucher_type) . "/" . $row->id , img(array('src' => asset_url() . "images/icons/print.png", 'border' => '0', 'alt' => 'Print ' . ucfirst($html_voucher_type) . ' Voucher')), array('title' => 'Print ' . ucfirst($html_voucher_type) . ' Voucher')) . " ";
+ $html .= " " . anchor_popup('voucher/printpreview/' . strtolower($html_voucher_type) . "/" . $row->id , img(array('src' => asset_url() . "images/icons/print.png", 'border' => '0', 'alt' => 'Print ' . ucfirst($html_voucher_type) . ' Voucher')), array('title' => 'Print ' . ucfirst($html_voucher_type) . ' Voucher')) . " ";
$html .= " " . anchor_popup('voucher/email/' . strtolower($html_voucher_type) . "/" . $row->id , img(array('src' => asset_url() . "images/icons/email.png", 'border' => '0', 'alt' => 'Email ' . ucfirst($html_voucher_type) . ' Voucher')), array('title' => 'Email ' . ucfirst($html_voucher_type) . ' Voucher', 'width' => '500', 'height' => '300')) . "</td>";
@@ -762,7 +762,7 @@ class Voucher extends Controller {
return;
}
- function printview($voucher_type, $voucher_id)
+ function printpreview($voucher_type, $voucher_id)
{
$this->load->model('Setting_model');
$this->load->model('Ledger_model');
@@ -804,7 +804,7 @@ class Voucher extends Controller {
}
}
- $this->load->view('voucher/printview', $data);
+ $this->load->view('voucher/printpreview', $data);
return;
}
diff --git a/system/application/views/voucher/printpreview.php b/system/application/views/voucher/printpreview.php
new file mode 100644
index 0000000..da45fb5
--- /dev/null
+++ b/system/application/views/voucher/printpreview.php
@@ -0,0 +1,53 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+<title>Print - <?php echo ucfirst($voucher_type); ?> Voucher Number <?php echo $voucher_number; ?></title>
+<?php echo link_tag(asset_url() . 'images/favicon.ico', 'shortcut icon', 'image/ico'); ?>
+<link type="text/css" rel="stylesheet" href="<?php echo asset_url(); ?>css/printvoucher.css">
+</head>
+<body>
+ <div id="print-account-name"><span class="value"><?php echo $this->config->item('account_name'); ?></span></div>
+ <div id="print-account-address"><span class="value"><?php echo $this->config->item('account_address'); ?></span></div>
+ <br />
+ <div id="print-voucher-type"><span class="value"><?php echo ucfirst($voucher_type); ?> Voucher</span></div>
+ <br />
+ <div id="print-voucher-number"><?php echo ucfirst($voucher_type); ?> Voucher Number : <span class="value"><?php echo $voucher_number; ?></span></div>
+ <div id="print-voucher-number"><?php echo ucfirst($voucher_type); ?> Voucher Date : <span class="value"><?php echo $voucher_date; ?></span></div>
+ <br />
+ <table id="print-voucher-table">
+ <thead>
+ <tr class="tr-title"><th>Ledger A/C</th><th>Dr Amount</th><th>Cr Amount</th></tr>
+ </thead>
+ <tbody>
+ <?php
+ foreach ($ledger_data as $id => $row)
+ {
+ echo "<tr class=\"tr-ledger\">";
+ if ($row['dc'] == "D")
+ {
+ echo "<td class=\"ledger-name item\">By " . $row['name'] . "</td>";
+ } else {
+ echo "<td class=\"ledger-name item\"> To " . $row['name'] . "</td>";
+ }
+ if ($row['dc'] == "D")
+ {
+ echo "<td class=\"ledger-dr item\">Dr " . $row['amount'] . "</td>";
+ echo "<td class=\"ledger-cr last-item\"></td>";
+ } else {
+ echo "<td class=\"ledger-dr item\"></td>";
+ echo "<td class=\"ledger-cr last-item\">Cr " . $row['amount'] . "</td>";
+ }
+ echo "</tr>";
+ }
+ echo "<tr class=\"tr-total\"><td class=\"total-name\">Total</td><td class=\"total-dr\">Dr " . $voucher_dr_total . "</td><td class=\"total-cr\">Cr " . $voucher_cr_total . "</td></tr>";
+ ?>
+ </tbody>
+ </table>
+ <br />
+ <div id="print-voucher-narration">Narration : <span class="value"><?php echo $voucher_narration; ?></span></div>
+ <br />
+ <form>
+ <input class="hide-print" type="button" onClick="window.print()" value="Print voucher">
+ </form>
+</body>
+</html>
diff --git a/system/application/views/voucher/printview.php b/system/application/views/voucher/printview.php
deleted file mode 100644
index 64db194..0000000
--- a/system/application/views/voucher/printview.php
+++ /dev/null
@@ -1,55 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<title>Print - <?php echo ucfirst($voucher_type); ?> Voucher Number <?php echo $voucher_number; ?></title>
-<?php echo link_tag(asset_url() . 'images/favicon.ico', 'shortcut icon', 'image/ico'); ?>
-<link type="text/css" rel="stylesheet" href="<?php echo asset_url(); ?>css/printvoucher.css">
-</head>
-<body>
- <div id="print-html-link" class="hide-print"><a href="javascript:window.print();">Print HTML</a></div>
- <br />
- <div id="print-account-name"><span class="value"><?php echo $this->config->item('account_name'); ?></span></div>
- <div id="print-account-address"><span class="value"><?php echo $this->config->item('account_address'); ?></span></div>
- <br />
- <div id="print-voucher-type"><span class="value"><?php echo ucfirst($voucher_type); ?> Voucher</span></div>
- <br />
- <div id="print-voucher-number"><?php echo ucfirst($voucher_type); ?> Voucher Number : <span class="value"><?php echo $voucher_number; ?></span></div>
- <div id="print-voucher-number"><?php echo ucfirst($voucher_type); ?> Voucher Date : <span class="value"><?php echo $voucher_date; ?></span></div>
- <br />
- <table id="print-voucher-table">
- <thead>
- <tr class="tr-title"><th>Ledger A/C</th><th>Dr Amount</th><th>Cr Amount</th></tr>
- </thead>
- <tbody>
- <?php
- foreach ($ledger_data as $id => $row)
- {
- echo "<tr class=\"tr-ledger\">";
- if ($row['dc'] == "D")
- {
- echo "<td class=\"ledger-name item\">By " . $row['name'] . "</td>";
- } else {
- echo "<td class=\"ledger-name item\"> To " . $row['name'] . "</td>";
- }
- if ($row['dc'] == "D")
- {
- echo "<td class=\"ledger-dr item\">Dr " . $row['amount'] . "</td>";
- echo "<td class=\"ledger-cr last-item\"></td>";
- } else {
- echo "<td class=\"ledger-dr item\"></td>";
- echo "<td class=\"ledger-cr last-item\">Cr " . $row['amount'] . "</td>";
- }
- echo "</tr>";
- }
- echo "<tr class=\"tr-total\"><td class=\"total-name\">Total</td><td class=\"total-dr\">Dr " . $voucher_dr_total . "</td><td class=\"total-cr\">Cr " . $voucher_cr_total . "</td></tr>";
- ?>
- </tbody>
- </table>
- <br />
- <div id="print-voucher-narration">Narration : <span class="value"><?php echo $voucher_narration; ?></span></div>
- <br />
- <form>
- <input class="hide-print" type="button" onClick="window.print()" value="Print voucher">
- </form>
-</body>
-</html>
diff --git a/system/application/views/voucher/view.php b/system/application/views/voucher/view.php
index 80c4f09..09c36c0 100644
--- a/system/application/views/voucher/view.php
+++ b/system/application/views/voucher/view.php
@@ -59,7 +59,7 @@ else
echo " | ";
echo anchor('voucher/delete/' . $voucher_type . "/" . $cur_voucher->id, 'Delete', array('class' => "confirmClick", 'title' => "Delete voucher", 'title' => 'Delete this ' . ucfirst($voucher_type) . ' Voucher'));
echo " | ";
- echo anchor_popup('voucher/printview/' . $voucher_type . "/" . $cur_voucher->id, 'Print', array('title' => 'Print this ' . ucfirst($voucher_type) . ' Voucher'));
+ echo anchor_popup('voucher/printpreview/' . $voucher_type . "/" . $cur_voucher->id, 'Print', array('title' => 'Print this ' . ucfirst($voucher_type) . ' Voucher'));
echo " | ";
echo anchor_popup('voucher/email/' . $voucher_type . "/" . $cur_voucher->id, 'Email', array('title' => 'Email this ' . ucfirst($voucher_type) . ' Voucher', 'width' => '400', 'height' => '200'));
commit f82d48dc342d90190e82bdf7562f2c27aac2dbc7
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Tue Dec 14 12:51:00 2010 +0530
Added Voucher print styling
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
diff --git a/system/application/assets/css/printvoucher.css b/system/application/assets/css/printvoucher.css
index e69de29..7578edc 100644
--- a/system/application/assets/css/printvoucher.css
+++ b/system/application/assets/css/printvoucher.css
@@ -0,0 +1,61 @@
+/*********************************** COMMON ***********************************/
+body {
+ color:#000000;
+ font:14px "Helvetica Neue","Lucida Grande","Helvetica Neue",Arial,sans-serif;
+ margin:20px;
+ padding:0;
+}
+
+/******************************** SPECIFIC ************************************/
+
+#print-account-name {
+ text-align:center;
+ font-size:17px;
+}
+
+#print-account-address {
+ text-align:center;
+ font-size:14px;
+}
+
+#print-voucher-type {
+ text-align:center;
+ font-size:15px;
+}
+
+table#print-voucher-table {
+ border:1px solid #000000;
+ border-collapse: collapse;
+}
+
+table#print-voucher-table tr.tr-title {
+ text-align:left;
+ border:1px solid #000000;
+ padding:5px 0 5px 2px;
+}
+
+table#print-voucher-table tr.tr-title th {
+ padding:5px 0 5px 5px;
+}
+
+table#print-voucher-table td {
+ padding:5px 0 5px 5px;
+}
+
+table#print-voucher-table td.item {
+ padding-right:35px;
+}
+
+table#print-voucher-table td.last-item {
+ padding-right:5px;
+}
+
+table#print-voucher-table tr.tr-total {
+ border:1px solid #000000;
+}
+
+@media print {
+ .hide-print {
+ display: none;
+ }
+}
\ No newline at end of file
diff --git a/system/application/controllers/voucher.php b/system/application/controllers/voucher.php
index 32e88c9..c3a3242 100644
--- a/system/application/controllers/voucher.php
+++ b/system/application/controllers/voucher.php
@@ -786,11 +786,7 @@ class Voucher extends Controller {
$data['voucher_draft'] = $cur_voucher->draft;
/* Getting Ledger details */
- $ledger_q;
- if ($voucher_type == "receipt" || $voucher_type == "contra")
- $ledger_q = $this->db->query("SELECT * FROM voucher_items WHERE voucher_id = ? ORDER BY dc DESC", $voucher_id);
- else
- $ledger_q = $this->db->query("SELECT * FROM voucher_items WHERE voucher_id = ? ORDER BY dc ASC", $voucher_id);
+ $ledger_q = $this->db->query("SELECT * FROM voucher_items WHERE voucher_id = ? ORDER BY dc DESC", $voucher_id);
$counter = 0;
$data['ledger_data'] = array();
diff --git a/system/application/views/voucher/printview.php b/system/application/views/voucher/printview.php
index 8e827bf..64db194 100644
--- a/system/application/views/voucher/printview.php
+++ b/system/application/views/voucher/printview.php
@@ -6,36 +6,50 @@
<link type="text/css" rel="stylesheet" href="<?php echo asset_url(); ?>css/printvoucher.css">
</head>
<body>
- <div id="print-html-link"><a href="JavaScript:window.print();">Print HTML</a></div>
- <div id="print-voucher-type"><span class="value"><?php echo ucfirst($voucher_type); ?> Voucher</span></div>
+ <div id="print-html-link" class="hide-print"><a href="javascript:window.print();">Print HTML</a></div>
+ <br />
<div id="print-account-name"><span class="value"><?php echo $this->config->item('account_name'); ?></span></div>
<div id="print-account-address"><span class="value"><?php echo $this->config->item('account_address'); ?></span></div>
- <div id="print-voucher-number">Voucher Number : <span class="value"><?php echo $voucher_number; ?></span></div>
- <div id="print-voucher-number">Voucher Date : <span class="value"><?php echo $voucher_date; ?></span></div>
+ <br />
+ <div id="print-voucher-type"><span class="value"><?php echo ucfirst($voucher_type); ?> Voucher</span></div>
+ <br />
+ <div id="print-voucher-number"><?php echo ucfirst($voucher_type); ?> Voucher Number : <span class="value"><?php echo $voucher_number; ?></span></div>
+ <div id="print-voucher-number"><?php echo ucfirst($voucher_type); ?> Voucher Date : <span class="value"><?php echo $voucher_date; ?></span></div>
+ <br />
<table id="print-voucher-table">
<thead>
- <tr><th>Ledger A/C</th><th>Dr Amount</th><th>Cr Amount</th></tr>
+ <tr class="tr-title"><th>Ledger A/C</th><th>Dr Amount</th><th>Cr Amount</th></tr>
</thead>
<tbody>
<?php
foreach ($ledger_data as $id => $row)
{
- echo "<tr>";
- echo "<td>" . $row['name'] . "</td>";
+ echo "<tr class=\"tr-ledger\">";
+ if ($row['dc'] == "D")
+ {
+ echo "<td class=\"ledger-name item\">By " . $row['name'] . "</td>";
+ } else {
+ echo "<td class=\"ledger-name item\"> To " . $row['name'] . "</td>";
+ }
if ($row['dc'] == "D")
{
- echo "<td>Dr " . $row['amount'] . "</td>";
- echo "<td></td>";
+ echo "<td class=\"ledger-dr item\">Dr " . $row['amount'] . "</td>";
+ echo "<td class=\"ledger-cr last-item\"></td>";
} else {
- echo "<td></td>";
- echo "<td>Cr " . $row['amount'] . "</td>";
+ echo "<td class=\"ledger-dr item\"></td>";
+ echo "<td class=\"ledger-cr last-item\">Cr " . $row['amount'] . "</td>";
}
echo "</tr>";
}
- echo "<tr><td>Total</td><td>Dr " . $voucher_dr_total . "</td><td>Cr " . $voucher_cr_total . "</td></tr>";
+ echo "<tr class=\"tr-total\"><td class=\"total-name\">Total</td><td class=\"total-dr\">Dr " . $voucher_dr_total . "</td><td class=\"total-cr\">Cr " . $voucher_cr_total . "</td></tr>";
?>
</tbody>
</table>
+ <br />
<div id="print-voucher-narration">Narration : <span class="value"><?php echo $voucher_narration; ?></span></div>
+ <br />
+ <form>
+ <input class="hide-print" type="button" onClick="window.print()" value="Print voucher">
+ </form>
</body>
</html>
commit 88f5830960bb0a87e26b3b7c06007d076954ad73
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Tue Dec 14 12:14:10 2010 +0530
Voucher print now uses a separate view and css
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
diff --git a/system/application/assets/css/printvoucher.css b/system/application/assets/css/printvoucher.css
new file mode 100644
index 0000000..e69de29
diff --git a/system/application/controllers/voucher.php b/system/application/controllers/voucher.php
index 3023138..32e88c9 100644
--- a/system/application/controllers/voucher.php
+++ b/system/application/controllers/voucher.php
@@ -181,7 +181,7 @@ class Voucher extends Controller {
$html .= " " . anchor('voucher/delete/' . strtolower($html_voucher_type) . "/" . $row->id , img(array('src' => asset_url() . "images/icons/delete.png", 'border' => '0', 'alt' => 'Delete ' . ucfirst($html_voucher_type) . ' Voucher', 'class' => "confirmClick", 'title' => "Delete voucher")), array('title' => 'Delete ' . ucfirst($html_voucher_type) . ' Voucher')) . " ";
- $html .= " " . anchor_popup('voucher/printhtml/' . strtolower($html_voucher_type) . "/" . $row->id , img(array('src' => asset_url() . "images/icons/print.png", 'border' => '0', 'alt' => 'Print ' . ucfirst($html_voucher_type) . ' Voucher')), array('title' => 'Print ' . ucfirst($html_voucher_type) . ' Voucher')) . " ";
+ $html .= " " . anchor_popup('voucher/printview/' . strtolower($html_voucher_type) . "/" . $row->id , img(array('src' => asset_url() . "images/icons/print.png", 'border' => '0', 'alt' => 'Print ' . ucfirst($html_voucher_type) . ' Voucher')), array('title' => 'Print ' . ucfirst($html_voucher_type) . ' Voucher')) . " ";
$html .= " " . anchor_popup('voucher/email/' . strtolower($html_voucher_type) . "/" . $row->id , img(array('src' => asset_url() . "images/icons/email.png", 'border' => '0', 'alt' => 'Email ' . ucfirst($html_voucher_type) . ' Voucher')), array('title' => 'Email ' . ucfirst($html_voucher_type) . ' Voucher', 'width' => '500', 'height' => '300')) . "</td>";
@@ -762,7 +762,7 @@ class Voucher extends Controller {
return;
}
- function printhtml($voucher_type, $voucher_id)
+ function printview($voucher_type, $voucher_id)
{
$this->load->model('Setting_model');
$this->load->model('Ledger_model');
@@ -777,37 +777,38 @@ class Voucher extends Controller {
return;
}
- echo "<h3>" . ucfirst($voucher_type) . " Voucher</h3>";
- echo "<p><b>" . $account->name . "</b></p>";
- echo "<p>" . $account->address . "</p>";
- echo "<p>Voucher Number : " . $cur_voucher->number . "</p>";
- echo "<p>Voucher Date : " . date_mysql_to_php_display($cur_voucher->date) . "</p>";
- echo "<table border=1>";
- echo "<thead><tr><th>Ledger A/C</th><th>Dr Amount</th><th>Cr Amount</th></tr></thead>";
-
+ $data['voucher_type'] = $voucher_type;
+ $data['voucher_number'] = $cur_voucher->number;
+ $data['voucher_date'] = date_mysql_to_php_display($cur_voucher->date);
+ $data['voucher_dr_total'] = $cur_voucher->dr_total;
+ $data['voucher_cr_total'] = $cur_voucher->cr_total;
+ $data['voucher_narration'] = $cur_voucher->narration;
+ $data['voucher_draft'] = $cur_voucher->draft;
+
+ /* Getting Ledger details */
$ledger_q;
if ($voucher_type == "receipt" || $voucher_type == "contra")
$ledger_q = $this->db->query("SELECT * FROM voucher_items WHERE voucher_id = ? ORDER BY dc DESC", $voucher_id);
else
$ledger_q = $this->db->query("SELECT * FROM voucher_items WHERE voucher_id = ? ORDER BY dc ASC", $voucher_id);
-
- foreach ($ledger_q->result() as $row)
+
+ $counter = 0;
+ $data['ledger_data'] = array();
+ if ($ledger_q->num_rows() > 0)
{
- echo "<tr>";
- echo "<td>" . $this->Ledger_model->get_name($row->ledger_id) . "</td>";
- if ($row->dc == "D")
+ foreach ($ledger_q->result() as $row)
{
- echo "<td>" . $row->amount . "</td>";
- echo "<td>-</td>";
- } else {
- echo "<td>-</td>";
- echo "<td>" . $row->amount . "</td>";
+ $data['ledger_data'][$counter] = array(
+ 'id' => $row->ledger_id,
+ 'name' => $this->Ledger_model->get_name($row->ledger_id),
+ 'dc' => $row->dc,
+ 'amount' => $row->amount,
+ );
+ $counter++;
}
- echo "</tr>";
}
- echo "<tr><td><b>TOTAL</b></td><td><b>" . $cur_voucher->dr_total . "</b></td><td><b>" . $cur_voucher->cr_total . "</b></td></tr>";
- echo "</table>";
- echo "<p>" . "Narration : " . $cur_voucher->narration . "</p>";
+
+ $this->load->view('voucher/printview', $data);
return;
}
diff --git a/system/application/views/voucher/printview.php b/system/application/views/voucher/printview.php
new file mode 100644
index 0000000..8e827bf
--- /dev/null
+++ b/system/application/views/voucher/printview.php
@@ -0,0 +1,41 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+<title>Print - <?php echo ucfirst($voucher_type); ?> Voucher Number <?php echo $voucher_number; ?></title>
+<?php echo link_tag(asset_url() . 'images/favicon.ico', 'shortcut icon', 'image/ico'); ?>
+<link type="text/css" rel="stylesheet" href="<?php echo asset_url(); ?>css/printvoucher.css">
+</head>
+<body>
+ <div id="print-html-link"><a href="JavaScript:window.print();">Print HTML</a></div>
+ <div id="print-voucher-type"><span class="value"><?php echo ucfirst($voucher_type); ?> Voucher</span></div>
+ <div id="print-account-name"><span class="value"><?php echo $this->config->item('account_name'); ?></span></div>
+ <div id="print-account-address"><span class="value"><?php echo $this->config->item('account_address'); ?></span></div>
+ <div id="print-voucher-number">Voucher Number : <span class="value"><?php echo $voucher_number; ?></span></div>
+ <div id="print-voucher-number">Voucher Date : <span class="value"><?php echo $voucher_date; ?></span></div>
+ <table id="print-voucher-table">
+ <thead>
+ <tr><th>Ledger A/C</th><th>Dr Amount</th><th>Cr Amount</th></tr>
+ </thead>
+ <tbody>
+ <?php
+ foreach ($ledger_data as $id => $row)
+ {
+ echo "<tr>";
+ echo "<td>" . $row['name'] . "</td>";
+ if ($row['dc'] == "D")
+ {
+ echo "<td>Dr " . $row['amount'] . "</td>";
+ echo "<td></td>";
+ } else {
+ echo "<td></td>";
+ echo "<td>Cr " . $row['amount'] . "</td>";
+ }
+ echo "</tr>";
+ }
+ echo "<tr><td>Total</td><td>Dr " . $voucher_dr_total . "</td><td>Cr " . $voucher_cr_total . "</td></tr>";
+ ?>
+ </tbody>
+ </table>
+ <div id="print-voucher-narration">Narration : <span class="value"><?php echo $voucher_narration; ?></span></div>
+</body>
+</html>
diff --git a/system/application/views/voucher/view.php b/system/application/views/voucher/view.php
index 2857822..80c4f09 100644
--- a/system/application/views/voucher/view.php
+++ b/system/application/views/voucher/view.php
@@ -59,7 +59,7 @@ else
echo " | ";
echo anchor('voucher/delete/' . $voucher_type . "/" . $cur_voucher->id, 'Delete', array('class' => "confirmClick", 'title' => "Delete voucher", 'title' => 'Delete this ' . ucfirst($voucher_type) . ' Voucher'));
echo " | ";
- echo anchor_popup('voucher/printhtml/' . $voucher_type . "/" . $cur_voucher->id, 'Print', array('title' => 'Print this ' . ucfirst($voucher_type) . ' Voucher'));
+ echo anchor_popup('voucher/printview/' . $voucher_type . "/" . $cur_voucher->id, 'Print', array('title' => 'Print this ' . ucfirst($voucher_type) . ' Voucher'));
echo " | ";
echo anchor_popup('voucher/email/' . $voucher_type . "/" . $cur_voucher->id, 'Email', array('title' => 'Email this ' . ucfirst($voucher_type) . ' Voucher', 'width' => '400', 'height' => '200'));
commit 5a0728d5e77394fe4c9095839710ec98dc22864d
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Mon Dec 13 16:52:22 2010 +0530
Added new form element form_input_date_restrict
- Added it to voucher add and edit
- Restrict the date range within the financial year
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
diff --git a/system/application/helpers/MY_form_helper.php b/system/application/helpers/MY_form_helper.php
index 441f6c7..e3a7dc7 100644
--- a/system/application/helpers/MY_form_helper.php
+++ b/system/application/helpers/MY_form_helper.php
@@ -43,6 +43,16 @@ if ( ! function_exists('form_input_date'))
}
}
+if ( ! function_exists('form_input_date_restrict'))
+{
+ function form_input_date_restrict($data = '', $value = '', $extra = '')
+ {
+ $defaults = array('type' => 'text', 'name' => (( ! is_array($data)) ? $data : ''), 'value' => $value);
+
+ return "<input "._parse_form_attributes($data, $defaults).$extra." class=\"datepicker-restrict\"/>";
+ }
+}
+
if ( ! function_exists('form_input_ledger'))
{
function form_input_ledger($name, $selected = NULL, $extra = '')
diff --git a/system/application/views/template.php b/system/application/views/template.php
index 526b70a..2eb72b3 100644
--- a/system/application/views/template.php
+++ b/system/application/views/template.php
@@ -47,6 +47,11 @@ $(document).ready(function() {
extraWidth: 1
}).superfish(); // call supersubs first, then superfish, so that subs are
$('.datepicker').datepick({dateFormat: '<?php echo $this->config->item('account_date_format'); ?>'});
+ $('.datepicker-restrict').datepick({
+ dateFormat: '<?php echo $this->config->item('account_date_format'); ?>',
+ minDate: '<?php echo date_mysql_to_php($this->config->item('account_fy_start')); ?>',
+ maxDate: '<?php echo date_mysql_to_php($this->config->item('account_fy_end')); ?>',
+ });
});
</script>
diff --git a/system/application/views/voucher/add.php b/system/application/views/voucher/add.php
index c73c2bf..08fb5f8 100644
--- a/system/application/views/voucher/add.php
+++ b/system/application/views/voucher/add.php
@@ -191,7 +191,7 @@ $(document).ready(function() {
echo " ";
echo form_label('Voucher Date', 'voucher_date');
echo " ";
- echo form_input_date($voucher_date);
+ echo form_input_date_restrict($voucher_date);
echo "</p>";
echo "<table class=\"voucher-table\">";
diff --git a/system/application/views/voucher/edit.php b/system/application/views/voucher/edit.php
index 7022da2..0a9bd5f 100644
--- a/system/application/views/voucher/edit.php
+++ b/system/application/views/voucher/edit.php
@@ -191,7 +191,7 @@ $(document).ready(function() {
echo " ";
echo form_label('Voucher Date', 'voucher_date');
echo " ";
- echo form_input_date($voucher_date);
+ echo form_input_date_restrict($voucher_date);
echo "</p>";
echo "<table class=\"voucher-table\">";
commit 889952cae9a96754a6e2c5e820d7ee640d6b3cfc
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Mon Dec 13 16:27:21 2010 +0530
Styled Recent Activity list
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
diff --git a/system/application/assets/css/custom.css b/system/application/assets/css/custom.css
index cd39a29..bb634e0 100644
--- a/system/application/assets/css/custom.css
+++ b/system/application/assets/css/custom.css
@@ -33,6 +33,25 @@ a.anchor-link-b {
text-decoration:none;
}
+/* Fieldset */
+.fieldset-auto-width {
+ display:inline;
+ padding:20px;
+ padding-right:50px;
+}
+
+.fieldset-auto-width legend {
+ border: 1px solid #0099CC;
+ background:#E5F1F4;
+ padding:4px;
+}
+
+/* Form */
+.form-help-text {
+ font-size:12px;
+ font-weight:italic;
+}
+
/******************************** PAGINATION **********************************/
#pagination-container {
margin-top:20px;
@@ -95,39 +114,6 @@ ul#pagination-flickr {
border:solid 1px #666666;
}
-/* Fieldset */
-.fieldset-auto-width {
- display:inline;
- padding:20px;
- padding-right:50px;
-}
-
-.fieldset-auto-width legend {
- border: 1px solid #0099CC;
- background:#E5F1F4;
- padding:4px;
-}
-
-/* Tags */
-.tags {
- font-size:10px;
- font-weight:bold;
- text-decoration:none;
- margin:0 5px 0 1px;
- padding:3px;
- -moz-border-radius:5px;
- border-radius:5px;
-}
-
-.form-help-text {
- font-size:12px;
- font-weight:italic;
-}
-
-.tag-edit {
- float:right;
-}
-
/********************************* DASHBOARD **********************************/
#dashboard-summary {
@@ -217,3 +203,24 @@ ul#pagination-flickr {
color:#0000FF;
text-decoration:none;
}
+
+.tags {
+ font-size:10px;
+ font-weight:bold;
+ text-decoration:none;
+ margin:0 5px 0 1px;
+ padding:3px;
+ -moz-border-radius:5px;
+ border-radius:5px;
+}
+
+.tag-edit {
+ float:right;
+}
+
+/***************************** RECENT ACTIVITY ********************************/
+#recent-activity-list {
+ margin-left:30px;
+ padding:0px;
+ list-style-type:square;
+}
diff --git a/system/application/views/welcome_message.php b/system/application/views/welcome_message.php
index 4e92f7c..7c344fd 100644
--- a/system/application/views/welcome_message.php
+++ b/system/application/views/welcome_message.php
@@ -175,7 +175,7 @@ jQuery(document).ready(function () {
<?php
if ($logs)
{
- echo "<ul>";
+ echo "<ul id=\"recent-activity-list\">";
foreach ($logs->result() as $row)
{
echo "<li>" . $row->message_title . "</li>";
commit 941146b99d3fa0f85960538c749da658902100f9
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Mon Dec 13 16:17:47 2010 +0530
Cleaned up CSS inline styles
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
diff --git a/system/application/assets/css/admin-style.css b/system/application/assets/css/admin-style.css
index 2761156..8c7c565 100644
--- a/system/application/assets/css/admin-style.css
+++ b/system/application/assets/css/admin-style.css
@@ -110,11 +110,6 @@ body {
text-decoration:none;
}
-#content #main ul#main-links-nav li a:hover
-{
- color:#444444;
-}
-
/* MESSAGE BOX */
#message-box {
border:solid 1px #787878;
@@ -166,3 +161,8 @@ a.no-underline {
text-align:left;
}
+#admin-area {
+ font-size:18px;
+ color:#FF0000;
+}
+
diff --git a/system/application/assets/css/custom.css b/system/application/assets/css/custom.css
index 17211f1..cd39a29 100644
--- a/system/application/assets/css/custom.css
+++ b/system/application/assets/css/custom.css
@@ -24,8 +24,13 @@
color:#999999;
}
-.black-link {
+a.anchor-link-a {
+ color:#1A2745;
+}
+
+a.anchor-link-b {
color:#000000;
+ text-decoration:none;
}
/******************************** PAGINATION **********************************/
@@ -93,7 +98,8 @@ ul#pagination-flickr {
/* Fieldset */
.fieldset-auto-width {
display:inline;
- padding:10px;
+ padding:20px;
+ padding-right:50px;
}
.fieldset-auto-width legend {
@@ -118,6 +124,10 @@ ul#pagination-flickr {
font-weight:italic;
}
+.tag-edit {
+ float:right;
+}
+
/********************************* DASHBOARD **********************************/
#dashboard-summary {
diff --git a/system/application/assets/css/style.css b/system/application/assets/css/style.css
index da89225..7bf6cb8 100644
--- a/system/application/assets/css/style.css
+++ b/system/application/assets/css/style.css
@@ -157,4 +157,9 @@ a.no-underline {
text-decoration:none;
}
+/* NOT SO COMMON */
+#beta-area {
+ font-size:18px;
+ color:#00000;
+}
diff --git a/system/application/assets/css/tables.css b/system/application/assets/css/tables.css
index c0ba714..0e9a903 100644
--- a/system/application/assets/css/tables.css
+++ b/system/application/assets/css/tables.css
@@ -39,8 +39,8 @@
color:#FF0000;
}
-.simple-table a.blue-link {
- color:#1A2745;
+tr.total-area {
+ background-color: #F8F8F8;
}
/******************************************************************************/
diff --git a/system/application/controllers/voucher.php b/system/application/controllers/voucher.php
index 2f5eea7..3023138 100644
--- a/system/application/controllers/voucher.php
+++ b/system/application/controllers/voucher.php
@@ -158,15 +158,15 @@ class Voucher extends Controller {
$html .= "\">";
$html .= "<td>" . date_mysql_to_php_display($row->date) . "</td>";
- $html .= "<td>" . anchor('voucher/view/' . strtolower($html_voucher_type) . "/" . $row->id, $row->number, array('title' => 'View ' . ucfirst($html_voucher_type) . ' Voucher', 'class' => 'blue-link')) . "</td>";
+ $html .= "<td>" . anchor('voucher/view/' . strtolower($html_voucher_type) . "/" . $row->id, $row->number, array('title' => 'View ' . ucfirst($html_voucher_type) . ' Voucher', 'class' => 'anchor-link-a')) . "</td>";
$html .= "<td>";
$html .= $this->Tag_model->show_voucher_tag($row->tag_id);
if ($ledger)
if ($ledger_multiple)
- $html .= anchor('voucher/view/' . strtolower($html_voucher_type) . "/" . $row->id, "(" . $ledger->name . ")", array('title' => 'View ' . ucfirst($html_voucher_type) . ' Voucher', 'class' => 'blue-link'));
+ $html .= anchor('voucher/view/' . strtolower($html_voucher_type) . "/" . $row->id, "(" . $ledger->name . ")", array('title' => 'View ' . ucfirst($html_voucher_type) . ' Voucher', 'class' => 'anchor-link-a'));
else
- $html .= anchor('voucher/view/' . strtolower($html_voucher_type) . "/" . $row->id, $ledger->name, array('title' => 'View ' . ucfirst($html_voucher_type) . ' Voucher', 'class' => 'blue-link'));
+ $html .= anchor('voucher/view/' . strtolower($html_voucher_type) . "/" . $row->id, $ledger->name, array('title' => 'View ' . ucfirst($html_voucher_type) . ' Voucher', 'class' => 'anchor-link-a'));
$html .= "</td>";
$html .= "<td>" . ucfirst($html_voucher_type) . "</td>";
diff --git a/system/application/views/admin/create.php b/system/application/views/admin/create.php
index 86deaad..130c295 100644
--- a/system/application/views/admin/create.php
+++ b/system/application/views/admin/create.php
@@ -62,7 +62,7 @@
echo "</p>";
echo "<p>";
- echo form_fieldset('Database Settings', array('class' => "fieldset-auto-width", 'style' => "width:500px;"));
+ echo form_fieldset('Database Settings', array('class' => "fieldset-auto-width"));
echo "<p>";
echo form_checkbox('create_database', 1, $create_database) . " Create database if it does not exists";
diff --git a/system/application/views/admin_template.php b/system/application/views/admin_template.php
index 6d69061..ecaa4ab 100644
--- a/system/application/views/admin_template.php
+++ b/system/application/views/admin_template.php
@@ -33,10 +33,10 @@ $(document).ready(function(){
<div id="container">
<div id="header">
<div id="logo">
- Webzash <span style="font-size:18px;color:#FF0000;">Admin area</span>
+ Webzash <span id="admin-area">Admin area</span>
</div>
<div id="admin">
- <?php echo anchor('', 'Back to accounts', array('title' => "Back to accounts", 'style' => 'color:#000000; text-decoration:none')); ?>
+ <?php echo anchor('', 'Back to accounts', array('title' => "Back to accounts", 'class' => 'anchor-link-b')); ?>
</div>
<div id="info">
</div>
diff --git a/system/application/views/report/balancesheet.php b/system/application/views/report/balancesheet.php
index 174c803..daad730 100644
--- a/system/application/views/report/balancesheet.php
+++ b/system/application/views/report/balancesheet.php
@@ -42,7 +42,7 @@
$total = $liability_total;
- echo "<tr style=\"background-color:#F8F8F8;\">";
+ echo "<tr class=\"total-area\">";
echo "<td>";
echo "<table border=0 cellpadding=5 class=\"balance-sheet-total-table\" width=\"450\">";
echo "<tr valign=\"top\">";
diff --git a/system/application/views/report/ledgerst.php b/system/application/views/report/ledgerst.php
index 78054ab..0d5a15e 100644
--- a/system/application/views/report/ledgerst.php
+++ b/system/application/views/report/ledgerst.php
@@ -121,7 +121,7 @@
echo date_mysql_to_php_display($row->vdate);
echo "</td>";
echo "<td>";
- echo anchor('voucher/view/' . n_to_v($row->vtype) . '/' . $row->vid, $row->vnumber, array('title' => 'View ' . ' Voucher', 'style' => 'color:#000000'));
+ echo anchor('voucher/view/' . n_to_v($row->vtype) . '/' . $row->vid, $row->vnumber, array('title' => 'View ' . ' Voucher', 'class' => 'anchor-link-a'));
echo "</td>";
/* Getting opposite Ledger name */
@@ -135,9 +135,9 @@
$opp_ledger_name = $this->Ledger_model->get_name($opp_voucher_name_d->ledger_id);
if ($opp_voucher_name_q->num_rows() > 1)
{
- echo anchor('voucher/view/' . n_to_v($row->vtype) . '/' . $row->vid, "(" . $opp_ledger_name . ")", array('title' => 'View ' . ' Voucher', 'style' => 'color:#000000'));
+ echo anchor('voucher/view/' . n_to_v($row->vtype) . '/' . $row->vid, "(" . $opp_ledger_name . ")", array('title' => 'View ' . ' Voucher', 'class' => 'anchor-link-a'));
} else {
- echo anchor('voucher/view/' . n_to_v($row->vtype) . '/' . $row->vid, $opp_ledger_name, array('title' => 'View ' . ' Voucher', 'style' => 'color:#000000'));
+ echo anchor('voucher/view/' . n_to_v($row->vtype) . '/' . $row->vid, $opp_ledger_name, array('title' => 'View ' . ' Voucher', 'class' => 'anchor-link-a'));
}
}
} else {
@@ -147,9 +147,9 @@
$opp_ledger_name = $this->Ledger_model->get_name($opp_voucher_name_d->ledger_id);
if ($opp_voucher_name_q->num_rows() > 1)
{
- echo anchor('voucher/view/' . n_to_v($row->vtype) . '/' . $row->vid, "(" . $opp_ledger_name . ")", array('title' => 'View ' . ' Voucher', 'style' => 'color:#000000'));
+ echo anchor('voucher/view/' . n_to_v($row->vtype) . '/' . $row->vid, "(" . $opp_ledger_name . ")", array('title' => 'View ' . ' Voucher', 'class' => 'anchor-link-a'));
} else {
- echo anchor('voucher/view/' . n_to_v($row->vtype) . '/' . $row->vid, $opp_ledger_name, array('title' => 'View ' . ' Voucher', 'style' => 'color:#000000'));
+ echo anchor('voucher/view/' . n_to_v($row->vtype) . '/' . $row->vid, $opp_ledger_name, array('title' => 'View ' . ' Voucher', 'class' => 'anchor-link-a'));
}
}
diff --git a/system/application/views/report/profitandloss.php b/system/application/views/report/profitandloss.php
index c134b7d..f60d9e5 100644
--- a/system/application/views/report/profitandloss.php
+++ b/system/application/views/report/profitandloss.php
@@ -47,7 +47,7 @@
/* Showing Gross P/L : Expenses */
$grosstotal = $gross_expense_total;
- echo "<tr style=\"background-color:#F8F8F8;\">";
+ echo "<tr class=\"total-area\">";
echo "<td>";
echo "<table border=0 cellpadding=5 class=\"simple-table profit-loss-total-table\" width=\"450\">";
echo "<tr valign=\"top\">";
@@ -150,7 +150,7 @@
/* Showing Net P/L : Expenses */
$nettotal = $net_expense_total;
- echo "<tr style=\"background-color:#F8F8F8;\">";
+ echo "<tr class=\"total-area\">";
echo "<td>";
echo "<table border=0 cellpadding=5 class=\"simple-table profit-loss-total-table\" width=\"450\">";
echo "<tr valign=\"top\">";
diff --git a/system/application/views/report/trialbalance.php b/system/application/views/report/trialbalance.php
index e028a09..540e9bf 100644
--- a/system/application/views/report/trialbalance.php
+++ b/system/application/views/report/trialbalance.php
@@ -13,7 +13,7 @@
echo "<tr class=\"tr-" . $odd_even . "\">";
echo "<td>";
- echo anchor('report/ledgerst/' . $ledger_id, $ledger_name, array('title' => $ledger_name . ' Ledger Statement', 'style' => 'color:#000000'));
+ echo anchor('report/ledgerst/' . $ledger_id, $ledger_name, array('title' => $ledger_name . ' Ledger Statement', 'class' => 'anchor-link-a'));
echo "</td>";
echo "<td>";
diff --git a/system/application/views/setting/cf.php b/system/application/views/setting/cf.php
index 03b1c53..c04cd91 100644
--- a/system/application/views/setting/cf.php
+++ b/system/application/views/setting/cf.php
@@ -32,7 +32,7 @@
echo "</p>";
echo "<p>";
- echo form_fieldset('Database Settings', array('class' => "fieldset-auto-width", 'style' => "width:500px;"));
+ echo form_fieldset('Database Settings', array('class' => "fieldset-auto-width"));
echo "<p>";
echo form_checkbox('create_database', 1, $create_database) . " Create database if it does not exists";
diff --git a/system/application/views/sidebar/tag.php b/system/application/views/sidebar/tag.php
index 027af49..4ee56cf 100644
--- a/system/application/views/sidebar/tag.php
+++ b/system/application/views/sidebar/tag.php
@@ -1,5 +1,5 @@
<?php
-echo "<div class=\"tag-title\">Tags<span style=\"float:right;\">" . anchor("tag", "Edit") . "</span></div>";
+echo "<div class=\"tag-title\">Tags<span class=\"tag-edit\">" . anchor("tag", "Edit") . "</span></div>";
echo "<div class=\"tag-content\">";
$tags = $this->Tag_model->get_all_tags($allow_none = FALSE);
echo "<ul id=\"tag-list\">";
@@ -12,7 +12,7 @@ echo "<div class=\"tag-title\">Tags<span style=\"float:right;\">" . anchor("tag"
}
} else {
echo "<li>No tags defined</li>";
- echo "<li>" . anchor("tag/add", "Add one", array('title' => 'Add tag', 'class' => 'blue-link')) . "</li>";
+ echo "<li>" . anchor("tag/add", "Add one", array('title' => 'Add tag', 'class' => 'anchor-link-a')) . "</li>";
}
echo "</ul>";
echo "</div>";
diff --git a/system/application/views/template.php b/system/application/views/template.php
index 7e04a4c..526b70a 100644
--- a/system/application/views/template.php
+++ b/system/application/views/template.php
@@ -55,10 +55,10 @@ $(document).ready(function() {
<div id="container">
<div id="header">
<div id="logo">
- Webzash <span style="font-size:18px;color:#00000;">(beta)</span>
+ Webzash <span id="beta-area">(beta)</span>
</div>
<div id="admin">
- <?php echo anchor('admin', 'Administer', array('title' => "Administer", 'style' => 'color:#000000; text-decoration:none')); ?>
+ <?php echo anchor('admin', 'Administer', array('title' => "Administer", 'class' => 'anchor-link-b')); ?>
</div>
<div id="info">
<?php
diff --git a/system/application/views/welcome_message.php b/system/application/views/welcome_message.php
index b84efd1..4e92f7c 100644
--- a/system/application/views/welcome_message.php
+++ b/system/application/views/welcome_message.php
@@ -2,7 +2,7 @@
#income-expense-graph-header {
width: 200px;
text-align: center;
- padding-bottom:10px;
+ padding-bottom:30px;
}
#income-expense-graph-data {
width: 200px;
@@ -12,7 +12,7 @@
#asset-liability-graph-header {
width: 200px;
text-align: center;
- padding-bottom:10px;
+ padding-bottom:30px;
}
#asset-liability-graph-data {
width: 200px;
@@ -84,8 +84,16 @@ jQuery(document).ready(function () {
<div id="dashboard-welcome-back" class="dashboard-item">
<div class="dashboard-title">Account Summary</div>
<div class="dashboard-content">
- <div>Welcome back, <strong><?php echo $this->config->item('account_name');?> !</strong></div>
- <div id="dashboard-draft">You have <?php echo anchor("voucher/show/draft", $draft_count . " draft", array('class' => 'black-link')); ?> voucher(s)</div>
+ <table class="dashboard-summary-table">
+ <tbody>
+ <tr>
+ <td><div>Welcome back, <strong><?php echo $this->config->item('account_name');?> !</strong></div></td>
+ </tr>
+ <tr>
+ <td><div id="dashboard-draft">You have <?php echo anchor("voucher/show/draft", $draft_count . " draft", array('class' => 'anchor-link-a')); ?> voucher(s)</div></td>
+ </tr>
+ </tbody>
+ </table>
</div>
</div>
<div class="clear"></div>
@@ -142,7 +150,7 @@ jQuery(document).ready(function () {
<?php if ($show_income_expense) { ?>
<td width="300">
<div id="income-expense" class="graph">
- <div id="income-expense-graph-header"><h4>Incomes Vs Expenses</h4></div>
+ <div id="income-expense-graph-header"><strong>Incomes Vs Expenses</strong></div>
<div id="income-expense-graph-data"></div>
</div>
</td>
@@ -150,7 +158,7 @@ jQuery(document).ready(function () {
<?php if ($show_asset_liability) { ?>
<td width="300">
<div id="asset-liability" class="graph">
- <div id="asset-liability-graph-header"><h4>Assets Vs Liabilities</h4></div>
+ <div id="asset-liability-graph-header"><strong>Assets Vs Liabilities</strong></div>
<div id="asset-liability-graph-data""></div>
</div>
</td>
@@ -183,7 +191,7 @@ jQuery(document).ready(function () {
{
echo "<div class=\"dashboard-log-footer\">";
echo "<span>";
- echo anchor("", "more...", array('class' => 'blue-link no-underline'));
+ echo anchor("", "more...", array('class' => 'anchor-link-a no-underline'));
echo "</span>";
}
?>
commit 24b6da2cd529cec19b6fa39e0231613692c293bd
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Mon Dec 13 15:24:31 2010 +0530
Cleaned up CSS Font sizes
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
diff --git a/system/application/assets/css/admin-style.css b/system/application/assets/css/admin-style.css
index 44d5e45..2761156 100644
--- a/system/application/assets/css/admin-style.css
+++ b/system/application/assets/css/admin-style.css
@@ -24,14 +24,14 @@ body {
#header #logo {
padding:35px 0 0 18px;
- font-size:400%;
+ font-size:40px;
float:left;
width:70%;
}
#header #admin {
color:#000000;
- font-size:120%;
+ font-size:15px;
display:block;
position:absolute;
background:none repeat scroll 0 0 #E5F1F4;
@@ -54,18 +54,18 @@ body {
}
#content #main #main-title {
- font-size:150%;
+ font-size:19px;
padding:10px 0 10px 0;
}
#content #main #main-content {
padding:10px 0 10px 0;
- font-size:120%;
+ font-size:14px;
}
#footer {
color:#555555;
- font-size:100%;
+ font-size:13px;
margin:9px 20px 18px 20px;
text-align:center;
}
@@ -73,7 +73,7 @@ body {
#footer a {
color:#555555;
- font-size:100%;
+ font-size:13px;
text-align:center;
}
diff --git a/system/application/assets/css/custom.css b/system/application/assets/css/custom.css
index 0cc3e8f..17211f1 100644
--- a/system/application/assets/css/custom.css
+++ b/system/application/assets/css/custom.css
@@ -15,7 +15,7 @@
}
.settings-title a {
- font-size: 110%;
+ font-size:16px;
text-decoration:underline;
color:#000000;
}
diff --git a/system/application/assets/css/style.css b/system/application/assets/css/style.css
index 9a7fecb..da89225 100644
--- a/system/application/assets/css/style.css
+++ b/system/application/assets/css/style.css
@@ -1,7 +1,7 @@
body {
background:none repeat scroll 0 0 #DDDDDD;
color:#333333;
- font:12px/1.5em "Helvetica Neue","Lucida Grande","Helvetica Neue",Arial,sans-serif;
+ font:12px "Helvetica Neue","Lucida Grande","Helvetica Neue",Arial,sans-serif;
margin:0;
min-width:950px;
padding:0;
@@ -24,14 +24,14 @@ body {
#header #logo {
padding:35px 0 0 18px;
- font-size:400%;
+ font-size:40px;
float:left;
width:70%;
}
#header #admin {
color:#000000;
- font-size:120%;
+ font-size:15px;
display:block;
position:absolute;
background:none repeat scroll 0 0 #E5F1F4;
@@ -48,7 +48,7 @@ body {
top:10px;
background:none repeat scroll 0 0 #EEEEEE;
padding:10px;
- font-size:120%;
+ font-size:15px;
-moz-border-radius: 10px;
border-radius: 1px;
}
@@ -67,18 +67,18 @@ body {
}
#content #main #main-title {
- font-size:150%;
+ font-size:19px;
padding:10px 0 10px 0;
}
#content #main #main-content {
padding:10px 0 10px 0;
- font-size:120%;
+ font-size:14px;
}
#footer {
color:#555555;
- font-size:100%;
+ font-size:13px;
margin:9px 20px 18px 20px;
text-align:center;
}
@@ -86,7 +86,7 @@ body {
#footer a {
color:#555555;
- font-size:100%;
+ font-size:13px;
text-align:center;
}
diff --git a/system/application/assets/css/tables.css b/system/application/assets/css/tables.css
index 4e2251d..c0ba714 100644
--- a/system/application/assets/css/tables.css
+++ b/system/application/assets/css/tables.css
@@ -3,8 +3,7 @@
/******************************************************************************/
.simple-table {
- font-family:"Lucida Sans Unicode", "Lucida Grande", Sans-Serif;
- font-size:13px;
+ font-size:14px;
border-collapse:collapse;
text-align:left;
}
@@ -50,7 +49,7 @@
.voucher-table {
font-family:"Lucida Sans Unicode", "Lucida Grande", Sans-Serif;
- font-size:13px;
+ font-size:14px;
border-collapse:collapse;
text-align:left;
}
@@ -113,8 +112,7 @@
}
.balance-sheet-total-table {
- font-family:"Lucida Sans Unicode", "Lucida Grande", Sans-Serif;
- font-size:13px;
+ font-size:14px;
border-collapse:collapse;
text-align:left;
}
@@ -139,8 +137,7 @@
}
.profit-loss-total-table {
- font-family:"Lucida Sans Unicode", "Lucida Grande", Sans-Serif;
- font-size:13px;
+ font-size:14px;
border-collapse:collapse;
text-align:left;
}
@@ -191,8 +188,7 @@
}
.ledger-summary {
- font-family: "Lucida Sans Unicode", "Lucida Grande", Sans-Serif;
- font-size: 13px;
+ font-size:14px;
border-collapse: collapse;
text-align: left;
border: 1px solid #BBBBBB;
diff --git a/system/application/views/welcome_message.php b/system/application/views/welcome_message.php
index 00932f0..b84efd1 100644
--- a/system/application/views/welcome_message.php
+++ b/system/application/views/welcome_message.php
@@ -80,8 +80,6 @@ jQuery(document).ready(function () {
});
});
</script>
-
-<h3><This is beta software not meant for production use !></h3>
<div id="dashboard-summary">
<div id="dashboard-welcome-back" class="dashboard-item">
<div class="dashboard-title">Account Summary</div>
commit 849e292d81fafcb050453b2b5cea1f56d564076d
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Mon Dec 13 15:11:57 2010 +0530
Cleaned up CSS
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
diff --git a/system/application/assets/css/admin-style.css b/system/application/assets/css/admin-style.css
index a17a5e6..44d5e45 100644
--- a/system/application/assets/css/admin-style.css
+++ b/system/application/assets/css/admin-style.css
@@ -70,12 +70,6 @@ body {
text-align:center;
}
-#footer {
- color:#555555;
- font-size:100%;
- text-align:center;
-}
-
#footer a {
color:#555555;
@@ -121,15 +115,7 @@ body {
color:#444444;
}
-/* COMMON */
-.clear {
- clear:both;
-}
-
-.bold {
- font-weight:bold;
-}
-
+/* MESSAGE BOX */
#message-box {
border:solid 1px #787878;
background:#F0F0F0;
@@ -157,22 +143,20 @@ body {
text-align:left;
}
-/* NOT SO COMMON */
-.voucher-add-links {
- margin:0 0 10px 0;
+/* COMMON */
+.clear {
+ clear:both;
}
-.voucher-add-links a {
- text-decoration:underline;
- color:#000000;
- font-size:90%;
+.bold {
+ font-weight:bold;
}
-.voucher-add-links a:hover
-{
- color:#AAAAAA;
+a.no-underline {
+ text-decoration:none;
}
+/* NOT SO COMMON */
#current-active-account {
border:solid 1px #787878;
background:#F0F0F0;
@@ -181,3 +165,4 @@ body {
margin:0 0 10px 0;
text-align:left;
}
+
diff --git a/system/application/assets/css/custom.css b/system/application/assets/css/custom.css
index 7065075..0cc3e8f 100644
--- a/system/application/assets/css/custom.css
+++ b/system/application/assets/css/custom.css
@@ -28,17 +28,19 @@
color:#000000;
}
-/* Pagination */
+/******************************** PAGINATION **********************************/
#pagination-container {
margin-top:20px;
margin-bottom:50px;
}
+
ul#pagination-flickr {
border:0;
margin:0;
padding:0;
float:none;
}
+
#pagination-flickr li {
border:0;
margin:0;
@@ -46,10 +48,12 @@ ul#pagination-flickr {
font-size:11px;
list-style:none;
}
+
#pagination-flickr a {
border:solid 1px #DDDDDD;
margin-right:2px;
}
+
#pagination-flickr .previous-off,
#pagination-flickr .next-off {
color:#666666;
@@ -58,11 +62,13 @@ ul#pagination-flickr {
font-weight:bold;
padding:3px 4px;
}
+
#pagination-flickr .next a,
#pagination-flickr .previous a {
font-weight:bold;
border:solid 1px #FFFFFF;
}
+
#pagination-flickr .active{
color:#000000;
font-weight:bold;
@@ -70,6 +76,7 @@ ul#pagination-flickr {
float:left;
padding:4px 6px;
}
+
#pagination-flickr a:link,
#pagination-flickr a:visited {
color:#0063e3;
@@ -78,6 +85,7 @@ ul#pagination-flickr {
padding:3px 6px;
text-decoration:none;
}
+
#pagination-flickr a:hover{
border:solid 1px #666666;
}
diff --git a/system/application/assets/css/style.css b/system/application/assets/css/style.css
index b3cb2ff..9a7fecb 100644
--- a/system/application/assets/css/style.css
+++ b/system/application/assets/css/style.css
@@ -83,12 +83,6 @@ body {
text-align:center;
}
-#footer {
- color:#555555;
- font-size:100%;
- text-align:center;
-}
-
#footer a {
color:#555555;
@@ -122,15 +116,7 @@ body {
text-decoration:none;
}
-/* COMMON */
-.clear {
- clear:both;
-}
-
-.bold {
- font-weight:bold;
-}
-
+/* MESSAGE BOX */
#message-box {
border:solid 1px #787878;
background:#F0F0F0;
@@ -158,22 +144,17 @@ body {
text-align:left;
}
-/* NOT SO COMMON */
-.voucher-add-links {
- margin:0 0 10px 0;
-}
-
-.voucher-add-links a {
- text-decoration:underline;
- color:#000000;
- font-size:90%;
+/* COMMON */
+.clear {
+ clear:both;
}
-.voucher-add-links a:hover
-{
- color:#AAAAAA;
+.bold {
+ font-weight:bold;
}
a.no-underline {
text-decoration:none;
}
+
+
diff --git a/system/application/assets/css/tables.css b/system/application/assets/css/tables.css
index 4eebea6..4e2251d 100644
--- a/system/application/assets/css/tables.css
+++ b/system/application/assets/css/tables.css
@@ -1,50 +1,3 @@
-.generaltable th {
- background:none repeat scroll 0 0 #0099CC;
- color:#FFFFFF;
- font-weight:bold;
-}
-
-.generaltable tr:hover {
- background:none repeat scroll 0 0 #ECFBD4;
-}
-
-.generaltable .group-tr
-{
- background:none repeat scroll 0 0 #E5F1F4;
- padding:10px;
-}
-
-.generaltable .ledger-tr
-{
- background:none repeat scroll 0 0 #F8FBFC;
-}
-
-.generaltable tr.tr-odd {
- background:none repeat scroll 0 0 #E5F1F4;
-}
-
-.generaltable tr.tr-even {
- background:none repeat scroll 0 0 #F8FBFC;
-}
-
-.generaltable tr.tr-balance {
- background:none repeat scroll 0 0 #FFF8C6;
-}
-
-.generaltable tr.tr-draft {
- background:none repeat scroll 0 0 #DDDDDD;
-}
-
-.generaltable tr.new-row {
- background:none repeat scroll 0 0 #EEEEEE;
-}
-
-.vouchertable th {
- background:none repeat scroll 0 0 #0099CC;
- color:#FFFFFF;
- font-weight:bold;
-}
-
/******************************************************************************/
/******************************* SIMPLE TABLE *********************************/
/******************************************************************************/
commit 0940dc071ae723be4f6a418106efda3a4290b96a
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Mon Dec 13 10:32:37 2010 +0530
Added validation for voucher date within financial year
Voucher date cannot be more than end of current financial year
and cannot be less than start of current financial year
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
diff --git a/system/application/controllers/voucher.php b/system/application/controllers/voucher.php
index 717eaed..2f5eea7 100644
--- a/system/application/controllers/voucher.php
+++ b/system/application/controllers/voucher.php
@@ -294,7 +294,7 @@ class Voucher extends Controller {
/* Form validations */
$this->form_validation->set_rules('voucher_number', 'Voucher Number', 'trim|is_natural|uniquevoucherno[' . v_to_n($voucher_type) . ']');
- $this->form_validation->set_rules('voucher_date', 'Voucher Date', 'trim|required|is_date');
+ $this->form_validation->set_rules('voucher_date', 'Voucher Date', 'trim|required|is_date|is_date_within_range');
$this->form_validation->set_rules('voucher_narration', 'trim');
$this->form_validation->set_rules('voucher_tag', 'Tag', 'trim|is_natural');
@@ -566,7 +566,7 @@ class Voucher extends Controller {
/* Form validations */
$this->form_validation->set_rules('voucher_number', 'Voucher Number', 'trim|is_natural|uniquevouchernowithid[' . v_to_n($voucher_type) . '.' . $voucher_id . ']');
- $this->form_validation->set_rules('voucher_date', 'Voucher Date', 'trim|required|is_date');
+ $this->form_validation->set_rules('voucher_date', 'Voucher Date', 'trim|required|is_date|is_date_within_range');
$this->form_validation->set_rules('voucher_narration', 'trim');
$this->form_validation->set_rules('voucher_tag', 'Tag', 'trim|is_natural');
diff --git a/system/application/libraries/MY_Form_validation.php b/system/application/libraries/MY_Form_validation.php
index b06eef2..74a7f17 100644
--- a/system/application/libraries/MY_Form_validation.php
+++ b/system/application/libraries/MY_Form_validation.php
@@ -112,7 +112,27 @@ class MY_Form_validation extends CI_Form_validation {
$CI->messages->add('Invalid date format. Please check your account settings', 'error');
return "";
}
- return checkdate($m , $d, $y) ? TRUE : FALSE;
+ return checkdate($m, $d, $y) ? TRUE : FALSE;
+ }
+
+ function is_date_within_range($str)
+ {
+ $CI =& get_instance();
+ $cur_date = date_php_to_mysql($str);
+ $start_date = $CI->config->item('account_fy_start');
+ $end_date = $CI->config->item('account_fy_end');
+
+ if ($cur_date < $start_date)
+ {
+ $CI->form_validation->set_message('is_date_within_range', 'The %s is less than start of current financial year');
+ return FALSE;
+ } else if ($cur_date > $end_date)
+ {
+ $CI->form_validation->set_message('is_date_within_range', 'The %s is more than end of current financial year');
+ return FALSE;
+ } else {
+ return TRUE;
+ }
}
function is_hex($str)
commit ef7ecb8493e4a23985dbeb45d8262d336368a52d
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sun Dec 12 22:19:57 2010 +0530
Added id to Logger messages
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
diff --git a/system/application/controllers/tag.php b/system/application/controllers/tag.php
index 8ed90c1..9358a0d 100644
--- a/system/application/controllers/tag.php
+++ b/system/application/controllers/tag.php
@@ -170,13 +170,13 @@ class Tag extends Controller {
{
$this->db->trans_rollback();
$this->messages->add('Error updating ' . $data_tag_title . ' - Tag', 'error');
- $this->logger->write_message("error", "Error updating tag named " . $data_tag_title . " [" . $id . "]");
+ $this->logger->write_message("error", "Error updating tag named " . $data_tag_title . " [id:" . $id . "]");
$this->template->load('template', 'tag/edit', $data);
return;
} else {
$this->db->trans_complete();
$this->messages->add("Updated " . $data_tag_title . ' - Tag successfully', 'success');
- $this->logger->write_message("success", "Updated tag named " . $data_tag_title . " [" . $id . "]");
+ $this->logger->write_message("success", "Updated tag named " . $data_tag_title . " [id:" . $id . "]");
redirect('tag');
return;
}
@@ -210,7 +210,7 @@ class Tag extends Controller {
{
$this->db->trans_rollback();
$this->messages->add('Error removing Tags', 'error');
- $this->logger->write_message("error", "Error removing tag named " . $data_tag->title . " [" . $id . "] from vouchers");
+ $this->logger->write_message("error", "Error removing tag named " . $data_tag->title . " [id:" . $id . "] from vouchers");
redirect('tag');
return;
} else {
@@ -218,13 +218,13 @@ class Tag extends Controller {
{
$this->db->trans_rollback();
$this->messages->add('Error deleting Tag', 'error');
- $this->logger->write_message("error", "Error deleting tag named " . $data_tag->title . " [" . $id . "]");
+ $this->logger->write_message("error", "Error deleting tag named " . $data_tag->title . " [id:" . $id . "]");
redirect('tag');
return;
} else {
$this->db->trans_complete();
$this->messages->add('Tag deleted successfully', 'success');
- $this->logger->write_message("success", "Deleted tag named " . $data_tag->title . " [" . $id . "]");
+ $this->logger->write_message("success", "Deleted tag named " . $data_tag->title . " [id:" . $id . "]");
redirect('tag');
return;
}
diff --git a/system/application/controllers/voucher.php b/system/application/controllers/voucher.php
index 5d187aa..717eaed 100644
--- a/system/application/controllers/voucher.php
+++ b/system/application/controllers/voucher.php
@@ -439,7 +439,7 @@ class Voucher extends Controller {
{
$this->db->trans_rollback();
$this->messages->add('Error addding Ledger A/C ' . $data_ledger_id, 'error');
- $this->logger->write_message("error", "Error adding " . ucfirst($voucher_type) . " Voucher number " . $data_number . " since failed inserting voucher ledger items " . "[" . $data_ledger_id . "]");
+ $this->logger->write_message("error", "Error adding " . ucfirst($voucher_type) . " Voucher number " . $data_number . " since failed inserting voucher ledger items " . "[id:" . $data_ledger_id . "]");
$this->template->load('template', 'voucher/add', $data);
return;
}
@@ -659,7 +659,7 @@ class Voucher extends Controller {
{
$this->db->trans_rollback();
$this->messages->add('Error updating Voucher A/C', 'error');
- $this->logger->write_message("error", "Error updating voucher details for " . ucfirst($voucher_type) . " Voucher number " . $data_number . " [" . $voucher_id . "]");
+ $this->logger->write_message("error", "Error updating voucher details for " . ucfirst($voucher_type) . " Voucher number " . $data_number . " [id:" . $voucher_id . "]");
$this->template->load('template', 'voucher/edit', $data);
return;
}
@@ -669,7 +669,7 @@ class Voucher extends Controller {
{
$this->db->trans_rollback();
$this->messages->add('Error deleting old Ledger A/C\'s', 'error');
- $this->logger->write_message("error", "Error updating old voucher items for " . ucfirst($voucher_type) . " Voucher number " . $data_number . " [" . $voucher_id . "]");
+ $this->logger->write_message("error", "Error updating old voucher items for " . ucfirst($voucher_type) . " Voucher number " . $data_number . " [id:" . $voucher_id . "]");
$this->template->load('template', 'voucher/edit', $data);
return;
}
@@ -702,7 +702,7 @@ class Voucher extends Controller {
{
$this->db->trans_rollback();
$this->messages->add('Error updating Ledger A/C ' . $data_ledger_id, 'error');
- $this->logger->write_message("error", "Error updating new voucher item [" . $data_ledger_id . "] for " . ucfirst($voucher_type) . " Voucher number " . $data_number . " [" . $voucher_id . "]");
+ $this->logger->write_message("error", "Error updating new voucher item [id:" . $data_ledger_id . "] for " . ucfirst($voucher_type) . " Voucher number " . $data_number . " [id:" . $voucher_id . "]");
$this->template->load('template', 'voucher/edit', $data);
return;
}
@@ -713,7 +713,7 @@ class Voucher extends Controller {
{
$this->db->trans_rollback();
$this->messages->add('Error updating voucher total', 'error');
- $this->logger->write_message("error", "Error updating voucher total for " . ucfirst($voucher_type) . " Voucher number " . $data_number . " [" . $voucher_id . "]");
+ $this->logger->write_message("error", "Error updating voucher total for " . ucfirst($voucher_type) . " Voucher number " . $data_number . " [id:" . $voucher_id . "]");
$this->template->load('template', 'voucher/edit', $data);
return;
}
@@ -721,7 +721,7 @@ class Voucher extends Controller {
/* Success */
$this->db->trans_complete();
$this->messages->add(ucfirst($voucher_type) . ' Voucher number ' . $data_number . ' updated successfully', 'success');
- $this->logger->write_message("success", "Updated " . ucfirst($voucher_type) . " Voucher number " . $cur_voucher->number . " [" . $voucher_id . "]");
+ $this->logger->write_message("success", "Updated " . ucfirst($voucher_type) . " Voucher number " . $cur_voucher->number . " [id:" . $voucher_id . "]");
redirect('voucher/show/' . $voucher_type);
return;
}
@@ -743,7 +743,7 @@ class Voucher extends Controller {
{
$this->db->trans_rollback();
$this->messages->add('Error deleting Voucher - Ledgers entry', 'error');
- $this->logger->write_message("error", "Error deleting ledger entries for " . ucfirst($voucher_type) . " Voucher number " . $cur_voucher->number . " [" . $voucher_id . "]");
+ $this->logger->write_message("error", "Error deleting ledger entries for " . ucfirst($voucher_type) . " Voucher number " . $cur_voucher->number . " [id:" . $voucher_id . "]");
redirect('voucher/' . $voucher_type . '/' . $voucher_id);
return;
}
@@ -751,13 +751,13 @@ class Voucher extends Controller {
{
$this->db->trans_rollback();
$this->messages->add('Error deleting Voucher entry', 'error');
- $this->logger->write_message("error", "Error deleting voucher entry for " . ucfirst($voucher_type) . " Voucher number " . $cur_voucher->number . " [" . $voucher_id . "]");
+ $this->logger->write_message("error", "Error deleting voucher entry for " . ucfirst($voucher_type) . " Voucher number " . $cur_voucher->number . " [id:" . $voucher_id . "]");
redirect('voucher/' . $voucher_type . '/' . $voucher_id);
return;
}
$this->db->trans_complete();
$this->messages->add('Voucher deleted successfully', 'success');
- $this->logger->write_message("success", "Deleted " . ucfirst($voucher_type) . " Voucher number " . $cur_voucher->number . " [" . $voucher_id . "]");
+ $this->logger->write_message("success", "Deleted " . ucfirst($voucher_type) . " Voucher number " . $cur_voucher->number . " [id:" . $voucher_id . "]");
redirect('voucher/show/' . $voucher_type);
return;
}
@@ -907,10 +907,10 @@ class Voucher extends Controller {
if ($this->email->send())
{
$data['message'] = "Successfully sent email !";
- $this->logger->write_message("success", "Emailed " . ucfirst($voucher_type) . " Voucher number " . $cur_voucher->number . " [" . $voucher_id . "]");
+ $this->logger->write_message("success", "Emailed " . ucfirst($voucher_type) . " Voucher number " . $cur_voucher->number . " [id:" . $voucher_id . "]");
} else {
$data['error'] = "Error sending email. Please check you email settings";
- $this->logger->write_message("error", "Error emailing " . ucfirst($voucher_type) . " Voucher number " . $cur_voucher->number . " [" . $voucher_id . "]");
+ $this->logger->write_message("error", "Error emailing " . ucfirst($voucher_type) . " Voucher number " . $cur_voucher->number . " [id:" . $voucher_id . "]");
}
$this->load->view('voucher/email', $data);
return;
13 years, 4 months
16 commits - system/application
by pshah
system/application/assets/css/style.css | 8 +
system/application/assets/css/tables.css | 18 ++
system/application/config/autoload.php | 2
system/application/controllers/admin/carryforward.sql | 16 ++
system/application/controllers/admin/create.php | 26 +--
system/application/controllers/admin/database.sql | 16 ++
system/application/controllers/admin/welcome.php | 6
system/application/controllers/group.php | 21 ++-
system/application/controllers/ledger.php | 21 ++-
system/application/controllers/report.php | 4
system/application/controllers/setting.php | 118 +++++++++++-------
system/application/controllers/tag.php | 8 +
system/application/controllers/voucher.php | 14 ++
system/application/controllers/welcome.php | 18 ++
system/application/helpers/custom_helper.php | 22 +++
system/application/libraries/Accountlist.php | 25 +++
system/application/libraries/Logger.php | 51 +++++++
system/application/libraries/Startup.php | 6
system/application/views/admin/create.php | 12 -
system/application/views/admin/welcome.php | 6
system/application/views/setting/account.php | 8 -
system/application/views/setting/cf.php | 12 +
system/application/views/template.php | 9 -
system/application/views/welcome_message.php | 71 ++++++++--
24 files changed, 404 insertions(+), 114 deletions(-)
New commits:
commit 27bcdcf5b7514a395822d4cab80bda4379a8828a
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sun Dec 12 22:11:43 2010 +0530
Voucher updated to use the Logger library
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
diff --git a/system/application/controllers/voucher.php b/system/application/controllers/voucher.php
index d165dc4..5d187aa 100644
--- a/system/application/controllers/voucher.php
+++ b/system/application/controllers/voucher.php
@@ -404,6 +404,7 @@ class Voucher extends Controller {
{
$this->db->trans_rollback();
$this->messages->add('Error addding Voucher A/C', 'error');
+ $this->logger->write_message("error", "Error adding " . ucfirst($voucher_type) . " Voucher number " . $data_number . " since failed inserting voucher");
$this->template->load('template', 'voucher/add', $data);
return;
} else {
@@ -438,6 +439,7 @@ class Voucher extends Controller {
{
$this->db->trans_rollback();
$this->messages->add('Error addding Ledger A/C ' . $data_ledger_id, 'error');
+ $this->logger->write_message("error", "Error adding " . ucfirst($voucher_type) . " Voucher number " . $data_number . " since failed inserting voucher ledger items " . "[" . $data_ledger_id . "]");
$this->template->load('template', 'voucher/add', $data);
return;
}
@@ -448,6 +450,7 @@ class Voucher extends Controller {
{
$this->db->trans_rollback();
$this->messages->add('Error updating voucher total', 'error');
+ $this->logger->write_message("error", "Error adding " . ucfirst($voucher_type) . " Voucher number " . $data_number . " since failed updating debit and credit total");
$this->template->load('template', 'voucher/add', $data);
return;
}
@@ -455,6 +458,7 @@ class Voucher extends Controller {
/* Success */
$this->db->trans_complete();
$this->messages->add(ucfirst($voucher_type) . ' Voucher number ' . $data_number . ' added successfully', 'success');
+ $this->logger->write_message("success", "Added " . ucfirst($voucher_type) . " Voucher number " . $data_number);
redirect('voucher/show/' . $voucher_type);
$this->template->load('template', 'voucher/add', $data);
return;
@@ -655,6 +659,7 @@ class Voucher extends Controller {
{
$this->db->trans_rollback();
$this->messages->add('Error updating Voucher A/C', 'error');
+ $this->logger->write_message("error", "Error updating voucher details for " . ucfirst($voucher_type) . " Voucher number " . $data_number . " [" . $voucher_id . "]");
$this->template->load('template', 'voucher/edit', $data);
return;
}
@@ -664,6 +669,7 @@ class Voucher extends Controller {
{
$this->db->trans_rollback();
$this->messages->add('Error deleting old Ledger A/C\'s', 'error');
+ $this->logger->write_message("error", "Error updating old voucher items for " . ucfirst($voucher_type) . " Voucher number " . $data_number . " [" . $voucher_id . "]");
$this->template->load('template', 'voucher/edit', $data);
return;
}
@@ -696,6 +702,7 @@ class Voucher extends Controller {
{
$this->db->trans_rollback();
$this->messages->add('Error updating Ledger A/C ' . $data_ledger_id, 'error');
+ $this->logger->write_message("error", "Error updating new voucher item [" . $data_ledger_id . "] for " . ucfirst($voucher_type) . " Voucher number " . $data_number . " [" . $voucher_id . "]");
$this->template->load('template', 'voucher/edit', $data);
return;
}
@@ -706,6 +713,7 @@ class Voucher extends Controller {
{
$this->db->trans_rollback();
$this->messages->add('Error updating voucher total', 'error');
+ $this->logger->write_message("error", "Error updating voucher total for " . ucfirst($voucher_type) . " Voucher number " . $data_number . " [" . $voucher_id . "]");
$this->template->load('template', 'voucher/edit', $data);
return;
}
@@ -713,6 +721,7 @@ class Voucher extends Controller {
/* Success */
$this->db->trans_complete();
$this->messages->add(ucfirst($voucher_type) . ' Voucher number ' . $data_number . ' updated successfully', 'success');
+ $this->logger->write_message("success", "Updated " . ucfirst($voucher_type) . " Voucher number " . $cur_voucher->number . " [" . $voucher_id . "]");
redirect('voucher/show/' . $voucher_type);
return;
}
@@ -734,6 +743,7 @@ class Voucher extends Controller {
{
$this->db->trans_rollback();
$this->messages->add('Error deleting Voucher - Ledgers entry', 'error');
+ $this->logger->write_message("error", "Error deleting ledger entries for " . ucfirst($voucher_type) . " Voucher number " . $cur_voucher->number . " [" . $voucher_id . "]");
redirect('voucher/' . $voucher_type . '/' . $voucher_id);
return;
}
@@ -741,11 +751,13 @@ class Voucher extends Controller {
{
$this->db->trans_rollback();
$this->messages->add('Error deleting Voucher entry', 'error');
+ $this->logger->write_message("error", "Error deleting voucher entry for " . ucfirst($voucher_type) . " Voucher number " . $cur_voucher->number . " [" . $voucher_id . "]");
redirect('voucher/' . $voucher_type . '/' . $voucher_id);
return;
}
$this->db->trans_complete();
$this->messages->add('Voucher deleted successfully', 'success');
+ $this->logger->write_message("success", "Deleted " . ucfirst($voucher_type) . " Voucher number " . $cur_voucher->number . " [" . $voucher_id . "]");
redirect('voucher/show/' . $voucher_type);
return;
}
@@ -895,8 +907,10 @@ class Voucher extends Controller {
if ($this->email->send())
{
$data['message'] = "Successfully sent email !";
+ $this->logger->write_message("success", "Emailed " . ucfirst($voucher_type) . " Voucher number " . $cur_voucher->number . " [" . $voucher_id . "]");
} else {
$data['error'] = "Error sending email. Please check you email settings";
+ $this->logger->write_message("error", "Error emailing " . ucfirst($voucher_type) . " Voucher number " . $cur_voucher->number . " [" . $voucher_id . "]");
}
$this->load->view('voucher/email', $data);
return;
commit 8012b8a7dd3e84d023dead8ba44200ce19ca2aee
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sun Dec 12 19:26:18 2010 +0530
Show dashboard log footer only if there is some activity
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
diff --git a/system/application/views/welcome_message.php b/system/application/views/welcome_message.php
index 5a22d98..00932f0 100644
--- a/system/application/views/welcome_message.php
+++ b/system/application/views/welcome_message.php
@@ -180,15 +180,15 @@ jQuery(document).ready(function () {
}
?>
</div>
- <div class="dashboard-log-footer">
- <?php
+ <?php
if ($logs)
{
+ echo "<div class=\"dashboard-log-footer\">";
echo "<span>";
echo anchor("", "more...", array('class' => 'blue-link no-underline'));
echo "</span>";
}
- ?>
+ ?>
</div>
</div>
</div>
commit debe0465affd1d198842e6f0a97d26c0f5bc3486
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sun Dec 12 19:21:23 2010 +0530
Updated log table to logs which is more inline with the app
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
diff --git a/system/application/controllers/admin/carryforward.sql b/system/application/controllers/admin/carryforward.sql
index d1a7d72..4df5623 100644
--- a/system/application/controllers/admin/carryforward.sql
+++ b/system/application/controllers/admin/carryforward.sql
@@ -80,7 +80,7 @@ CREATE TABLE IF NOT EXISTS tags (
PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1;
-CREATE TABLE IF NOT EXISTS log (
+CREATE TABLE IF NOT EXISTS logs (
id int(11) NOT NULL AUTO_INCREMENT,
date datetime NOT NULL,
level int(1) NOT NULL,
diff --git a/system/application/controllers/admin/database.sql b/system/application/controllers/admin/database.sql
index ab56ff7..b474c21 100644
--- a/system/application/controllers/admin/database.sql
+++ b/system/application/controllers/admin/database.sql
@@ -80,7 +80,7 @@ CREATE TABLE IF NOT EXISTS tags (
PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1;
-CREATE TABLE IF NOT EXISTS log (
+CREATE TABLE IF NOT EXISTS logs (
id int(11) NOT NULL AUTO_INCREMENT,
date datetime NOT NULL,
level int(1) NOT NULL,
diff --git a/system/application/controllers/admin/welcome.php b/system/application/controllers/admin/welcome.php
index 6698999..59112b1 100644
--- a/system/application/controllers/admin/welcome.php
+++ b/system/application/controllers/admin/welcome.php
@@ -98,7 +98,7 @@ class Welcome extends Controller {
{
$valid_webzash_db = TRUE;
/* Check for valid webzash database */
- $table_names = array('settings', 'groups', 'ledgers', 'vouchers', 'voucher_items', 'tags', 'log');
+ $table_names = array('settings', 'groups', 'ledgers', 'vouchers', 'voucher_items', 'tags', 'logs');
foreach ($table_names as $id => $tbname)
{
$valid_db_q = mysql_query('DESC ' . $tbname);
diff --git a/system/application/controllers/welcome.php b/system/application/controllers/welcome.php
index d836f46..846c096 100644
--- a/system/application/controllers/welcome.php
+++ b/system/application/controllers/welcome.php
@@ -62,7 +62,7 @@ class Welcome extends Controller {
$data['show_income_expense'] = FALSE;
/* Getting Log Messages */
- $data['log'] = $this->logger->read_recent_messages();
+ $data['logs'] = $this->logger->read_recent_messages();
$this->template->load('template', 'welcome_message', $data);
return;
}
diff --git a/system/application/libraries/Logger.php b/system/application/libraries/Logger.php
index 27dcae0..4a980c5 100644
--- a/system/application/libraries/Logger.php
+++ b/system/application/libraries/Logger.php
@@ -33,16 +33,16 @@ class Logger
$data['user_agent'] = $CI->input->user_agent();
$data['message_title'] = $title;
$data['message_desc'] = $desc;
- $CI->db->insert('log', $data);
+ $CI->db->insert('logs', $data);
}
function read_recent_messages()
{
$CI =& get_instance();
- $log_q = $CI->db->query("SELECT * FROM log ORDER BY id DESC LIMIT 20");
- if ($log_q->num_rows() > 0)
+ $logs_q = $CI->db->query("SELECT * FROM logs ORDER BY id DESC LIMIT 20");
+ if ($logs_q->num_rows() > 0)
{
- return $log_q;
+ return $logs_q;
} else {
return FALSE;
}
diff --git a/system/application/libraries/Startup.php b/system/application/libraries/Startup.php
index 80152bb..43bb741 100644
--- a/system/application/libraries/Startup.php
+++ b/system/application/libraries/Startup.php
@@ -102,7 +102,7 @@ class Startup
if ($CI->db->query("SHOW TABLES"))
{
/* Check for valid webzash database */
- $table_names = array('settings', 'groups', 'ledgers', 'vouchers', 'voucher_items', 'tags', 'log');
+ $table_names = array('settings', 'groups', 'ledgers', 'vouchers', 'voucher_items', 'tags', 'logs');
foreach ($table_names as $id => $tbname)
{
$valid_db_q = mysql_query('DESC ' . $tbname);
diff --git a/system/application/views/welcome_message.php b/system/application/views/welcome_message.php
index 22ed4ad..5a22d98 100644
--- a/system/application/views/welcome_message.php
+++ b/system/application/views/welcome_message.php
@@ -167,10 +167,10 @@ jQuery(document).ready(function () {
<div class="dashboard-log-title">Recent Activity</div>
<div class="dashboard-log-content">
<?php
- if ($log)
+ if ($logs)
{
echo "<ul>";
- foreach ($log->result() as $row)
+ foreach ($logs->result() as $row)
{
echo "<li>" . $row->message_title . "</li>";
}
@@ -182,7 +182,7 @@ jQuery(document).ready(function () {
</div>
<div class="dashboard-log-footer">
<?php
- if ($log)
+ if ($logs)
{
echo "<span>";
echo anchor("", "more...", array('class' => 'blue-link no-underline'));
commit 5f7089095cb11725537df8a223f96eede109dd74
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sun Dec 12 19:15:10 2010 +0530
Tags updated to use the Logger library
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
diff --git a/system/application/controllers/tag.php b/system/application/controllers/tag.php
index 66054c7..8ed90c1 100644
--- a/system/application/controllers/tag.php
+++ b/system/application/controllers/tag.php
@@ -76,11 +76,13 @@ class Tag extends Controller {
{
$this->db->trans_rollback();
$this->messages->add('Error addding ' . $data_tag_title . ' - Tag', 'error');
+ $this->logger->write_message("error", "Error adding tag named " . $data_tag_title);
$this->template->load('template', 'tag/add', $data);
return;
} else {
$this->db->trans_complete();
$this->messages->add("Added " . $data_tag_title . ' - Tag successfully', 'success');
+ $this->logger->write_message("success", "Added tag named " . $data_tag_title);
redirect('tag');
return;
}
@@ -168,11 +170,13 @@ class Tag extends Controller {
{
$this->db->trans_rollback();
$this->messages->add('Error updating ' . $data_tag_title . ' - Tag', 'error');
+ $this->logger->write_message("error", "Error updating tag named " . $data_tag_title . " [" . $id . "]");
$this->template->load('template', 'tag/edit', $data);
return;
} else {
$this->db->trans_complete();
$this->messages->add("Updated " . $data_tag_title . ' - Tag successfully', 'success');
+ $this->logger->write_message("success", "Updated tag named " . $data_tag_title . " [" . $id . "]");
redirect('tag');
return;
}
@@ -198,6 +202,7 @@ class Tag extends Controller {
redirect('tag');
return;
}
+ $data_tag = $data_valid_q->row();
/* Deleting Tag */
$this->db->trans_start();
@@ -205,6 +210,7 @@ class Tag extends Controller {
{
$this->db->trans_rollback();
$this->messages->add('Error removing Tags', 'error');
+ $this->logger->write_message("error", "Error removing tag named " . $data_tag->title . " [" . $id . "] from vouchers");
redirect('tag');
return;
} else {
@@ -212,11 +218,13 @@ class Tag extends Controller {
{
$this->db->trans_rollback();
$this->messages->add('Error deleting Tag', 'error');
+ $this->logger->write_message("error", "Error deleting tag named " . $data_tag->title . " [" . $id . "]");
redirect('tag');
return;
} else {
$this->db->trans_complete();
$this->messages->add('Tag deleted successfully', 'success');
+ $this->logger->write_message("success", "Deleted tag named " . $data_tag->title . " [" . $id . "]");
redirect('tag');
return;
}
commit 094069c3e684e610f87914d9729800cc2bcca53c
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sun Dec 12 19:07:30 2010 +0530
Settings updated to use the Logger library
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
diff --git a/system/application/controllers/setting.php b/system/application/controllers/setting.php
index 114fecf..e2c4f29 100644
--- a/system/application/controllers/setting.php
+++ b/system/application/controllers/setting.php
@@ -118,17 +118,21 @@ class Setting extends Controller {
$data_account_timezone = $this->input->post('timezones', TRUE);
/* Update settings */
+ $this->db->trans_start();
if ( ! $this->db->query("UPDATE settings SET name = ?, address = ?, email = ?, currency_symbol = ?, date_format = ?, timezone = ? WHERE id = 1", array($data_account_name, $data_account_address, $data_account_email, $data_account_currency, $data_account_date, $data_account_timezone)))
{
+ $this->db->trans_rollback();
$this->messages->add('Error updating settings', 'error');
+ $this->logger->write_message("error", "Error updating account settings");
$this->template->load('template', 'setting/account', $data);
return;
+ } else {
+ $this->db->trans_complete();
+ $this->messages->add('Settings updated successfully', 'success');
+ $this->logger->write_message("success", "Updated account settings");
+ redirect('setting');
+ return;
}
-
- /* Success */
- $this->messages->add('Settings updated successfully', 'success');
- redirect('setting');
- return;
}
return;
}
@@ -521,17 +525,21 @@ class Setting extends Controller {
$data_email_password = $account_data->email_password;
/* Update settings */
+ $this->db->trans_start();
if ( ! $this->db->query("UPDATE settings SET email_protocol = ?, email_host = ?, email_port = ?, email_username = ?, email_password = ? WHERE id = 1", array($data_email_protocol, $data_email_host, $data_email_port, $data_email_username, $data_email_password)))
{
+ $this->db->trans_rollback();
$this->messages->add('Error updating settings', 'error');
+ $this->logger->write_message("error", "Error updating email settings");
$this->template->load('template', 'setting/email', $data);
return;
+ } else {
+ $this->db->trans_complete();
+ $this->messages->add('Email settings updated successfully', 'success');
+ $this->logger->write_message("success", "Updated email settings");
+ redirect('setting');
+ return;
}
-
- /* Success */
- $this->messages->add('Email settings updated successfully', 'success');
- redirect('setting');
- return;
}
return;
}
@@ -731,17 +739,21 @@ class Setting extends Controller {
}
/* Update settings */
+ $this->db->trans_start();
if ( ! $this->db->query("UPDATE settings SET print_paper_height = ?, print_paper_width = ?, print_margin_top = ?, print_margin_bottom = ?, print_margin_left = ?, print_margin_right = ?, print_orientation = ?, print_page_format = ?, print_page_layout = ?, print_logo = ? WHERE id = 1", array($data_paper_height, $data_paper_width, $data_margin_top, $data_margin_bottom, $data_margin_left, $data_margin_right, $data_orientation, $data_output_format, $data_page_layout, $data_logo)))
{
+ $this->db->trans_rollback();
$this->messages->add('Error updating printer settings', 'error');
+ $this->logger->write_message("error", "Error updating printer settings");
$this->template->load('template', 'setting/printer');
return;
+ } else {
+ $this->db->trans_complete();
+ $this->messages->add('Printer settings updated successfully', 'success');
+ $this->logger->write_message("success", "Updated printer settings");
+ redirect('setting');
+ return;
}
-
- /* Success */
- $this->messages->add('Printer settings updated successfully', 'success');
- redirect('setting');
- return;
}
return;
}
@@ -765,6 +777,7 @@ class Setting extends Controller {
/* Send the file to your desktop */
force_download($backup_filename, $backup_data);
+ $this->logger->write_message("success", "Downloaded account backup");
redirect('setting');
return;
}
commit 4ebb2683e3ced5ed837b309eda17524bbfde4ef1
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sun Dec 12 15:56:28 2010 +0530
Added Logger messages to Ledgers
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
diff --git a/system/application/controllers/ledger.php b/system/application/controllers/ledger.php
index dd77f9e..a763725 100644
--- a/system/application/controllers/ledger.php
+++ b/system/application/controllers/ledger.php
@@ -88,11 +88,13 @@ class Ledger extends Controller {
{
$this->db->trans_rollback();
$this->messages->add('Error addding ' . $data_name . ' - Ledger A/C', 'error');
+ $this->logger->write_message("error", "Error adding Ledger A/C named " . $data_name);
$this->template->load('template', 'group/add', $data);
return;
} else {
$this->db->trans_complete();
$this->messages->add($data_name . ' - Ledger A/C added successfully', 'success');
+ $this->logger->write_message("success", "Added Ledger A/C named " . $data_name);
redirect('account');
return;
}
@@ -197,11 +199,13 @@ class Ledger extends Controller {
{
$this->db->trans_rollback();
$this->messages->add('Error updating ' . $data_name . ' - Ledger A/C', 'error');
+ $this->logger->write_message("error", "Error updating Ledger A/C named " . $data_name . " [id:" . $data_id . "]");
$this->template->load('template', 'ledger/edit', $data);
return;
} else {
$this->db->trans_complete();
$this->messages->add($data_name . ' - Ledger A/C updated successfully', 'success');
+ $this->logger->write_message("success", "Updated Ledger A/C named " . $data_name . " [id:" . $data_id . "]");
redirect('account');
return;
}
@@ -228,17 +232,30 @@ class Ledger extends Controller {
return;
}
+ /* Get the ledger details */
+ $ledger_q = $this->db->query("SELECT * FROM ledgers WHERE id = ?", array($id));
+ if ($ledger_q->num_rows() < 1)
+ {
+ $this->messages->add('Invalid Ledger A/C', 'error');
+ redirect('account');
+ return;
+ } else {
+ $ledger_data = $ledger_q->row();
+ }
+
/* Deleting ledger */
$this->db->trans_start();
if ( ! $this->db->query("DELETE FROM ledgers WHERE id = ?", array($id)))
{
$this->db->trans_rollback();
- $this->messages->add('Error deleting Ledger A/C', 'error');
+ $this->messages->add("Error deleting " . $ledger_data->name . " - Ledger A/C", 'error');
+ $this->logger->write_message("error", "Error deleting Ledger A/C named " . $ledger_data->name . " [id:" . $id . "]");
redirect('account');
return;
} else {
$this->db->trans_complete();
- $this->messages->add('Ledger A/C deleted successfully', 'success');
+ $this->messages->add($ledger_data->name . " - Ledger A/C deleted successfully", 'success');
+ $this->logger->write_message("success", "Deleted Ledger A/C named " . $ledger_data->name . " [id:" . $id . "]");
redirect('account');
return;
}
commit 63b1a41765ee286ba15cc231baec3ccdbddb8ae8
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sun Dec 12 15:40:15 2010 +0530
Added Recent Activity footer
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
diff --git a/system/application/assets/css/style.css b/system/application/assets/css/style.css
index 6ebbf53..b3cb2ff 100644
--- a/system/application/assets/css/style.css
+++ b/system/application/assets/css/style.css
@@ -173,3 +173,7 @@ body {
{
color:#AAAAAA;
}
+
+a.no-underline {
+ text-decoration:none;
+}
diff --git a/system/application/assets/css/tables.css b/system/application/assets/css/tables.css
index a6cda32..4eebea6 100644
--- a/system/application/assets/css/tables.css
+++ b/system/application/assets/css/tables.css
@@ -224,6 +224,11 @@
color: #000000;
}
+.dashboard-log-footer {
+ padding:10px;
+ border-top:1px solid #BBBBBB;
+}
+
.ledgerst-table td {
}
diff --git a/system/application/libraries/Logger.php b/system/application/libraries/Logger.php
index d3fc424..27dcae0 100644
--- a/system/application/libraries/Logger.php
+++ b/system/application/libraries/Logger.php
@@ -36,7 +36,7 @@ class Logger
$CI->db->insert('log', $data);
}
- function read_recent_messages($count = 20)
+ function read_recent_messages()
{
$CI =& get_instance();
$log_q = $CI->db->query("SELECT * FROM log ORDER BY id DESC LIMIT 20");
diff --git a/system/application/views/welcome_message.php b/system/application/views/welcome_message.php
index 46a1417..22ed4ad 100644
--- a/system/application/views/welcome_message.php
+++ b/system/application/views/welcome_message.php
@@ -180,6 +180,16 @@ jQuery(document).ready(function () {
}
?>
</div>
+ <div class="dashboard-log-footer">
+ <?php
+ if ($log)
+ {
+ echo "<span>";
+ echo anchor("", "more...", array('class' => 'blue-link no-underline'));
+ echo "</span>";
+ }
+ ?>
+ </div>
</div>
</div>
<div class="clear"></div>
commit a20619657936f1748e2bf739b861b32629edc255
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sun Dec 12 15:27:34 2010 +0530
Added recent activity from Logger to Dashboard
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
diff --git a/system/application/controllers/welcome.php b/system/application/controllers/welcome.php
index 9aad75a..d836f46 100644
--- a/system/application/controllers/welcome.php
+++ b/system/application/controllers/welcome.php
@@ -35,7 +35,7 @@ class Welcome extends Controller {
} else {
$data['bank_cash_account'] = array();
}
-
+
/* Calculating total of Assets, Liabilities, Incomes, Expenses */
$asset = new Accountlist();
$asset->init(1);
@@ -61,6 +61,8 @@ class Welcome extends Controller {
if ($data['income_total'] == 0 && $data['expense_total'] == 0)
$data['show_income_expense'] = FALSE;
+ /* Getting Log Messages */
+ $data['log'] = $this->logger->read_recent_messages();
$this->template->load('template', 'welcome_message', $data);
return;
}
diff --git a/system/application/libraries/Logger.php b/system/application/libraries/Logger.php
index 407b117..d3fc424 100644
--- a/system/application/libraries/Logger.php
+++ b/system/application/libraries/Logger.php
@@ -19,6 +19,7 @@ class Logger
{
$CI =& get_instance();
$data['date'] = date("Y-m-d H:i:s");
+ $data['level'] = 3;
switch ($level)
{
case "error": $data['level'] = 0; break;
@@ -34,5 +35,17 @@ class Logger
$data['message_desc'] = $desc;
$CI->db->insert('log', $data);
}
+
+ function read_recent_messages($count = 20)
+ {
+ $CI =& get_instance();
+ $log_q = $CI->db->query("SELECT * FROM log ORDER BY id DESC LIMIT 20");
+ if ($log_q->num_rows() > 0)
+ {
+ return $log_q;
+ } else {
+ return FALSE;
+ }
+ }
}
diff --git a/system/application/views/welcome_message.php b/system/application/views/welcome_message.php
index 2813435..46a1417 100644
--- a/system/application/views/welcome_message.php
+++ b/system/application/views/welcome_message.php
@@ -166,7 +166,19 @@ jQuery(document).ready(function () {
<div id="dashboard-recent-log" class="dashboard-log-item">
<div class="dashboard-log-title">Recent Activity</div>
<div class="dashboard-log-content">
- Hello World !
+ <?php
+ if ($log)
+ {
+ echo "<ul>";
+ foreach ($log->result() as $row)
+ {
+ echo "<li>" . $row->message_title . "</li>";
+ }
+ echo "</ul>";
+ } else {
+ echo "No Recent Activity";
+ }
+ ?>
</div>
</div>
</div>
commit 00c3b6bb9a86162fd447ac0190f5c94c2fb6cebc
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sun Dec 12 15:09:20 2010 +0530
Added "success" level to Logger
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
diff --git a/system/application/libraries/Logger.php b/system/application/libraries/Logger.php
index 8e217f3..407b117 100644
--- a/system/application/libraries/Logger.php
+++ b/system/application/libraries/Logger.php
@@ -11,8 +11,9 @@ class Logger
* Write message to database log
* Levels defined are :
* 0 - error
- * 1 - info
- * 2 - debug
+ * 1 - success
+ * 2 - info
+ * 3 - debug
*/
function write_message($level = "debug", $title = "", $desc = "")
{
@@ -21,8 +22,9 @@ class Logger
switch ($level)
{
case "error": $data['level'] = 0; break;
- case "info": $data['level'] = 1; break;
- case "debug": $data['level'] = 2; break;
+ case "success": $data['level'] = 1; break;
+ case "info": $data['level'] = 2; break;
+ case "debug": $data['level'] = 3; break;
default: $data['level'] = 0; break;
}
$data['host_ip'] = $CI->input->ip_address();
commit e6ec9e78e166d83fe05bf4fd8466c4ded4b3e731
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sun Dec 12 15:08:05 2010 +0530
Added Logger messages to Groups
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
diff --git a/system/application/controllers/group.php b/system/application/controllers/group.php
index 6659a05..390a19b 100644
--- a/system/application/controllers/group.php
+++ b/system/application/controllers/group.php
@@ -72,11 +72,13 @@ class Group extends Controller {
{
$this->db->trans_rollback();
$this->messages->add('Error addding ' . $data_name . ' - Group A/C', 'error');
+ $this->logger->write_message("error", "Error adding Group A/C named " . $data_name);
$this->template->load('template', 'group/add', $data);
return;
} else {
$this->db->trans_complete();
$this->messages->add($data_name . ' - Group A/C added successfully', 'success');
+ $this->logger->write_message("success", "Added Group A/C named " . $data_name);
redirect('account');
return;
}
@@ -167,11 +169,13 @@ class Group extends Controller {
{
$this->db->trans_rollback();
$this->messages->add('Error updating ' . $data_name . ' - Group A/C', 'error');
+ $this->logger->write_message("error", "Error updating Group A/C named " . $data_name . " [id:" . $data_id . "]");
$this->template->load('template', 'group/edit', $data);
return;
} else {
$this->db->trans_complete();
$this->messages->add($data_name . ' - Group A/C updated successfully', 'success');
+ $this->logger->write_message("success", "Updated Group A/C named " . $data_name . " [id:" . $data_id . "]");
redirect('account');
return;
}
@@ -209,17 +213,30 @@ class Group extends Controller {
return;
}
+ /* Get the group details */
+ $group_q = $this->db->query("SELECT * FROM groups WHERE id = ?", array($id));
+ if ($group_q->num_rows() < 1)
+ {
+ $this->messages->add('Invalid Group A/C', 'error');
+ redirect('account');
+ return;
+ } else {
+ $group_data = $group_q->row();
+ }
+
/* Deleting group */
$this->db->trans_start();
if ( ! $this->db->query("DELETE FROM groups WHERE id = ?", array($id)))
{
$this->db->trans_rollback();
- $this->messages->add('Error deleting Group A/C', 'error');
+ $this->messages->add("Error deleting " . $group_data->name . " - Group A/C", 'error');
+ $this->logger->write_message("error", "Error deleting Group A/C named " . $group_data->name . " [id:" . $id . "]");
redirect('account');
return;
} else {
$this->db->trans_complete();
- $this->messages->add('Group A/C deleted successfully', 'success');
+ $this->messages->add($group_data->name . ' - Group A/C deleted successfully', 'success');
+ $this->logger->write_message("success", "Deleted Group A/C named " . $group_data->name . " [id:" . $id . "]");
redirect('account');
return;
}
commit e2d1adaf4d3ad3d42ba83e5059ccb1dc820371d6
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sun Dec 12 12:18:28 2010 +0530
Added Database Logger Class and autoload it
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
diff --git a/system/application/config/autoload.php b/system/application/config/autoload.php
index 937f3d6..0d632e2 100644
--- a/system/application/config/autoload.php
+++ b/system/application/config/autoload.php
@@ -39,7 +39,7 @@
| $autoload['libraries'] = array('database', 'session', 'xmlrpc');
*/
-$autoload['libraries'] = array('database', 'session', 'form_validation', 'messages', 'template', 'startup');
+$autoload['libraries'] = array('database', 'session', 'form_validation', 'messages', 'template', 'startup', 'logger');
/*
diff --git a/system/application/controllers/admin/carryforward.sql b/system/application/controllers/admin/carryforward.sql
index 0503922..d1a7d72 100644
--- a/system/application/controllers/admin/carryforward.sql
+++ b/system/application/controllers/admin/carryforward.sql
@@ -79,3 +79,15 @@ CREATE TABLE IF NOT EXISTS tags (
background varchar(6) NOT NULL,
PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1;
+
+CREATE TABLE IF NOT EXISTS log (
+ id int(11) NOT NULL AUTO_INCREMENT,
+ date datetime NOT NULL,
+ level int(1) NOT NULL,
+ host_ip varchar(25) NOT NULL,
+ url varchar(255) NOT NULL,
+ user_agent varchar(100) NOT NULL,
+ message_title varchar(255) NOT NULL,
+ message_desc mediumtext NOT NULL,
+ PRIMARY KEY (id)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1;
diff --git a/system/application/controllers/admin/database.sql b/system/application/controllers/admin/database.sql
index 127d588..ab56ff7 100644
--- a/system/application/controllers/admin/database.sql
+++ b/system/application/controllers/admin/database.sql
@@ -80,6 +80,18 @@ CREATE TABLE IF NOT EXISTS tags (
PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1;
+CREATE TABLE IF NOT EXISTS log (
+ id int(11) NOT NULL AUTO_INCREMENT,
+ date datetime NOT NULL,
+ level int(1) NOT NULL,
+ host_ip varchar(25) NOT NULL,
+ url varchar(255) NOT NULL,
+ user_agent varchar(100) NOT NULL,
+ message_title varchar(255) NOT NULL,
+ message_desc mediumtext NOT NULL,
+ PRIMARY KEY (id)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1;
+
INSERT INTO groups (id, parent_id, name, affects_gross) VALUES (1, 0, 'Assets', 0);
INSERT INTO groups (id, parent_id, name, affects_gross) VALUES (2, 0, 'Liabilities', 0);
INSERT INTO groups (id, parent_id, name, affects_gross) VALUES (3, 0, 'Incomes', 0);
diff --git a/system/application/controllers/admin/welcome.php b/system/application/controllers/admin/welcome.php
index bc7438a..6698999 100644
--- a/system/application/controllers/admin/welcome.php
+++ b/system/application/controllers/admin/welcome.php
@@ -98,7 +98,7 @@ class Welcome extends Controller {
{
$valid_webzash_db = TRUE;
/* Check for valid webzash database */
- $table_names = array('settings', 'groups', 'ledgers', 'vouchers', 'voucher_items');
+ $table_names = array('settings', 'groups', 'ledgers', 'vouchers', 'voucher_items', 'tags', 'log');
foreach ($table_names as $id => $tbname)
{
$valid_db_q = mysql_query('DESC ' . $tbname);
diff --git a/system/application/libraries/Logger.php b/system/application/libraries/Logger.php
new file mode 100644
index 0000000..8e217f3
--- /dev/null
+++ b/system/application/libraries/Logger.php
@@ -0,0 +1,36 @@
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+
+class Logger
+{
+ function Logger()
+ {
+ return;
+ }
+
+ /*
+ * Write message to database log
+ * Levels defined are :
+ * 0 - error
+ * 1 - info
+ * 2 - debug
+ */
+ function write_message($level = "debug", $title = "", $desc = "")
+ {
+ $CI =& get_instance();
+ $data['date'] = date("Y-m-d H:i:s");
+ switch ($level)
+ {
+ case "error": $data['level'] = 0; break;
+ case "info": $data['level'] = 1; break;
+ case "debug": $data['level'] = 2; break;
+ default: $data['level'] = 0; break;
+ }
+ $data['host_ip'] = $CI->input->ip_address();
+ $data['url'] = current_url();
+ $data['user_agent'] = $CI->input->user_agent();
+ $data['message_title'] = $title;
+ $data['message_desc'] = $desc;
+ $CI->db->insert('log', $data);
+ }
+}
+
diff --git a/system/application/libraries/Startup.php b/system/application/libraries/Startup.php
index b5cd1ff..80152bb 100644
--- a/system/application/libraries/Startup.php
+++ b/system/application/libraries/Startup.php
@@ -102,7 +102,7 @@ class Startup
if ($CI->db->query("SHOW TABLES"))
{
/* Check for valid webzash database */
- $table_names = array('settings', 'groups', 'ledgers', 'vouchers', 'voucher_items', 'tags');
+ $table_names = array('settings', 'groups', 'ledgers', 'vouchers', 'voucher_items', 'tags', 'log');
foreach ($table_names as $id => $tbname)
{
$valid_db_q = mysql_query('DESC ' . $tbname);
commit d672d86c2983330f86448613b48d29bb30678989
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sun Dec 12 11:50:03 2010 +0530
Only show dashboard chart if needed
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
diff --git a/system/application/controllers/welcome.php b/system/application/controllers/welcome.php
index 353d906..9aad75a 100644
--- a/system/application/controllers/welcome.php
+++ b/system/application/controllers/welcome.php
@@ -45,6 +45,10 @@ class Welcome extends Controller {
$liability->init(2);
$data['liability_total'] = $liability->total;
+ $data['show_asset_liability'] = TRUE;
+ if ($data['asset_total'] == 0 && $data['liability_total'] == 0)
+ $data['show_asset_liability'] = FALSE;
+
$income = new Accountlist();
$income->init(3);
$data['income_total'] = $income->total;
@@ -52,7 +56,11 @@ class Welcome extends Controller {
$expense = new Accountlist();
$expense->init(4);
$data['expense_total'] = $expense->total;
-
+
+ $data['show_income_expense'] = TRUE;
+ if ($data['income_total'] == 0 && $data['expense_total'] == 0)
+ $data['show_income_expense'] = FALSE;
+
$this->template->load('template', 'welcome_message', $data);
return;
}
diff --git a/system/application/views/welcome_message.php b/system/application/views/welcome_message.php
index cfc3135..2813435 100644
--- a/system/application/views/welcome_message.php
+++ b/system/application/views/welcome_message.php
@@ -141,18 +141,22 @@ jQuery(document).ready(function () {
<table border="0">
<tbody>
<tr>
- <td width="300">
- <div id="income-expense" class="graph">
- <div id="income-expense-graph-header"><h4>Incomes Vs Expenses</h4></div>
- <div id="income-expense-graph-data"></div>
- </div>
- </td>
- <td width="300">
- <div id="asset-liability" class="graph">
- <div id="asset-liability-graph-header"><h4>Assets Vs Liabilities</h4></div>
- <div id="asset-liability-graph-data""></div>
- </div>
- </td>
+ <?php if ($show_income_expense) { ?>
+ <td width="300">
+ <div id="income-expense" class="graph">
+ <div id="income-expense-graph-header"><h4>Incomes Vs Expenses</h4></div>
+ <div id="income-expense-graph-data"></div>
+ </div>
+ </td>
+ <?php } ?>
+ <?php if ($show_asset_liability) { ?>
+ <td width="300">
+ <div id="asset-liability" class="graph">
+ <div id="asset-liability-graph-header"><h4>Assets Vs Liabilities</h4></div>
+ <div id="asset-liability-graph-data""></div>
+ </div>
+ </td>
+ <?php } ?>
</tr>
</tbody>
</table>
commit 2a7d2d30c19d1321bb6aa9496a138012c4124f7a
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sun Dec 12 11:13:18 2010 +0530
Added account summary to dashboard
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
diff --git a/system/application/assets/css/tables.css b/system/application/assets/css/tables.css
index 0988cf2..a6cda32 100644
--- a/system/application/assets/css/tables.css
+++ b/system/application/assets/css/tables.css
@@ -211,6 +211,19 @@
color: #000000;
}
+.dashboard-summary-table {
+ border-collapse: collapse;
+ text-align: left;
+}
+
+.dashboard-summary-table td {
+ padding: 8px 8px 8px 20px;
+}
+
+.dashboard-summary-table td a {
+ color: #000000;
+}
+
.ledgerst-table td {
}
diff --git a/system/application/controllers/welcome.php b/system/application/controllers/welcome.php
index bfb8a64..353d906 100644
--- a/system/application/controllers/welcome.php
+++ b/system/application/controllers/welcome.php
@@ -43,11 +43,11 @@ class Welcome extends Controller {
$liability = new Accountlist();
$liability->init(2);
- $data['liability_total'] = -$liability->total;
+ $data['liability_total'] = $liability->total;
$income = new Accountlist();
$income->init(3);
- $data['income_total'] = -$income->total;
+ $data['income_total'] = $income->total;
$expense = new Accountlist();
$expense->init(4);
diff --git a/system/application/helpers/custom_helper.php b/system/application/helpers/custom_helper.php
index 07ace36..ffe1363 100644
--- a/system/application/helpers/custom_helper.php
+++ b/system/application/helpers/custom_helper.php
@@ -23,6 +23,28 @@ if ( ! function_exists('convert_dc'))
}
}
+/**
+ * Converts amount to Dr or Cr Value
+ *
+ * Covnerts the amount to 0 or Dr or Cr value for display
+ *
+ * @access public
+ * @param float amount for display
+ * @return string
+ */
+if ( ! function_exists('convert_amount_dc'))
+{
+ function convert_amount_dc($amount)
+ {
+ if ($amount == "D")
+ return "0";
+ else if ($amount < 0)
+ return "Cr " . -$amount;
+ else
+ return "Dr " . $amount;
+ }
+}
+
if ( ! function_exists('convert_cur'))
{
function convert_cur($amount)
diff --git a/system/application/views/welcome_message.php b/system/application/views/welcome_message.php
index b16ede9..cfc3135 100644
--- a/system/application/views/welcome_message.php
+++ b/system/application/views/welcome_message.php
@@ -28,7 +28,7 @@ jQuery(document).ready(function () {
// First element is the y-value
// Other elements are arbitary - they are not used by the lib
// but are passed back into callback functions
- [<?php echo $income_total; ?>, {label: 'Incomes'}],
+ [<?php echo -$income_total; ?>, {label: 'Incomes'}],
[<?php echo $expense_total; ?>, {label: 'Expenses'}]
],
@@ -57,7 +57,7 @@ jQuery(document).ready(function () {
// Other elements are arbitary - they are not used by the lib
// but are passed back into callback functions
[<?php echo $asset_total; ?>, {label: 'Assets'}],
- [<?php echo $liability_total; ?>, {label: 'Liabilities'}]
+ [<?php echo -$liability_total; ?>, {label: 'Liabilities'}]
],
// Bar width in arbitrary units, 1.0 means the bars will be snuggled
@@ -121,6 +121,21 @@ jQuery(document).ready(function () {
?>
</div>
</div>
+ <div id="dashboard-summary" class="dashboard-item">
+ <div class="dashboard-title">Account Summary</div>
+ <div class="dashboard-content">
+ <?php
+ echo "<table class=\"dashboard-summary-table\">";
+ echo "<tbody>";
+ echo "<tr><td>Assets Total</td><td>" . convert_amount_dc($asset_total) . "</td></tr>";
+ echo "<tr><td>Liabilities Total</td><td>" . convert_amount_dc($liability_total) . "</td></tr>";
+ echo "<tr><td>Incomes Total</td><td>" . convert_amount_dc($income_total) . "</td></tr>";
+ echo "<tr><td>Expenses Total</td><td>" . convert_amount_dc($expense_total) . "</td></tr>";
+ echo "</tbody>";
+ echo "</table>";
+ ?>
+ </div>
+ </div>
<div class="clear"></div>
<div>
<table border="0">
commit ba27041c673a3faaa4e23a50ce7b9eb9cb23d555
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sun Dec 12 10:58:08 2010 +0530
Increase font size for info and added Help menu item
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
diff --git a/system/application/assets/css/style.css b/system/application/assets/css/style.css
index 36f8abd..6ebbf53 100644
--- a/system/application/assets/css/style.css
+++ b/system/application/assets/css/style.css
@@ -48,7 +48,9 @@ body {
top:10px;
background:none repeat scroll 0 0 #EEEEEE;
padding:10px;
- -moz-border-radius: 15px;
+ font-size:120%;
+ -moz-border-radius: 10px;
+ border-radius: 1px;
}
#content #main {
diff --git a/system/application/views/template.php b/system/application/views/template.php
index 1fb2936..7e04a4c 100644
--- a/system/application/views/template.php
+++ b/system/application/views/template.php
@@ -99,7 +99,10 @@ $(document).ready(function() {
</ul>
</li>
<li>
- <?php echo anchor('setting', 'Settings', array('title' => 'Settings', 'class' => 'last')); ?>
+ <?php echo anchor('setting', 'Settings', array('title' => 'Settings')); ?>
+ </li>
+ <li>
+ <?php echo anchor('', 'Help', array('title' => 'Help', 'class' => 'last')); ?>
</li>
</ul>
</div>
commit 09ad9c2a13ce225472c15123c4059f5b949ade5f
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sun Dec 12 10:52:27 2010 +0530
Converted Assessment year to Financial year throught
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
diff --git a/system/application/controllers/admin/carryforward.sql b/system/application/controllers/admin/carryforward.sql
index deeaa2f..0503922 100644
--- a/system/application/controllers/admin/carryforward.sql
+++ b/system/application/controllers/admin/carryforward.sql
@@ -22,8 +22,8 @@ CREATE TABLE IF NOT EXISTS settings (
name varchar(100) NOT NULL,
address varchar(255) NOT NULL,
email varchar(100) NOT NULL,
- ay_start datetime NOT NULL,
- ay_end datetime NOT NULL,
+ fy_start datetime NOT NULL,
+ fy_end datetime NOT NULL,
currency_symbol varchar(10) NOT NULL,
date_format varchar(30) NOT NULL,
timezone varchar(255) NOT NULL,
diff --git a/system/application/controllers/admin/create.php b/system/application/controllers/admin/create.php
index 8d3a036..8c47a7c 100644
--- a/system/application/controllers/admin/create.php
+++ b/system/application/controllers/admin/create.php
@@ -54,16 +54,16 @@ class Create extends Controller {
'size' => '40',
'value' => '',
);
- $data['assy_start'] = array(
- 'name' => 'assy_start',
- 'id' => 'assy_start',
+ $data['fy_start'] = array(
+ 'name' => 'fy_start',
+ 'id' => 'fy_start',
'maxlength' => '11',
'size' => '11',
'value' => $default_start,
);
- $data['assy_end'] = array(
- 'name' => 'assy_end',
- 'id' => 'assy_end',
+ $data['fy_end'] = array(
+ 'name' => 'fy_end',
+ 'id' => 'fy_end',
'maxlength' => '11',
'size' => '11',
'value' => $default_end,
@@ -132,8 +132,8 @@ class Create extends Controller {
if ($_POST)
{
$this->config->set_item('account_date_format', $this->input->post('account_date', TRUE));
- $this->form_validation->set_rules('assy_start', 'Assessment Year Start', 'trim|required|is_date');
- $this->form_validation->set_rules('assy_end', 'Assessment Year End', 'trim|required|is_date');
+ $this->form_validation->set_rules('fy_start', 'Financial Year Start', 'trim|required|is_date');
+ $this->form_validation->set_rules('fy_end', 'Financial Year End', 'trim|required|is_date');
}
$this->form_validation->set_rules('account_currency', 'Currency', 'trim|max_length[10]');
$this->form_validation->set_rules('account_date', 'Date', 'trim|max_length[10]');
@@ -150,8 +150,8 @@ class Create extends Controller {
$data['account_name']['value'] = $this->input->post('account_name', TRUE);
$data['account_address']['value'] = $this->input->post('account_address', TRUE);
$data['account_email']['value'] = $this->input->post('account_email', TRUE);
- $data['assy_start']['value'] = $this->input->post('assy_start', TRUE);
- $data['assy_end']['value'] = $this->input->post('assy_end', TRUE);
+ $data['fy_start']['value'] = $this->input->post('fy_start', TRUE);
+ $data['fy_end']['value'] = $this->input->post('fy_end', TRUE);
$data['account_currency']['value'] = $this->input->post('account_currency', TRUE);
$data['account_date'] = $this->input->post('account_date', TRUE);
$data['account_timezone'] = $this->input->post('account_timezone', TRUE);
@@ -178,8 +178,8 @@ class Create extends Controller {
$data_account_name = $this->input->post('account_name', TRUE);
$data_account_address = $this->input->post('account_address', TRUE);
$data_account_email = $this->input->post('account_email', TRUE);
- $data_assy_start = date_php_to_mysql($this->input->post('assy_start', TRUE));
- $data_assy_end = date_php_to_mysql_end_time($this->input->post('assy_end', TRUE));
+ $data_fy_start = date_php_to_mysql($this->input->post('fy_start', TRUE));
+ $data_fy_end = date_php_to_mysql_end_time($this->input->post('fy_end', TRUE));
$data_account_currency = $this->input->post('account_currency', TRUE);
$data_account_date_form = $this->input->post('account_date', TRUE);
/* Checking for valid format */
@@ -265,7 +265,7 @@ class Create extends Controller {
}
/* Adding the account settings */
- $newacc->query("INSERT INTO settings (id, label, name, address, email, ay_start, ay_end, currency_symbol, date_format, timezone, database_version) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", array(1, "", $data_account_name, $data_account_address, $data_account_email, $data_assy_start, $data_assy_end, $data_account_currency, $data_account_date, $data_account_timezone, 1));
+ $newacc->query("INSERT INTO settings (id, label, name, address, email, fy_start, fy_end, currency_symbol, date_format, timezone, database_version) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", array(1, "", $data_account_name, $data_account_address, $data_account_email, $data_fy_start, $data_fy_end, $data_account_currency, $data_account_date, $data_account_timezone, 1));
$this->messages->add("Successfully created webzash account", 'success');
/* Adding account settings to file. Code copied from manage controller */
diff --git a/system/application/controllers/admin/database.sql b/system/application/controllers/admin/database.sql
index 6e03ff0..127d588 100644
--- a/system/application/controllers/admin/database.sql
+++ b/system/application/controllers/admin/database.sql
@@ -22,8 +22,8 @@ CREATE TABLE IF NOT EXISTS settings (
name varchar(100) NOT NULL,
address varchar(255) NOT NULL,
email varchar(100) NOT NULL,
- ay_start datetime NOT NULL,
- ay_end datetime NOT NULL,
+ fy_start datetime NOT NULL,
+ fy_end datetime NOT NULL,
currency_symbol varchar(10) NOT NULL,
date_format varchar(30) NOT NULL,
timezone varchar(255) NOT NULL,
diff --git a/system/application/controllers/admin/welcome.php b/system/application/controllers/admin/welcome.php
index 87004dd..bc7438a 100644
--- a/system/application/controllers/admin/welcome.php
+++ b/system/application/controllers/admin/welcome.php
@@ -122,8 +122,8 @@ class Welcome extends Controller {
$this->config->set_item('account_date_format', $account_d->date_format);
$data['current_account'] .= "Currently active account is ";
$data['current_account'] .= "<b>" . $account_d->name . "</b>";
- $data['current_account'] .= " from " . "<b>" . date_mysql_to_php($account_d->ay_start) . "</b>";
- $data['current_account'] .= " to " . "<b>" . date_mysql_to_php($account_d->ay_end) . "</b>";
+ $data['current_account'] .= " from " . "<b>" . date_mysql_to_php_display($account_d->fy_start) . "</b>";
+ $data['current_account'] .= " to " . "<b>" . date_mysql_to_php_display($account_d->fy_end) . "</b>";
$data['current_account'] .= " ( " . anchor('admin/active', 'change active account', array('title' => 'Activate a existing account', 'style' => 'color:#000000')) . " )";
}
}
diff --git a/system/application/controllers/report.php b/system/application/controllers/report.php
index 158b366..22fd4f6 100644
--- a/system/application/controllers/report.php
+++ b/system/application/controllers/report.php
@@ -76,7 +76,7 @@ class Report extends Controller {
$trialbalance[$counter] = array ("TRIAL BALANCE", "", "", "", "", "", "", "", "");
$counter++;
- $trialbalance[$counter] = array ("AY " . date_mysql_to_php($this->config->item('account_ay_start')) . " - " . date_mysql_to_php($this->config->item('account_ay_end')), "", "", "", "", "", "", "", "");
+ $trialbalance[$counter] = array ("FY " . date_mysql_to_php($this->config->item('account_fy_start')) . " - " . date_mysql_to_php($this->config->item('account_fy_end')), "", "", "", "", "", "", "", "");
$counter++;
$trialbalance[$counter][0]= "Ledger";
@@ -184,7 +184,7 @@ class Report extends Controller {
$ledgerst[$counter] = array ("", "", "LEDGER STATEMENT FOR " . strtoupper($this->Ledger_model->get_name($ledger_id)), "", "", "", "", "", "", "", "");
$counter++;
- $ledgerst[$counter] = array ("", "", "AY " . date_mysql_to_php($this->config->item('account_ay_start')) . " - " . date_mysql_to_php($this->config->item('account_ay_end')), "", "", "", "", "", "", "", "");
+ $ledgerst[$counter] = array ("", "", "FY " . date_mysql_to_php($this->config->item('account_fy_start')) . " - " . date_mysql_to_php($this->config->item('account_fy_end')), "", "", "", "", "", "", "", "");
$counter++;
$ledgerst[$counter][0]= "Date";
diff --git a/system/application/controllers/setting.php b/system/application/controllers/setting.php
index 7f96c5f..114fecf 100644
--- a/system/application/controllers/setting.php
+++ b/system/application/controllers/setting.php
@@ -55,8 +55,8 @@ class Setting extends Controller {
'value' => ($account_data) ? echo_value($account_data->email) : '',
);
- $data['assy_start'] = ($account_data) ? date_mysql_to_php(echo_value($account_data->ay_start)) : "error";
- $data['assy_end'] = ($account_data) ? date_mysql_to_php(echo_value($account_data->ay_end)) : "error";
+ $data['fy_start'] = ($account_data) ? date_mysql_to_php(echo_value($account_data->fy_start)) : "error";
+ $data['fy_end'] = ($account_data) ? date_mysql_to_php(echo_value($account_data->fy_end)) : "error";
$data['account_currency'] = array(
'name' => 'account_currency',
@@ -141,7 +141,7 @@ class Setting extends Controller {
$this->template->set('page_title', 'Carry forward account');
/* Form fields */
- $last_year_end = $this->config->item('account_ay_end');
+ $last_year_end = $this->config->item('account_fy_end');
list($last_year_end_date, $last_year_end_time) = explode(' ', $last_year_end);
list($last_year_end_year, $last_year_end_month, $last_year_end_day) = explode('-', $last_year_end_date);
$last_year_end_ts = strtotime($last_year_end);
@@ -164,16 +164,16 @@ class Setting extends Controller {
'size' => '40',
'value' => '',
);
- $data['assy_start'] = array(
- 'name' => 'assy_start',
- 'id' => 'assy_start',
+ $data['fy_start'] = array(
+ 'name' => 'fy_start',
+ 'id' => 'fy_start',
'maxlength' => '11',
'size' => '11',
'value' => date_mysql_to_php($default_start),
);
- $data['assy_end'] = array(
- 'name' => 'assy_end',
- 'id' => 'assy_end',
+ $data['fy_end'] = array(
+ 'name' => 'fy_end',
+ 'id' => 'fy_end',
'maxlength' => '11',
'size' => '11',
'value' => date_mysql_to_php($default_end),
@@ -224,8 +224,8 @@ class Setting extends Controller {
/* Form validations */
$this->form_validation->set_rules('account_label', 'C/F Label', 'trim|required|min_length[2]|max_length[30]|alpha_numeric');
$this->form_validation->set_rules('account_name', 'C/F Account Name', 'trim|required|min_length[2]|max_length[100]');
- $this->form_validation->set_rules('assy_start', 'C/F Assessment Year Start', 'trim|required|is_date');
- $this->form_validation->set_rules('assy_end', 'C/F Assessment Year End', 'trim|required|is_date');
+ $this->form_validation->set_rules('fy_start', 'C/F Financial Year Start', 'trim|required|is_date');
+ $this->form_validation->set_rules('fy_end', 'C/F Financial Year End', 'trim|required|is_date');
$this->form_validation->set_rules('database_name', 'Database Name', 'trim|required');
$this->form_validation->set_rules('database_username', 'Database Username', 'trim|required');
@@ -235,8 +235,8 @@ class Setting extends Controller {
{
$data['account_label']['value'] = $this->input->post('account_label', TRUE);
$data['account_name']['value'] = $this->input->post('account_name', TRUE);
- $data['assy_start']['value'] = $this->input->post('assy_start', TRUE);
- $data['assy_end']['value'] = $this->input->post('assy_end', TRUE);
+ $data['fy_start']['value'] = $this->input->post('fy_start', TRUE);
+ $data['fy_end']['value'] = $this->input->post('fy_end', TRUE);
$data['create_database'] = $this->input->post('create_database', TRUE);
$data['database_name']['value'] = $this->input->post('database_name', TRUE);
@@ -260,8 +260,8 @@ class Setting extends Controller {
$data_account_name = $this->input->post('account_name', TRUE);
$data_account_address = $this->config->item('account_address');
$data_account_email = $this->config->item('account_email');
- $data_assy_start = date_php_to_mysql($this->input->post('assy_start', TRUE));
- $data_assy_end = date_php_to_mysql_end_time($this->input->post('assy_end', TRUE));
+ $data_fy_start = date_php_to_mysql($this->input->post('fy_start', TRUE));
+ $data_fy_end = date_php_to_mysql_end_time($this->input->post('fy_end', TRUE));
$data_account_currency = $this->config->item('account_currency_symbol');
$data_account_date = $this->config->item('account_date_format');
$data_account_timezone = $this->config->item('account_timezone');
@@ -343,7 +343,7 @@ class Setting extends Controller {
}
/* Adding the account settings */
- $newacc->query("INSERT INTO settings (id, label, name, address, email, ay_start, ay_end, currency_symbol, date_format, timezone, email_protocol, email_host, email_port, email_username, email_password, database_version) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", array(1, "", $data_account_name, $data_account_address, $data_account_email, $data_assy_start, $data_assy_end, $data_account_currency, $data_account_date, $data_account_timezone, $data_account_email_protocol, $data_account_email_host, $data_account_email_port, $data_account_email_username, $data_account_email_password, 1));
+ $newacc->query("INSERT INTO settings (id, label, name, address, email, fy_start, fy_end, currency_symbol, date_format, timezone, email_protocol, email_host, email_port, email_username, email_password, database_version) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", array(1, "", $data_account_name, $data_account_address, $data_account_email, $data_fy_start, $data_fy_end, $data_account_currency, $data_account_date, $data_account_timezone, $data_account_email_protocol, $data_account_email_host, $data_account_email_port, $data_account_email_username, $data_account_email_password, 1));
$this->messages->add("Successfully created webzash account", 'success');
diff --git a/system/application/libraries/Startup.php b/system/application/libraries/Startup.php
index 1712a0b..b5cd1ff 100644
--- a/system/application/libraries/Startup.php
+++ b/system/application/libraries/Startup.php
@@ -134,8 +134,8 @@ class Startup
$CI->config->set_item('account_name', $account_d->name);
$CI->config->set_item('account_address', $account_d->address);
$CI->config->set_item('account_email', $account_d->email);
- $CI->config->set_item('account_ay_start', $account_d->ay_start);
- $CI->config->set_item('account_ay_end', $account_d->ay_end);
+ $CI->config->set_item('account_fy_start', $account_d->fy_start);
+ $CI->config->set_item('account_fy_end', $account_d->fy_end);
$CI->config->set_item('account_currency_symbol', $account_d->currency_symbol);
$CI->config->set_item('account_date_format', $account_d->date_format);
$CI->config->set_item('account_timezone', $account_d->timezone);
diff --git a/system/application/views/admin/create.php b/system/application/views/admin/create.php
index 983faf7..86deaad 100644
--- a/system/application/views/admin/create.php
+++ b/system/application/views/admin/create.php
@@ -40,19 +40,19 @@
echo "</p>";
echo "<p>";
- echo form_label('Assessment Year Start', 'assy_start');
+ echo form_label('Financial Year Start', 'fy_start');
echo "<br />";
- echo form_input_date($assy_start);
+ echo form_input_date($fy_start);
echo "<br />";
- echo "<span class=\"form-help-text\">Warning : Assessment Year Start cannot be changed later</span>";
+ echo "<span class=\"form-help-text\">Warning : Financial Year Start cannot be changed later.<br />Format as per 'Date Foramt' selected abobe.</span>";
echo "</p>";
echo "<p>";
- echo form_label('Assessment Year End', 'assy_end');
+ echo form_label('Financial Year End', 'fy_end');
echo "<br />";
- echo form_input_date($assy_end);
+ echo form_input_date($fy_end);
echo "<br />";
- echo "<span class=\"form-help-text\">Warning : Assessment Year End cannot be changed later</span>";
+ echo "<span class=\"form-help-text\">Warning : Financial Year End cannot be changed later.<br />Format as per 'Date Foramt' selected abobe.</span>";
echo "</p>";
echo "<p>";
diff --git a/system/application/views/admin/welcome.php b/system/application/views/admin/welcome.php
index 90e68d9..2a8b841 100644
--- a/system/application/views/admin/welcome.php
+++ b/system/application/views/admin/welcome.php
@@ -9,7 +9,7 @@
<?php echo anchor('admin/create', 'Create Account', array('title' => 'Create a new account')); ?>
</div>
<div class="settings-desc">
- Create a new webzash account
+ Create a new account
</div>
</div>
<div class="settings-container">
@@ -17,7 +17,7 @@
<?php echo anchor('admin/active', 'Change Active Account', array('title' => 'Change active account')); ?>
</div>
<div class="settings-desc">
- Change existing active webzash account
+ Change existing active account
</div>
</div>
<div class="settings-container">
@@ -25,7 +25,7 @@
<?php echo anchor('admin/manage', 'Manage Accounts', array('title' => 'Manage existing accounts')); ?>
</div>
<div class="settings-desc">
- Manage existing webzash accounts
+ Manage existing accounts
</div>
</div>
</div>
diff --git a/system/application/views/setting/account.php b/system/application/views/setting/account.php
index a4a5647..496a34b 100644
--- a/system/application/views/setting/account.php
+++ b/system/application/views/setting/account.php
@@ -32,15 +32,15 @@
echo "</p>";
echo "<p>";
- echo form_label('Assessment Year Start', 'assy_start');
+ echo form_label('Financial Year Start', 'fy_start');
echo "<br />";
- echo $assy_start;
+ echo $fy_start;
echo "</p>";
echo "<p>";
- echo form_label('Assessment Year End', 'assy_end');
+ echo form_label('Financial Year End', 'fy_end');
echo "<br />";
- echo $assy_end;
+ echo $fy_end;
echo "</p>";
echo "<p>";
diff --git a/system/application/views/setting/cf.php b/system/application/views/setting/cf.php
index 98ccc1b..03b1c53 100644
--- a/system/application/views/setting/cf.php
+++ b/system/application/views/setting/cf.php
@@ -16,15 +16,19 @@
echo "</p>";
echo "<p>";
- echo form_label('C/F Assessment Year Start', 'assy_start');
+ echo form_label('C/F Financial Year Start', 'fy_start');
echo "<br />";
- echo form_input_date($assy_start);
+ echo form_input_date($fy_start);
+ echo "<br />";
+ echo "<span class=\"form-help-text\">Foramt : " . $this->config->item('account_date_format') . "</span>";
echo "</p>";
echo "<p>";
- echo form_label('C/F Assessment Year End', 'assy_end');
+ echo form_label('C/F Financial Year End', 'fy_end');
+ echo "<br />";
+ echo form_input_date($fy_end);
echo "<br />";
- echo form_input_date($assy_end);
+ echo "<span class=\"form-help-text\">Format : " . $this->config->item('account_date_format') . "</span>";
echo "</p>";
echo "<p>";
diff --git a/system/application/views/template.php b/system/application/views/template.php
index 52cb6a5..1fb2936 100644
--- a/system/application/views/template.php
+++ b/system/application/views/template.php
@@ -64,9 +64,9 @@ $(document).ready(function() {
<?php
echo $this->config->item('account_name');
echo "<br />";
- echo date_mysql_to_php($this->config->item('account_ay_start'));
+ echo date_mysql_to_php_display($this->config->item('account_fy_start'));
echo " - ";
- echo date_mysql_to_php($this->config->item('account_ay_end'));
+ echo date_mysql_to_php_display($this->config->item('account_fy_end'));
?>
</div>
</div>
commit 242af713ae694153923cfe238079eaebe2dab1a2
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sat Dec 11 19:38:36 2010 +0530
CF Closing Balance of only Assets and Liabilities
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
diff --git a/system/application/controllers/setting.php b/system/application/controllers/setting.php
index 44ee141..7f96c5f 100644
--- a/system/application/controllers/setting.php
+++ b/system/application/controllers/setting.php
@@ -136,6 +136,7 @@ class Setting extends Controller {
function cf()
{
$this->load->helper('file');
+ $this->load->library('accountlist');
$this->load->model('Ledger_model');
$this->template->set('page_title', 'Carry forward account');
@@ -365,25 +366,41 @@ class Setting extends Controller {
}
}
+ /* Only importing Assets and Liability closing balance */
+ $assets = new Accountlist();
+ $assets->init(1);
+ $liability = new Accountlist();
+ $liability->init(2);
+ $cf_ledgers = array_merge($assets->get_ledger_ids(), $liability->get_ledger_ids());
+
/* Importing Ledgers */
$ledger_q = $this->db->query("SELECT * FROM ledgers ORDER BY id");
foreach ($ledger_q->result() as $row)
{
- /* Calculating closing balance for previous year */
- $cl_balance = $this->Ledger_model->get_ledger_balance($row->id);
- if ($cl_balance < 0)
+ /* CF only Assets and Liability with Closing Balance */
+ if (in_array($row->id, $cf_ledgers))
{
- $op_balance = -$cl_balance;
- $op_balance_dc = "C";
+ /* Calculating closing balance for previous year */
+ $cl_balance = $this->Ledger_model->get_ledger_balance($row->id);
+ if ($cl_balance < 0)
+ {
+ $op_balance = -$cl_balance;
+ $op_balance_dc = "C";
+ } else {
+ $op_balance = $cl_balance;
+ $op_balance_dc = "D";
+ }
+ if ( ! $newacc->query("INSERT INTO ledgers (id, group_id, name, op_balance, op_balance_dc, type) VALUES (?, ?, ?, ?, ?, ?)", array($row->id, $row->group_id, $row->name, $op_balance, $op_balance_dc, $row->type)))
+ {
+ $this->messages->add("Failed to add ledger " . $row->name, 'error');
+ $cf_status = FALSE;
+ }
} else {
- $op_balance = $cl_balance;
- $op_balance_dc = "D";
- }
-
- if ( ! $newacc->query("INSERT INTO ledgers (id, group_id, name, op_balance, op_balance_dc, type) VALUES (?, ?, ?, ?, ?, ?)", array($row->id, $row->group_id, $row->name, $op_balance, $op_balance_dc, $row->type)))
- {
- $this->messages->add("Failed to add ledger " . $row->name, 'error');
- $cf_status = FALSE;
+ if ( ! $newacc->query("INSERT INTO ledgers (id, group_id, name, op_balance, op_balance_dc, type) VALUES (?, ?, ?, ?, ?, ?)", array($row->id, $row->group_id, $row->name, 0, "D", $row->type)))
+ {
+ $this->messages->add("Failed to add ledger " . $row->name, 'error');
+ $cf_status = FALSE;
+ }
}
}
diff --git a/system/application/libraries/Accountlist.php b/system/application/libraries/Accountlist.php
index 22bc6c2..d9a52b3 100644
--- a/system/application/libraries/Accountlist.php
+++ b/system/application/libraries/Accountlist.php
@@ -367,5 +367,30 @@ class Accountlist
self::$max_depth = 0;
self::$temp_max = 0;
}
+
+ /*
+ * Return a array of sub ledgers with the object
+ * Used in CF ledgers of type Assets and Liabilities
+ */
+ function get_ledger_ids()
+ {
+ $ledgers = array();
+ if (count($this->children_ledgers) > 0)
+ {
+ foreach ($this->children_ledgers as $id => $data)
+ {
+ $ledgers[] = $data['id'];
+ }
+ }
+ if (count($this->children_groups) > 0)
+ {
+ foreach ($this->children_groups as $id => $data)
+ {
+ foreach ($data->get_ledger_ids() as $row)
+ $ledgers[] = $row;
+ }
+ }
+ return $ledgers;
+ }
}
13 years, 4 months
46 commits - README.txt system/application todo.txt TODO.txt webzash-agpl-3.0.txt webzash-copyright.txt
by pshah
README.txt | 22
TODO.txt | 5
system/application/assets/css/admin-style.css | 17
system/application/assets/css/custom.css | 92
system/application/assets/css/style.css | 22
system/application/assets/css/tables.css | 205 ++
system/application/assets/css/tufte-graph.css | 41
system/application/assets/images/buttons/navlink.png |binary
system/application/assets/images/icons/delete.png |binary
system/application/assets/images/icons/email.png |binary
system/application/assets/images/icons/match.png |binary
system/application/assets/images/icons/nomatch.png |binary
system/application/assets/js/custom.js | 1
system/application/assets/js/jquery.enumerable.js | 102 +
system/application/assets/js/jquery.tufte-graph.js | 233 ++
system/application/assets/js/raphael.js | 1690 ++++++++++++++++++
system/application/config/config.php | 16
system/application/controllers/admin/carryforward.sql | 5
system/application/controllers/admin/create.php | 36
system/application/controllers/admin/database.sql | 5
system/application/controllers/admin/manage.php | 158 +
system/application/controllers/admin/welcome.php | 1
system/application/controllers/report.php | 516 +++++
system/application/controllers/setting.php | 84
system/application/controllers/tag.php | 12
system/application/controllers/voucher.php | 111 -
system/application/controllers/welcome.php | 44
system/application/helpers/MY_date_helper.php | 116 +
system/application/helpers/csv_helper.php | 101 +
system/application/helpers/custom_helper.php | 28
system/application/libraries/Accountlist.php | 196 +-
system/application/libraries/MY_Form_validation.php | 18
system/application/models/tag_model.php | 31
system/application/views/account/index.php | 4
system/application/views/admin/create.php | 20
system/application/views/admin/manage/edit.php | 47
system/application/views/admin/manage/index.php | 17
system/application/views/admin_template.php | 4
system/application/views/report/balancesheet.php | 12
system/application/views/report/ledgerst.php | 65
system/application/views/report/profitandloss.php | 26
system/application/views/report/trialbalance.php | 9
system/application/views/setting/account.php | 16
system/application/views/sidebar/tag.php | 18
system/application/views/tag/index.php | 10
system/application/views/template.php | 28
system/application/views/voucher/add.php | 10
system/application/views/voucher/edit.php | 8
system/application/views/voucher/index.php | 5
system/application/views/voucher/view.php | 15
system/application/views/welcome_message.php | 158 +
todo.txt | 5
webzash-agpl-3.0.txt | 661 +++++++
webzash-copyright.txt | 24
54 files changed, 4785 insertions(+), 285 deletions(-)
New commits:
commit d6d0926f1897c673cb4572826b280bdff8804dc9
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sat Dec 11 15:17:13 2010 +0530
Voucher date now is display in full months name
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
diff --git a/system/application/controllers/voucher.php b/system/application/controllers/voucher.php
index 6d2ef11..d165dc4 100644
--- a/system/application/controllers/voucher.php
+++ b/system/application/controllers/voucher.php
@@ -157,7 +157,7 @@ class Voucher extends Controller {
$html .= ($row->draft == 1) ? " tr-draft " : "";
$html .= "\">";
- $html .= "<td>" . date_mysql_to_php($row->date) . "</td>";
+ $html .= "<td>" . date_mysql_to_php_display($row->date) . "</td>";
$html .= "<td>" . anchor('voucher/view/' . strtolower($html_voucher_type) . "/" . $row->id, $row->number, array('title' => 'View ' . ucfirst($html_voucher_type) . ' Voucher', 'class' => 'blue-link')) . "</td>";
$html .= "<td>";
@@ -769,7 +769,7 @@ class Voucher extends Controller {
echo "<p><b>" . $account->name . "</b></p>";
echo "<p>" . $account->address . "</p>";
echo "<p>Voucher Number : " . $cur_voucher->number . "</p>";
- echo "<p>Voucher Date : " . date_mysql_to_php($cur_voucher->date) . "</p>";
+ echo "<p>Voucher Date : " . date_mysql_to_php_display($cur_voucher->date) . "</p>";
echo "<table border=1>";
echo "<thead><tr><th>Ledger A/C</th><th>Dr Amount</th><th>Cr Amount</th></tr></thead>";
@@ -848,7 +848,7 @@ class Voucher extends Controller {
$message .= "<p><b>" . $this->config->item('account_name') . "</b></p>";
$message .= "<p>" . $this->config->item('account_address') . "</p>";
$message .= "<p>Voucher Number : " . $cur_voucher->number . "</p>";
- $message .= "<p>Voucher Date : " . date_mysql_to_php($cur_voucher->date) . "</p>";
+ $message .= "<p>Voucher Date : " . date_mysql_to_php_display($cur_voucher->date) . "</p>";
$message .= "<table border=1>";
$message .= "<thead><tr><th>Ledger A/C</th><th>Dr Amount</th><th>Cr Amount</th></tr></thead>";
diff --git a/system/application/helpers/MY_date_helper.php b/system/application/helpers/MY_date_helper.php
index 06e6e62..cfb9674 100644
--- a/system/application/helpers/MY_date_helper.php
+++ b/system/application/helpers/MY_date_helper.php
@@ -80,6 +80,32 @@ if ( ! function_exists('date_mysql_to_php'))
}
}
+if ( ! function_exists('date_mysql_to_php_display'))
+{
+ function date_mysql_to_php_display($dt)
+ {
+ $ts = human_to_unix($dt);
+ $CI =& get_instance();
+ $current_date_format = $CI->config->item('account_date_format');
+ switch ($current_date_format)
+ {
+ case 'dd/mm/yyyy':
+ return date('d M Y', $ts);
+ break;
+ case 'mm/dd/yyyy':
+ return date('M d Y', $ts);
+ break;
+ case 'yyyy/mm/dd':
+ return date('Y M d', $ts);
+ break;
+ default:
+ $CI->messages->add('Invalid date format. Please check your account settings', 'error');
+ return "";
+ }
+ return;
+ }
+}
+
if ( ! function_exists('date_today_php'))
{
function date_today_php()
diff --git a/system/application/views/report/ledgerst.php b/system/application/views/report/ledgerst.php
index bf113e9..78054ab 100644
--- a/system/application/views/report/ledgerst.php
+++ b/system/application/views/report/ledgerst.php
@@ -118,7 +118,7 @@
echo ($row->vdraft == 1) ? " tr-draft " : "";
echo "\">";
echo "<td>";
- echo date_mysql_to_php($row->vdate);
+ echo date_mysql_to_php_display($row->vdate);
echo "</td>";
echo "<td>";
echo anchor('voucher/view/' . n_to_v($row->vtype) . '/' . $row->vid, $row->vnumber, array('title' => 'View ' . ' Voucher', 'style' => 'color:#000000'));
diff --git a/system/application/views/voucher/view.php b/system/application/views/voucher/view.php
index f85e5ba..2857822 100644
--- a/system/application/views/voucher/view.php
+++ b/system/application/views/voucher/view.php
@@ -1,6 +1,6 @@
<p>Voucher Number : <span class="bold"><?php echo $cur_voucher->number; ?></span>
-Voucher Date : <span class="bold"><?php echo date_mysql_to_php($cur_voucher->date); ?></span>
+Voucher Date : <span class="bold"><?php echo date_mysql_to_php_display($cur_voucher->date); ?></span>
</p>
<table border=0 cellpadding=5 class="simple-table voucher-view-table">
commit 11b03279bc6d6ef317eda4653b9c4ea1b2eaf995
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sat Dec 11 15:10:49 2010 +0530
Creating company will store the end time as end of day
Assessment Year End time is stored as 23 hrs 59 minutes 59 seconds
that marks the end of the day
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
diff --git a/system/application/controllers/admin/create.php b/system/application/controllers/admin/create.php
index 3c78750..8d3a036 100644
--- a/system/application/controllers/admin/create.php
+++ b/system/application/controllers/admin/create.php
@@ -179,7 +179,7 @@ class Create extends Controller {
$data_account_address = $this->input->post('account_address', TRUE);
$data_account_email = $this->input->post('account_email', TRUE);
$data_assy_start = date_php_to_mysql($this->input->post('assy_start', TRUE));
- $data_assy_end = date_php_to_mysql($this->input->post('assy_end', TRUE));
+ $data_assy_end = date_php_to_mysql_end_time($this->input->post('assy_end', TRUE));
$data_account_currency = $this->input->post('account_currency', TRUE);
$data_account_date_form = $this->input->post('account_date', TRUE);
/* Checking for valid format */
commit 0e01c9506c806253fc835b20312b119f63d9e047
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sat Dec 11 15:01:44 2010 +0530
Updated CF to calculate the start and end time
Calculating start and end time as per the current year
end time whatever the month and day may be
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
diff --git a/system/application/controllers/setting.php b/system/application/controllers/setting.php
index 2b60bfa..44ee141 100644
--- a/system/application/controllers/setting.php
+++ b/system/application/controllers/setting.php
@@ -140,42 +140,13 @@ class Setting extends Controller {
$this->template->set('page_title', 'Carry forward account');
/* Form fields */
- $default_start_str = $this->config->item('account_ay_end');
- $default_start_year = date('Y', strtotime($default_start_str));
-
- $current_date_format = $this->config->item('account_date_format');
- switch ($current_date_format)
- {
- case 'dd/mm/yyyy':
- $default_start = date('d/m/Y', strtotime($default_start_str));
- break;
- case 'mm/dd/yyyy':
- $default_start = date('m/d/Y', strtotime($default_start_str));
- break;
- case 'yyyy/mm/dd':
- $default_start = date('Y/m/d', strtotime($default_start_str));
- break;
- default:
- $this->messages->add('Invalid date format. Please check your account settings', 'error');
- return "";
- }
-
- $default_end_year = $default_start_year + 1;
- switch ($current_date_format)
- {
- case 'dd/mm/yyyy':
- $default_end = '31/03/' . $default_end_year;
- break;
- case 'mm/dd/yyyy':
- $default_end = '03/31/' . $default_end_year;
- break;
- case 'yyyy/mm/dd':
- $default_end = $default_end_year . '03/31';
- break;
- default:
- $this->messages->add('Invalid date format. Please check your account settings', 'error');
- return "";
- }
+ $last_year_end = $this->config->item('account_ay_end');
+ list($last_year_end_date, $last_year_end_time) = explode(' ', $last_year_end);
+ list($last_year_end_year, $last_year_end_month, $last_year_end_day) = explode('-', $last_year_end_date);
+ $last_year_end_ts = strtotime($last_year_end);
+ $default_start_ts = $last_year_end_ts + (60 * 60 * 24); /* Adding 24 hours */
+ $default_start = date("Y-m-d 00:00:00", $default_start_ts);
+ $default_end = ($last_year_end_year + 1) . "-" . $last_year_end_month . "-" . $last_year_end_day . " 00:00:00";
/* Form fields */
$data['account_label'] = array(
@@ -197,14 +168,14 @@ class Setting extends Controller {
'id' => 'assy_start',
'maxlength' => '11',
'size' => '11',
- 'value' => $default_start,
+ 'value' => date_mysql_to_php($default_start),
);
$data['assy_end'] = array(
'name' => 'assy_end',
'id' => 'assy_end',
'maxlength' => '11',
'size' => '11',
- 'value' => $default_end,
+ 'value' => date_mysql_to_php($default_end),
);
$data['database_name'] = array(
@@ -289,7 +260,7 @@ class Setting extends Controller {
$data_account_address = $this->config->item('account_address');
$data_account_email = $this->config->item('account_email');
$data_assy_start = date_php_to_mysql($this->input->post('assy_start', TRUE));
- $data_assy_end = date_php_to_mysql($this->input->post('assy_end', TRUE));
+ $data_assy_end = date_php_to_mysql_end_time($this->input->post('assy_end', TRUE));
$data_account_currency = $this->config->item('account_currency_symbol');
$data_account_date = $this->config->item('account_date_format');
$data_account_timezone = $this->config->item('account_timezone');
diff --git a/system/application/helpers/MY_date_helper.php b/system/application/helpers/MY_date_helper.php
index ea40c07..06e6e62 100644
--- a/system/application/helpers/MY_date_helper.php
+++ b/system/application/helpers/MY_date_helper.php
@@ -27,6 +27,33 @@ if ( ! function_exists('date_php_to_mysql'))
}
}
+if ( ! function_exists('date_php_to_mysql_end_time'))
+{
+ function date_php_to_mysql_end_time($dt)
+ {
+ $CI =& get_instance();
+ $current_date_format = $CI->config->item('account_date_format');
+ list($d, $m, $y) = array(0, 0, 0);
+ switch ($current_date_format)
+ {
+ case 'dd/mm/yyyy':
+ list($d, $m, $y) = explode('/', $dt);
+ break;
+ case 'mm/dd/yyyy':
+ list($m, $d, $y) = explode('/', $dt);
+ break;
+ case 'yyyy/mm/dd':
+ list($y, $m, $d) = explode('/', $dt);
+ break;
+ default:
+ $CI->messages->add('Invalid date format. Please check your account settings', 'error');
+ return "";
+ }
+ $ts = mktime("23", "59", "59", $m, $d, $y);
+ return date('Y-m-d H:i:s', $ts);
+ }
+}
+
if ( ! function_exists('date_mysql_to_php'))
{
function date_mysql_to_php($dt)
commit 74d345eb4e7d38cb7189a3ff0dd81c03355d92f0
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sat Dec 11 14:25:01 2010 +0530
Updated CF account to use the current date format
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
diff --git a/system/application/controllers/setting.php b/system/application/controllers/setting.php
index 48bfdd2..2b60bfa 100644
--- a/system/application/controllers/setting.php
+++ b/system/application/controllers/setting.php
@@ -142,10 +142,40 @@ class Setting extends Controller {
/* Form fields */
$default_start_str = $this->config->item('account_ay_end');
$default_start_year = date('Y', strtotime($default_start_str));
- $default_start = date('d/m/Y', strtotime($default_start_str));
+
+ $current_date_format = $this->config->item('account_date_format');
+ switch ($current_date_format)
+ {
+ case 'dd/mm/yyyy':
+ $default_start = date('d/m/Y', strtotime($default_start_str));
+ break;
+ case 'mm/dd/yyyy':
+ $default_start = date('m/d/Y', strtotime($default_start_str));
+ break;
+ case 'yyyy/mm/dd':
+ $default_start = date('Y/m/d', strtotime($default_start_str));
+ break;
+ default:
+ $this->messages->add('Invalid date format. Please check your account settings', 'error');
+ return "";
+ }
$default_end_year = $default_start_year + 1;
- $default_end = '31/03/' . $default_end_year;
+ switch ($current_date_format)
+ {
+ case 'dd/mm/yyyy':
+ $default_end = '31/03/' . $default_end_year;
+ break;
+ case 'mm/dd/yyyy':
+ $default_end = '03/31/' . $default_end_year;
+ break;
+ case 'yyyy/mm/dd':
+ $default_end = $default_end_year . '03/31';
+ break;
+ default:
+ $this->messages->add('Invalid date format. Please check your account settings', 'error');
+ return "";
+ }
/* Form fields */
$data['account_label'] = array(
commit f875949795f552a0f36808b115754a46f3ea5974
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sat Dec 11 14:13:34 2010 +0530
Updated date formats
- Removed change of date from account settings
- Added notice that cannot change date in account creation
- Moved date picker js code to template
- Dynamic date validation when creating account as per date format
- No need to check account settings in update settings code
- Moved Date format before assessment year when creating account
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
diff --git a/system/application/assets/js/custom.js b/system/application/assets/js/custom.js
index d10ab05..64dfbad 100644
--- a/system/application/assets/js/custom.js
+++ b/system/application/assets/js/custom.js
@@ -13,7 +13,6 @@ $(document).ready(function() {
return false;
}
});
- $('.datepicker').datepick({dateFormat: 'dd/mm/yyyy'});
})
diff --git a/system/application/controllers/admin/create.php b/system/application/controllers/admin/create.php
index 800103f..3c78750 100644
--- a/system/application/controllers/admin/create.php
+++ b/system/application/controllers/admin/create.php
@@ -129,8 +129,12 @@ class Create extends Controller {
$this->form_validation->set_rules('account_name', 'Account Name', 'trim|required|min_length[2]|max_length[100]');
$this->form_validation->set_rules('account_address', 'Account Address', 'trim|max_length[255]');
$this->form_validation->set_rules('account_email', 'Account Email', 'trim|valid_email');
- $this->form_validation->set_rules('assy_start', 'Assessment Year Start', 'trim|required|is_date');
- $this->form_validation->set_rules('assy_end', 'Assessment Year End', 'trim|required|is_date');
+ if ($_POST)
+ {
+ $this->config->set_item('account_date_format', $this->input->post('account_date', TRUE));
+ $this->form_validation->set_rules('assy_start', 'Assessment Year Start', 'trim|required|is_date');
+ $this->form_validation->set_rules('assy_end', 'Assessment Year End', 'trim|required|is_date');
+ }
$this->form_validation->set_rules('account_currency', 'Currency', 'trim|max_length[10]');
$this->form_validation->set_rules('account_date', 'Date', 'trim|max_length[10]');
$this->form_validation->set_rules('account_timezone', 'Timezone', 'trim|max_length[6]');
diff --git a/system/application/controllers/admin/welcome.php b/system/application/controllers/admin/welcome.php
index d279695..87004dd 100644
--- a/system/application/controllers/admin/welcome.php
+++ b/system/application/controllers/admin/welcome.php
@@ -119,6 +119,7 @@ class Welcome extends Controller {
$account_q = $this->db->query('SELECT * FROM settings WHERE id = 1');
if ($account_d = $account_q->row())
{
+ $this->config->set_item('account_date_format', $account_d->date_format);
$data['current_account'] .= "Currently active account is ";
$data['current_account'] .= "<b>" . $account_d->name . "</b>";
$data['current_account'] .= " from " . "<b>" . date_mysql_to_php($account_d->ay_start) . "</b>";
diff --git a/system/application/controllers/setting.php b/system/application/controllers/setting.php
index fdcf151..48bfdd2 100644
--- a/system/application/controllers/setting.php
+++ b/system/application/controllers/setting.php
@@ -54,20 +54,10 @@ class Setting extends Controller {
'size' => '40',
'value' => ($account_data) ? echo_value($account_data->email) : '',
);
- $data['assy_start'] = array(
- 'name' => 'assy_start',
- 'id' => 'assy_start',
- 'maxlength' => '11',
- 'size' => '11',
- 'value' => ($account_data) ? date_mysql_to_php(echo_value($account_data->ay_start)) : $default_start,
- );
- $data['assy_end'] = array(
- 'name' => 'assy_end',
- 'id' => 'assy_end',
- 'maxlength' => '11',
- 'size' => '11',
- 'value' => ($account_data) ? date_mysql_to_php(echo_value($account_data->ay_end)) : $default_end,
- );
+
+ $data['assy_start'] = ($account_data) ? date_mysql_to_php(echo_value($account_data->ay_start)) : "error";
+ $data['assy_end'] = ($account_data) ? date_mysql_to_php(echo_value($account_data->ay_end)) : "error";
+
$data['account_currency'] = array(
'name' => 'account_currency',
'id' => 'account_currency',
@@ -87,8 +77,6 @@ class Setting extends Controller {
$this->form_validation->set_rules('account_name', 'Account Name', 'trim|required|min_length[2]|max_length[100]');
$this->form_validation->set_rules('account_address', 'Account Address', 'trim|max_length[255]');
$this->form_validation->set_rules('account_email', 'Account Email', 'trim|valid_email');
- $this->form_validation->set_rules('assy_start', 'Assessment Year Start', 'trim|required|is_date');
- $this->form_validation->set_rules('assy_end', 'Assessment Year End', 'trim|required|is_date');
$this->form_validation->set_rules('account_currency', 'Currency', 'trim|max_length[10]');
$this->form_validation->set_rules('account_date', 'Date', 'trim|max_length[10]');
$this->form_validation->set_rules('account_timezone', 'Timezone', 'trim|max_length[6]');
@@ -99,8 +87,6 @@ class Setting extends Controller {
$data['account_name']['value'] = $this->input->post('account_name', TRUE);
$data['account_address']['value'] = $this->input->post('account_address', TRUE);
$data['account_email']['value'] = $this->input->post('account_email', TRUE);
- $data['assy_start']['value'] = $this->input->post('assy_start', TRUE);
- $data['assy_end']['value'] = $this->input->post('assy_end', TRUE);
$data['account_currency']['value'] = $this->input->post('account_currency', TRUE);
$data['account_date'] = $this->input->post('account_date', TRUE);
$data['account_timezone'] = $this->input->post('account_timezone', TRUE);
@@ -118,8 +104,6 @@ class Setting extends Controller {
$data_account_name = $this->input->post('account_name', TRUE);
$data_account_address = $this->input->post('account_address', TRUE);
$data_account_email = $this->input->post('account_email', TRUE);
- $data_assy_start = date_php_to_mysql($this->input->post('assy_start', TRUE));
- $data_assy_end = date_php_to_mysql($this->input->post('assy_end', TRUE));
$data_account_currency = $this->input->post('account_currency', TRUE);
$data_account_date_form = $this->input->post('account_date', TRUE);
/* Checking for valid format */
@@ -133,21 +117,8 @@ class Setting extends Controller {
$data_account_date = "dd/mm/yyyy";
$data_account_timezone = $this->input->post('timezones', TRUE);
- /* Verify if current settings exist. If not add new settings */
- $current = $this->Setting_model->get_current();
- if ( ! $current)
- {
- $this->messages->add('Current settings were not valid', 'message');
- if ( ! $this->db->query("INSERT INTO settings (id, name, address, email, ay_start, ay_end, currency_symbol, date_format, timezone) VALUES (1, ?, ?, ?, ?, ?, ?, ?, ?)", array($data_account_name, $data_account_address, $data_account_email, $data_assy_start, $data_assy_end, $data_account_currency, $data_account_date, $data_account_timezone)))
- {
- $this->messages->add('Error adding new settings', 'error');
- $this->template->load('template', 'setting/account', $data);
- return;
- }
- }
-
/* Update settings */
- if ( ! $this->db->query("UPDATE settings SET name = ?, address = ?, email = ?, ay_start = ?, ay_end = ?, currency_symbol = ?, date_format = ?, timezone = ? WHERE id = 1", array($data_account_name, $data_account_address, $data_account_email, $data_assy_start, $data_assy_end, $data_account_currency, $data_account_date, $data_account_timezone)))
+ if ( ! $this->db->query("UPDATE settings SET name = ?, address = ?, email = ?, currency_symbol = ?, date_format = ?, timezone = ? WHERE id = 1", array($data_account_name, $data_account_address, $data_account_email, $data_account_currency, $data_account_date, $data_account_timezone)))
{
$this->messages->add('Error updating settings', 'error');
$this->template->load('template', 'setting/account', $data);
diff --git a/system/application/views/admin/create.php b/system/application/views/admin/create.php
index f8e548f..983faf7 100644
--- a/system/application/views/admin/create.php
+++ b/system/application/views/admin/create.php
@@ -28,27 +28,31 @@
echo "</p>";
echo "<p>";
- echo form_label('Assessment Year Start', 'assy_start');
+ echo form_label('Currency', 'account_currency');
echo "<br />";
- echo form_input_date($assy_start);
+ echo form_input($account_currency);
echo "</p>";
echo "<p>";
- echo form_label('Assessment Year End', 'assy_end');
+ echo form_label('Date Format', 'account_date');
echo "<br />";
- echo form_input_date($assy_end);
+ echo form_dropdown('account_date', $account_date_options, $account_date);
echo "</p>";
echo "<p>";
- echo form_label('Currency', 'account_currency');
+ echo form_label('Assessment Year Start', 'assy_start');
echo "<br />";
- echo form_input($account_currency);
+ echo form_input_date($assy_start);
+ echo "<br />";
+ echo "<span class=\"form-help-text\">Warning : Assessment Year Start cannot be changed later</span>";
echo "</p>";
echo "<p>";
- echo form_label('Date Format', 'account_date');
+ echo form_label('Assessment Year End', 'assy_end');
echo "<br />";
- echo form_dropdown('account_date', $account_date_options, $account_date);
+ echo form_input_date($assy_end);
+ echo "<br />";
+ echo "<span class=\"form-help-text\">Warning : Assessment Year End cannot be changed later</span>";
echo "</p>";
echo "<p>";
diff --git a/system/application/views/setting/account.php b/system/application/views/setting/account.php
index d9783bb..a4a5647 100644
--- a/system/application/views/setting/account.php
+++ b/system/application/views/setting/account.php
@@ -20,27 +20,27 @@
echo "</p>";
echo "<p>";
- echo form_label('Assessment Year Start', 'assy_start');
+ echo form_label('Currency', 'account_currency');
echo "<br />";
- echo form_input_date($assy_start);
+ echo form_input($account_currency);
echo "</p>";
echo "<p>";
- echo form_label('Assessment Year End', 'assy_end');
+ echo form_label('Date Format', 'account_date');
echo "<br />";
- echo form_input_date($assy_end);
+ echo form_dropdown('account_date', $account_date_options, $account_date);
echo "</p>";
echo "<p>";
- echo form_label('Currency', 'account_currency');
+ echo form_label('Assessment Year Start', 'assy_start');
echo "<br />";
- echo form_input($account_currency);
+ echo $assy_start;
echo "</p>";
echo "<p>";
- echo form_label('Date Format', 'account_date');
+ echo form_label('Assessment Year End', 'assy_end');
echo "<br />";
- echo form_dropdown('account_date', $account_date_options, $account_date);
+ echo $assy_end;
echo "</p>";
echo "<p>";
diff --git a/system/application/views/template.php b/system/application/views/template.php
index 51a5aa8..52cb6a5 100644
--- a/system/application/views/template.php
+++ b/system/application/views/template.php
@@ -46,6 +46,7 @@ $(document).ready(function() {
maxWidth:27,
extraWidth: 1
}).superfish(); // call supersubs first, then superfish, so that subs are
+ $('.datepicker').datepick({dateFormat: '<?php echo $this->config->item('account_date_format'); ?>'});
});
</script>
commit 6657fce62702d92a46c577597795798b6fe9a5dc
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sat Dec 11 13:36:55 2010 +0530
Date Validation now uses date formats
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
diff --git a/system/application/libraries/MY_Form_validation.php b/system/application/libraries/MY_Form_validation.php
index f28ff7e..b06eef2 100644
--- a/system/application/libraries/MY_Form_validation.php
+++ b/system/application/libraries/MY_Form_validation.php
@@ -95,7 +95,23 @@ class MY_Form_validation extends CI_Form_validation {
$CI->form_validation->set_message('is_date', 'The %s is a invalid date');
- list($d, $m, $y) = explode('/', $str);
+ $current_date_format = $CI->config->item('account_date_format');
+ list($d, $m, $y) = array(0, 0, 0);
+ switch ($current_date_format)
+ {
+ case 'dd/mm/yyyy':
+ list($d, $m, $y) = explode('/', $str);
+ break;
+ case 'mm/dd/yyyy':
+ list($m, $d, $y) = explode('/', $str);
+ break;
+ case 'yyyy/mm/dd':
+ list($y, $m, $d) = explode('/', $str);
+ break;
+ default:
+ $CI->messages->add('Invalid date format. Please check your account settings', 'error');
+ return "";
+ }
return checkdate($m , $d, $y) ? TRUE : FALSE;
}
commit 054e55cfe9a6c3f7ad2f54683beeb1cab2152770
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sat Dec 11 12:29:39 2010 +0530
Updated date helper to support the date formats
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
diff --git a/system/application/helpers/MY_date_helper.php b/system/application/helpers/MY_date_helper.php
index 0bbdfb2..ea40c07 100644
--- a/system/application/helpers/MY_date_helper.php
+++ b/system/application/helpers/MY_date_helper.php
@@ -4,20 +4,77 @@ if ( ! function_exists('date_php_to_mysql'))
{
function date_php_to_mysql($dt)
{
- list($d, $m, $y) = explode('/', $dt);
+ $CI =& get_instance();
+ $current_date_format = $CI->config->item('account_date_format');
+ list($d, $m, $y) = array(0, 0, 0);
+ switch ($current_date_format)
+ {
+ case 'dd/mm/yyyy':
+ list($d, $m, $y) = explode('/', $dt);
+ break;
+ case 'mm/dd/yyyy':
+ list($m, $d, $y) = explode('/', $dt);
+ break;
+ case 'yyyy/mm/dd':
+ list($y, $m, $d) = explode('/', $dt);
+ break;
+ default:
+ $CI->messages->add('Invalid date format. Please check your account settings', 'error');
+ return "";
+ }
$ts = mktime(0, 0, 0, $m, $d, $y);
return date('Y-m-d H:i:s', $ts);
}
+}
+if ( ! function_exists('date_mysql_to_php'))
+{
function date_mysql_to_php($dt)
{
$ts = human_to_unix($dt);
- return date('d/m/Y', $ts);
+ $CI =& get_instance();
+ $current_date_format = $CI->config->item('account_date_format');
+ switch ($current_date_format)
+ {
+ case 'dd/mm/yyyy':
+ return date('d/m/Y', $ts);
+ break;
+ case 'mm/dd/yyyy':
+ return date('m/d/Y', $ts);
+ break;
+ case 'yyyy/mm/dd':
+ return date('Y/m/d', $ts);
+ break;
+ default:
+ $CI->messages->add('Invalid date format. Please check your account settings', 'error');
+ return "";
+ }
+ return;
}
+}
+if ( ! function_exists('date_today_php'))
+{
function date_today_php()
{
- return date('d/m/Y');
+ $CI =& get_instance();
+ $current_date_format = $CI->config->item('account_date_format');
+ switch ($current_date_format)
+ {
+ case 'dd/mm/yyyy':
+ return date('d/m/Y');
+ break;
+ case 'mm/dd/yyyy':
+ return date('m/d/Y');
+ break;
+ case 'yyyy/mm/dd':
+ return date('Y/m/d');
+ break;
+ default:
+ $CI->messages->add('Invalid date format. Please check your account settings', 'error');
+ return "";
+ }
+ return;
}
}
commit 578c7db6ac70c4b9f5d0eba881d09820bceac44c
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sat Dec 11 12:14:28 2010 +0530
Added date selection option when creating and updating account
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
diff --git a/system/application/controllers/admin/create.php b/system/application/controllers/admin/create.php
index 456a742..800103f 100644
--- a/system/application/controllers/admin/create.php
+++ b/system/application/controllers/admin/create.php
@@ -75,13 +75,12 @@ class Create extends Controller {
'size' => '10',
'value' => '',
);
- $data['account_date'] = array(
- 'name' => 'account_date',
- 'id' => 'account_date',
- 'maxlength' => '20',
- 'size' => '10',
- 'value' => '',
+ $data['account_date_options'] = array(
+ 'dd/mm/yyyy' => 'Day / Month / Year',
+ 'mm/dd/yyyy' => 'Month / Day / Year',
+ 'yyyy/mm/dd' => 'Year / Month / Day',
);
+ $data['account_date'] = 'dd/mm/yyyy';
$data['account_timezone'] = 'UTC';
$data['database_name'] = array(
@@ -133,7 +132,7 @@ class Create extends Controller {
$this->form_validation->set_rules('assy_start', 'Assessment Year Start', 'trim|required|is_date');
$this->form_validation->set_rules('assy_end', 'Assessment Year End', 'trim|required|is_date');
$this->form_validation->set_rules('account_currency', 'Currency', 'trim|max_length[10]');
- $this->form_validation->set_rules('account_date', 'Date', 'trim|max_length[30]');
+ $this->form_validation->set_rules('account_date', 'Date', 'trim|max_length[10]');
$this->form_validation->set_rules('account_timezone', 'Timezone', 'trim|max_length[6]');
@@ -150,7 +149,7 @@ class Create extends Controller {
$data['assy_start']['value'] = $this->input->post('assy_start', TRUE);
$data['assy_end']['value'] = $this->input->post('assy_end', TRUE);
$data['account_currency']['value'] = $this->input->post('account_currency', TRUE);
- $data['account_date']['value'] = $this->input->post('account_date', TRUE);
+ $data['account_date'] = $this->input->post('account_date', TRUE);
$data['account_timezone'] = $this->input->post('account_timezone', TRUE);
$data['create_database'] = $this->input->post('create_database', TRUE);
@@ -178,7 +177,16 @@ class Create extends Controller {
$data_assy_start = date_php_to_mysql($this->input->post('assy_start', TRUE));
$data_assy_end = date_php_to_mysql($this->input->post('assy_end', TRUE));
$data_account_currency = $this->input->post('account_currency', TRUE);
- $data_account_date = $this->input->post('account_date', TRUE);
+ $data_account_date_form = $this->input->post('account_date', TRUE);
+ /* Checking for valid format */
+ if ($data_account_date_form == "dd/mm/yyyy")
+ $data_account_date = "dd/mm/yyyy";
+ else if ($data_account_date_form == "mm/dd/yyyy")
+ $data_account_date = "mm/dd/yyyy";
+ else if ($data_account_date_form == "yyyy/mm/dd")
+ $data_account_date = "yyyy/mm/dd";
+ else
+ $data_account_date = "dd/mm/yyyy";
$data_account_timezone = $this->input->post('timezones', TRUE);
$data_database_host = $this->input->post('database_host', TRUE);
diff --git a/system/application/controllers/setting.php b/system/application/controllers/setting.php
index 347e334..fdcf151 100644
--- a/system/application/controllers/setting.php
+++ b/system/application/controllers/setting.php
@@ -75,13 +75,12 @@ class Setting extends Controller {
'size' => '10',
'value' => ($account_data) ? echo_value($account_data->currency_symbol) : '',
);
- $data['account_date'] = array(
- 'name' => 'account_date',
- 'id' => 'account_date',
- 'maxlength' => '20',
- 'size' => '10',
- 'value' => ($account_data) ? echo_value($account_data->date_format) : '',
+ $data['account_date_options'] = array(
+ 'dd/mm/yyyy' => 'Day / Month / Year',
+ 'mm/dd/yyyy' => 'Month / Day / Year',
+ 'yyyy/mm/dd' => 'Year / Month / Day',
);
+ $data['account_date'] = ($account_data) ? echo_value($account_data->date_format) : 'dd/mm/yyyy';
$data['account_timezone'] = ($account_data) ? echo_value($account_data->timezone) : 'UTC';
/* Form validations */
@@ -91,7 +90,7 @@ class Setting extends Controller {
$this->form_validation->set_rules('assy_start', 'Assessment Year Start', 'trim|required|is_date');
$this->form_validation->set_rules('assy_end', 'Assessment Year End', 'trim|required|is_date');
$this->form_validation->set_rules('account_currency', 'Currency', 'trim|max_length[10]');
- $this->form_validation->set_rules('account_date', 'Date', 'trim|max_length[30]');
+ $this->form_validation->set_rules('account_date', 'Date', 'trim|max_length[10]');
$this->form_validation->set_rules('account_timezone', 'Timezone', 'trim|max_length[6]');
/* Repopulating form */
@@ -103,7 +102,7 @@ class Setting extends Controller {
$data['assy_start']['value'] = $this->input->post('assy_start', TRUE);
$data['assy_end']['value'] = $this->input->post('assy_end', TRUE);
$data['account_currency']['value'] = $this->input->post('account_currency', TRUE);
- $data['account_date']['value'] = $this->input->post('account_date', TRUE);
+ $data['account_date'] = $this->input->post('account_date', TRUE);
$data['account_timezone'] = $this->input->post('account_timezone', TRUE);
}
@@ -122,7 +121,16 @@ class Setting extends Controller {
$data_assy_start = date_php_to_mysql($this->input->post('assy_start', TRUE));
$data_assy_end = date_php_to_mysql($this->input->post('assy_end', TRUE));
$data_account_currency = $this->input->post('account_currency', TRUE);
- $data_account_date = $this->input->post('account_date', TRUE);
+ $data_account_date_form = $this->input->post('account_date', TRUE);
+ /* Checking for valid format */
+ if ($data_account_date_form == "dd/mm/yyyy")
+ $data_account_date = "dd/mm/yyyy";
+ else if ($data_account_date_form == "mm/dd/yyyy")
+ $data_account_date = "mm/dd/yyyy";
+ else if ($data_account_date_form == "yyyy/mm/dd")
+ $data_account_date = "yyyy/mm/dd";
+ else
+ $data_account_date = "dd/mm/yyyy";
$data_account_timezone = $this->input->post('timezones', TRUE);
/* Verify if current settings exist. If not add new settings */
diff --git a/system/application/helpers/custom_helper.php b/system/application/helpers/custom_helper.php
index d16070b..07ace36 100644
--- a/system/application/helpers/custom_helper.php
+++ b/system/application/helpers/custom_helper.php
@@ -52,34 +52,6 @@ if ( ! function_exists('echo_value'))
}
/**
- * Return Account Information
- *
- * Return the account information
- *
- * @access public
- * @param a varaible
- * @return string value
- */
-if ( ! function_exists('account_info_str'))
-{
- function account_info_str()
- {
- $html = "";
- $CI =& get_instance();
- $company_q = $CI->db->query('SELECT * FROM settings WHERE id = 1');
- if ($company_info = $company_q->row())
- {
- $html .= $company_info->name;
- $html .= "<br />";
- $html .= date_mysql_to_php($company_info->ay_start);
- $html .= " - ";
- $html .= date_mysql_to_php($company_info->ay_end);
- }
- return $html;
- }
-}
-
-/**
* Return Voucher Type String from Number
*
* Return the account information
diff --git a/system/application/views/admin/create.php b/system/application/views/admin/create.php
index 8d93454..f8e548f 100644
--- a/system/application/views/admin/create.php
+++ b/system/application/views/admin/create.php
@@ -48,7 +48,7 @@
echo "<p>";
echo form_label('Date Format', 'account_date');
echo "<br />";
- echo form_input($account_date);
+ echo form_dropdown('account_date', $account_date_options, $account_date);
echo "</p>";
echo "<p>";
diff --git a/system/application/views/setting/account.php b/system/application/views/setting/account.php
index 70687b4..d9783bb 100644
--- a/system/application/views/setting/account.php
+++ b/system/application/views/setting/account.php
@@ -40,7 +40,7 @@
echo "<p>";
echo form_label('Date Format', 'account_date');
echo "<br />";
- echo form_input($account_date);
+ echo form_dropdown('account_date', $account_date_options, $account_date);
echo "</p>";
echo "<p>";
commit a8a3d10dcc0d2431028eba9a9f9ad768a0276d23
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Thu Dec 9 22:04:34 2010 +0530
Added beta tag
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
diff --git a/system/application/views/template.php b/system/application/views/template.php
index 51953b2..51a5aa8 100644
--- a/system/application/views/template.php
+++ b/system/application/views/template.php
@@ -54,7 +54,7 @@ $(document).ready(function() {
<div id="container">
<div id="header">
<div id="logo">
- Webzash
+ Webzash <span style="font-size:18px;color:#00000;">(beta)</span>
</div>
<div id="admin">
<?php echo anchor('admin', 'Administer', array('title' => "Administer", 'style' => 'color:#000000; text-decoration:none')); ?>
commit f16eb0895d3450f12de376ad6b2ccc2cfaa67025
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Thu Dec 9 21:44:38 2010 +0530
Added Profit and Loss Statment Download CSV
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
diff --git a/system/application/controllers/report.php b/system/application/controllers/report.php
index 4326bc2..158b366 100644
--- a/system/application/controllers/report.php
+++ b/system/application/controllers/report.php
@@ -28,6 +28,7 @@ class Report extends Controller {
function profitandloss($period = NULL)
{
$this->template->set('page_title', 'Profit And Loss Statement');
+ $this->template->set('nav_links', array('report/download/profitandloss' => 'Download CSV'));
$this->template->load('template', 'report/profitandloss');
return;
}
@@ -417,6 +418,152 @@ class Report extends Controller {
return;
}
+ /********************** PROFIT AND LOSS ***********************/
+ if ($statement == "profitandloss")
+ {
+ $this->load->library('accountlist');
+ $this->load->model('Ledger_model');
+
+ /***************** GROSS CALCULATION ******************/
+
+ /* Gross P/L : Expenses */
+ $gross_expense_total = 0;
+ $gross_expense_list_q = $this->db->query("SELECT * FROM groups WHERE parent_id = 4 AND affects_gross = 1");
+ foreach ($gross_expense_list_q->result() as $row)
+ {
+ $gross_expense = new Accountlist();
+ $gross_expense->init($row->id);
+ $gross_expense_total += $gross_expense->total;
+ $gross_exp_array = $gross_expense->build_array();
+ $gross_expense->to_csv($gross_exp_array);
+ }
+ Accountlist::add_blank_csv();
+
+ /* Gross P/L : Incomes */
+ $gross_income_total = 0;
+ $gross_income_list_q = $this->db->query("SELECT * FROM groups WHERE parent_id = 3 AND affects_gross = 1");
+ foreach ($gross_income_list_q->result() as $row)
+ {
+ $gross_income = new Accountlist();
+ $gross_income->init($row->id);
+ $gross_income_total += $gross_income->total;
+ $gross_inc_array = $gross_income->build_array();
+ $gross_income->to_csv($gross_inc_array);
+ }
+
+ Accountlist::add_blank_csv();
+ Accountlist::add_blank_csv();
+
+ /* Converting to positive value since Cr */
+ $gross_income_total = -$gross_income_total;
+
+ /* Calculating Gross P/L */
+ $grosspl = $gross_income_total - $gross_expense_total;
+
+ /* Showing Gross P/L : Expenses */
+ $grosstotal = $gross_expense_total;
+ Accountlist::add_row_csv(array("Total Gross Expenses", convert_cur($gross_expense_total)));
+ if ($grosspl > 0)
+ {
+ $grosstotal += $grosspl;
+ Accountlist::add_row_csv(array("Gross Profit C/O", convert_cur($grosspl)));
+ }
+ Accountlist::add_row_csv(array("Total Expenses - Gross", convert_cur($grosstotal)));
+
+ /* Showing Gross P/L : Incomes */
+ $grosstotal = $gross_income_total;
+ Accountlist::add_row_csv(array("Total Gross Incomes", convert_cur($gross_income_total)));
+
+ if ($grosspl > 0)
+ {
+
+ } else if ($grosspl < 0) {
+ $grosstotal += -$grosspl;
+ Accountlist::add_row_csv(array("Gross Loss C/O", convert_cur(-$grosspl)));
+ }
+ Accountlist::add_row_csv(array("Total Incomes - Gross", convert_cur($grosstotal)));
+
+ /************************* NET CALCULATIONS ***************************/
+
+ Accountlist::add_blank_csv();
+ Accountlist::add_blank_csv();
+
+ /* Net P/L : Expenses */
+ $net_expense_total = 0;
+ $net_expense_list_q = $this->db->query("SELECT * FROM groups WHERE parent_id = 4 AND affects_gross != 1");
+
+ foreach ($net_expense_list_q->result() as $row)
+ {
+ $net_expense = new Accountlist();
+ $net_expense->init($row->id);
+ $net_expense_total += $net_expense->total;
+ $net_exp_array = $net_expense->build_array();
+ $net_expense->to_csv($net_exp_array);
+ }
+ Accountlist::add_blank_csv();
+
+ /* Net P/L : Incomes */
+ $net_income_total = 0;
+ $net_income_list_q = $this->db->query("SELECT * FROM groups WHERE parent_id = 3 AND affects_gross != 1");
+ foreach ($net_income_list_q->result() as $row)
+ {
+ $net_income = new Accountlist();
+ $net_income->init($row->id);
+ $net_income_total += $net_income->total;
+ $net_inc_array = $net_income->build_array();
+ $net_income->to_csv($net_inc_array);
+ }
+
+ Accountlist::add_blank_csv();
+ Accountlist::add_blank_csv();
+
+ /* Converting to positive value since Cr */
+ $net_income_total = -$net_income_total;
+
+ /* Calculating Net P/L */
+ $netpl = $net_income_total - $net_expense_total + $grosspl;
+
+ /* Showing Net P/L : Expenses */
+ $nettotal = $net_expense_total;
+ Accountlist::add_row_csv(array("Total Expenses", convert_cur($nettotal)));
+
+ if ($grosspl > 0)
+ {
+ } else if ($grosspl < 0) {
+ $nettotal += -$grosspl;
+ Accountlist::add_row_csv(array("Gross Loss B/F", convert_cur(-$grosspl)));
+ }
+ if ($netpl > 0)
+ {
+ $nettotal += $netpl;
+ Accountlist::add_row_csv(array("Net Profit", convert_cur($netpl)));
+ }
+ Accountlist::add_row_csv(array("Total - Net Expenses", convert_cur($nettotal)));
+
+ /* Showing Net P/L : Incomes */
+ $nettotal = $net_income_total;
+ Accountlist::add_row_csv(array("Total Incomes", convert_cur($nettotal)));
+
+ if ($grosspl > 0)
+ {
+ $nettotal += $grosspl;
+ Accountlist::add_row_csv(array("Gross Profit B/F", convert_cur($grosspl)));
+ }
+
+ if ($netpl > 0)
+ {
+
+ } else if ($netpl < 0) {
+ $nettotal += -$netpl;
+ Accountlist::add_row_csv(array("Net Loss", convert_cur(-$netpl)));
+ }
+ Accountlist::add_row_csv(array("Total - Net Incomes", convert_cur($nettotal)));
+
+ $balancesheet = Accountlist::get_csv();
+ $this->load->helper('csv');
+ echo array_to_csv($balancesheet, "profitandloss.csv");
+ return;
+ }
return;
}
}
commit b733db9d8195cb38a4d6bbb86cdcb650c88dfed5
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Thu Dec 9 19:46:41 2010 +0530
Added Balance Sheet Download CSV
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
diff --git a/system/application/controllers/report.php b/system/application/controllers/report.php
index eb0ea64..4326bc2 100644
--- a/system/application/controllers/report.php
+++ b/system/application/controllers/report.php
@@ -20,6 +20,7 @@ class Report extends Controller {
function balancesheet($period = NULL)
{
$this->template->set('page_title', 'Balance Sheet');
+ $this->template->set('nav_links', array('report/download/balancesheet' => 'Download CSV'));
$this->template->load('template', 'report/balancesheet');
return;
}
@@ -323,6 +324,99 @@ class Report extends Controller {
echo array_to_csv($ledgerst, "ledgerst.csv");
return;
}
+
+ /************************ BALANCE SHEET ***********************/
+ if ($statement == "balancesheet")
+ {
+ $this->load->library('accountlist');
+ $this->load->model('Ledger_model');
+
+ $liability = new Accountlist();
+ $liability->init(2);
+ $liability_array = $liability->build_array();
+ $liability_depth = Accountlist::$max_depth;
+ $liability_total = -$liability->total;
+
+ Accountlist::reset_max_depth();
+
+ $asset = new Accountlist();
+ $asset->init(1);
+ $asset_array = $asset->build_array();
+ $asset_depth = Accountlist::$max_depth;
+ $asset_total = $asset->total;
+
+ $liability->to_csv($liability_array);
+ Accountlist::add_blank_csv();
+ $asset->to_csv($asset_array);
+
+ $income = new Accountlist();
+ $income->init(3);
+ $expense = new Accountlist();
+ $expense->init(4);
+ $income_total = -$income->total;
+ $expense_total = $expense->total;
+ $pandl = $income_total - $expense_total;
+ $diffop = $this->Ledger_model->get_diff_op_balance();
+
+ Accountlist::add_blank_csv();
+ /* Liability side */
+ $total = $liability_total;
+ Accountlist::add_row_csv(array("Liability Total", convert_cur($liability_total)));
+
+ /* If Profit then Liability side, If Loss then Asset side */
+ if ($pandl != 0)
+ {
+ if ($pandl > 0)
+ {
+ $total += $pandl;
+ Accountlist::add_row_csv(array("Profit & Loss A/C (Net Profit)", convert_cur($pandl)));
+ }
+ }
+
+ /* If Op balance Dr then Liability side, If Op balance Cr then Asset side */
+ if ($diffop != 0)
+ {
+ if ($diffop > 0)
+ {
+ $total += $diffop;
+ Accountlist::add_row_csv(array("Diff in O/P Balance", "Dr " . convert_cur($diffop)));
+ }
+ }
+
+ Accountlist::add_row_csv(array("Total - Liabilities", convert_cur($total)));
+
+ /* Asset side */
+ $total = $asset_total;
+ Accountlist::add_row_csv(array("Asset Total", convert_cur($asset_total)));
+
+ /* If Profit then Liability side, If Loss then Asset side */
+ if ($pandl != 0)
+ {
+ if ($pandl < 0)
+ {
+ $total += -$pandl;
+ Accountlist::add_row_csv(array("Profit & Loss A/C (Net Loss)", convert_cur(-$pandl)));
+ }
+ }
+
+ /* If Op balance Dr then Liability side, If Op balance Cr then Asset side */
+ if ($diffop != 0)
+ {
+ if ($diffop < 0)
+ {
+ $total += -$diffop;
+ Accountlist::add_row_csv(array("Diff in O/P Balance", "Cr " . convert_cur(-$diffop)));
+ }
+ }
+
+ Accountlist::add_row_csv(array("Total - Assets", convert_cur($total)));
+
+ $balancesheet = Accountlist::get_csv();
+ $this->load->helper('csv');
+ echo array_to_csv($balancesheet, "balancesheet.csv");
+ return;
+ }
+
return;
}
}
diff --git a/system/application/libraries/Accountlist.php b/system/application/libraries/Accountlist.php
index 2540064..22bc6c2 100644
--- a/system/application/libraries/Accountlist.php
+++ b/system/application/libraries/Accountlist.php
@@ -10,6 +10,10 @@ class Accountlist
var $children_groups = array();
var $children_ledgers = array();
var $counter = 0;
+ public static $temp_max = 0;
+ public static $max_depth = 0;
+ public static $csv_data = array();
+ public static $csv_row = 0;
function Accountlist()
{
@@ -197,6 +201,7 @@ class Accountlist
$this->counter--;
}
}
+
function print_space($count)
{
$html = "";
@@ -206,5 +211,161 @@ class Accountlist
}
return $html;
}
+
+ /* Build a array of groups and ledgers */
+ function build_array()
+ {
+ $item = array(
+ 'id' => $this->id,
+ 'name' => $this->name,
+ 'type' => "G",
+ 'total' => $this->total,
+ 'child_groups' => array(),
+ 'child_ledgers' => array(),
+ 'depth' => self::$temp_max,
+ );
+ $local_counter = 0;
+ if (count($this->children_groups) > 0)
+ {
+ self::$temp_max++;
+ if (self::$temp_max > self::$max_depth)
+ self::$max_depth = self::$temp_max;
+ foreach ($this->children_groups as $id => $data)
+ {
+ $item['child_groups'][$local_counter] = $data->build_array();
+ $local_counter++;
+ }
+ self::$temp_max--;
+ }
+ $local_counter = 0;
+ if (count($this->children_ledgers) > 0)
+ {
+ self::$temp_max++;
+ foreach ($this->children_ledgers as $id => $data)
+ {
+ $item['child_ledgers'][$local_counter] = array(
+ 'id' => $data['id'],
+ 'name' => $data['name'],
+ 'type' => "L",
+ 'total' => $data['total'],
+ 'child_groups' => array(),
+ 'child_ledgers' => array(),
+ 'depth' => self::$temp_max,
+ );
+ $local_counter++;
+ }
+ self::$temp_max--;
+ }
+ return $item;
+ }
+
+ /* Show array of groups and ledgers as created by build_array() method */
+ function show_array($data)
+ {
+ echo "<tr>";
+ echo "<td>";
+ echo $this->print_space($data['depth']);
+ echo $data['depth'] . "-";
+ echo $data['id'];
+ echo $data['name'];
+ echo $data['type'];
+ echo $data['total'];
+ if ($data['child_ledgers'])
+ {
+ foreach ($data['child_ledgers'] as $id => $ledger_data)
+ {
+ $this->show_array($ledger_data);
+ }
+ }
+ if ($data['child_groups'])
+ {
+ foreach ($data['child_groups'] as $id => $group_data)
+ {
+ $this->show_array($group_data);
+ }
+ }
+ echo "</td>";
+ echo "</tr>";
+ }
+
+ function to_csv($data)
+ {
+ $counter = 0;
+ while ($counter < $data['depth'])
+ {
+ self::$csv_data[self::$csv_row][$counter] = "";
+ $counter++;
+ }
+
+ self::$csv_data[self::$csv_row][$counter] = $data['name'];
+ $counter++;
+
+ while ($counter < self::$max_depth + 3)
+ {
+ self::$csv_data[self::$csv_row][$counter] = "";
+ $counter++;
+ }
+ self::$csv_data[self::$csv_row][$counter] = $data['type'];
+ $counter++;
+
+ if ($data['total'] == 0)
+ {
+ self::$csv_data[self::$csv_row][$counter] = "";
+ $counter++;
+ self::$csv_data[self::$csv_row][$counter] = "";
+ } else if ($data['total'] < 0) {
+ self::$csv_data[self::$csv_row][$counter] = "Cr";
+ $counter++;
+ self::$csv_data[self::$csv_row][$counter] = -$data['total'];
+ } else {
+ self::$csv_data[self::$csv_row][$counter] = "Dr";
+ $counter++;
+ self::$csv_data[self::$csv_row][$counter] = $data['total'];
+ }
+
+ if ($data['child_ledgers'])
+ {
+ foreach ($data['child_ledgers'] as $id => $ledger_data)
+ {
+ self::$csv_row++;
+ $this->to_csv($ledger_data);
+ }
+ }
+ if ($data['child_groups'])
+ {
+ foreach ($data['child_groups'] as $id => $group_data)
+ {
+ self::$csv_row++;
+ $this->to_csv($group_data);
+ }
+ }
+ }
+
+ public static function get_csv()
+ {
+ return self::$csv_data;
+ }
+
+ public static function add_blank_csv()
+ {
+ self::$csv_row++;
+ self::$csv_data[self::$csv_row] = array("", "");
+ self::$csv_row++;
+ self::$csv_data[self::$csv_row] = array("", "");
+ return;
+ }
+
+ public static function add_row_csv($row = array(""))
+ {
+ self::$csv_row++;
+ self::$csv_data[self::$csv_row] = $row;
+ return;
+ }
+
+ public static function reset_max_depth()
+ {
+ self::$max_depth = 0;
+ self::$temp_max = 0;
+ }
}
commit e47e0d171baa478eeb7a2d66994d77874d98798e
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Thu Dec 9 14:40:10 2010 +0530
Added Voucher prefix database columns
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
diff --git a/system/application/controllers/admin/carryforward.sql b/system/application/controllers/admin/carryforward.sql
index 06a53f6..deeaa2f 100644
--- a/system/application/controllers/admin/carryforward.sql
+++ b/system/application/controllers/admin/carryforward.sql
@@ -42,6 +42,11 @@ CREATE TABLE IF NOT EXISTS settings (
print_page_format varchar(1) NOT NULL,
print_page_layout text NOT NULL,
print_logo varchar(255) NOT NULL,
+ receipt_voucher_prefix varchar(10) NOT NULL,
+ payment_voucher_prefix varchar(10) NOT NULL,
+ contra_voucher_prefix varchar(10) NOT NULL,
+ journal_voucher_prefix varchar(10) NOT NULL,
+ voucher_number_padding int(5) NOT NULL,
database_version int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC;
diff --git a/system/application/controllers/admin/database.sql b/system/application/controllers/admin/database.sql
index 7ae97d2..6e03ff0 100644
--- a/system/application/controllers/admin/database.sql
+++ b/system/application/controllers/admin/database.sql
@@ -42,6 +42,11 @@ CREATE TABLE IF NOT EXISTS settings (
print_page_format varchar(1) NOT NULL,
print_page_layout text NOT NULL,
print_logo varchar(255) NOT NULL,
+ receipt_voucher_prefix varchar(10) NOT NULL,
+ payment_voucher_prefix varchar(10) NOT NULL,
+ contra_voucher_prefix varchar(10) NOT NULL,
+ journal_voucher_prefix varchar(10) NOT NULL,
+ voucher_number_padding int(5) NOT NULL,
database_version int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC;
commit 0d8655deb3f5fa8d2d04e2062ab1704988651c4f
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Wed Dec 8 23:02:42 2010 +0530
Added Ledger Statment Download CSV
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
diff --git a/system/application/controllers/report.php b/system/application/controllers/report.php
index 6c97fc6..eb0ea64 100644
--- a/system/application/controllers/report.php
+++ b/system/application/controllers/report.php
@@ -47,6 +47,9 @@ class Report extends Controller {
$this->load->library('pagination');
$this->template->set('page_title', 'Ledger Statement');
+ if ($ledger_id != 0)
+ $this->template->set('nav_links', array('report/download/ledgerst/' . $ledger_id => 'Download CSV'));
+
if ($_POST)
{
$ledger_id = $this->input->post('ledger_id', TRUE);
@@ -59,6 +62,7 @@ class Report extends Controller {
function download($statement, $id = NULL)
{
+ /********************** TRIAL BALANCE *************************/
if ($statement == "trialbalance")
{
$this->load->model('Ledger_model');
@@ -68,6 +72,11 @@ class Report extends Controller {
$temp_dr_total = 0;
$temp_cr_total = 0;
+ $trialbalance[$counter] = array ("TRIAL BALANCE", "", "", "", "", "", "", "", "");
+ $counter++;
+ $trialbalance[$counter] = array ("AY " . date_mysql_to_php($this->config->item('account_ay_start')) . " - " . date_mysql_to_php($this->config->item('account_ay_end')), "", "", "", "", "", "", "", "");
+ $counter++;
+
$trialbalance[$counter][0]= "Ledger";
$trialbalance[$counter][1]= "";
$trialbalance[$counter][2]= "Opening";
@@ -158,6 +167,162 @@ class Report extends Controller {
echo array_to_csv($trialbalance, "trialbalance.csv");
return;
}
+
+ /********************** LEDGER STATEMENT **********************/
+ if ($statement == "ledgerst")
+ {
+ $ledger_id = (int)$this->uri->segment(4);
+ if ($ledger_id < 1)
+ return;
+
+ $this->load->model('Ledger_model');
+ $cur_balance = 0;
+ $counter = 0;
+ $ledgerst = array();
+
+ $ledgerst[$counter] = array ("", "", "LEDGER STATEMENT FOR " . strtoupper($this->Ledger_model->get_name($ledger_id)), "", "", "", "", "", "", "", "");
+ $counter++;
+ $ledgerst[$counter] = array ("", "", "AY " . date_mysql_to_php($this->config->item('account_ay_start')) . " - " . date_mysql_to_php($this->config->item('account_ay_end')), "", "", "", "", "", "", "", "");
+ $counter++;
+
+ $ledgerst[$counter][0]= "Date";
+ $ledgerst[$counter][1]= "Number";
+ $ledgerst[$counter][2]= "Ledger Name";
+ $ledgerst[$counter][3]= "Status";
+ $ledgerst[$counter][4]= "Type";
+ $ledgerst[$counter][5]= "";
+ $ledgerst[$counter][6]= "Dr Amount";
+ $ledgerst[$counter][7]= "";
+ $ledgerst[$counter][8]= "Cr Amount";
+ $ledgerst[$counter][9]= "";
+ $ledgerst[$counter][10]= "Balance";
+ $counter++;
+
+ /* Opening Balance */
+ list ($opbalance, $optype) = $this->Ledger_model->get_op_balance($ledger_id);
+ $ledgerst[$counter] = array ("Opening Balance", "", "", "", "", "", "", "", "", convert_dc($optype), $opbalance);
+ if ($optype == "D")
+ $cur_balance += $opbalance;
+ else
+ $cur_balance -= $opbalance;
+ $counter++;
+
+ $ledgerst_q = $this->db->query("SELECT vouchers.id as vid, vouchers.number as vnumber, vouchers.date as vdate, vouchers.draft as vdraft, vouchers.type as vtype, voucher_items.amount as lamount, voucher_items.dc as ldc FROM vouchers join voucher_items on vouchers.id = voucher_items.voucher_id WHERE voucher_items.ledger_id = ? ORDER BY vouchers.date ASC, vouchers.number ASC", array($ledger_id));
+ foreach ($ledgerst_q->result() as $row)
+ {
+ $ledgerst[$counter][0] = date_mysql_to_php($row->vdate);
+ $ledgerst[$counter][1] = $row->vid;
+
+ /* Opposite voucher name */
+ if ($row->ldc == "D")
+ {
+
+ if ($opp_voucher_name_q = $this->db->query("SELECT * FROM voucher_items WHERE voucher_id = ? AND dc = ?", array($row->vid, "C")))
+ {
+ $opp_voucher_name_d = $opp_voucher_name_q->row();
+ $opp_ledger_name = $this->Ledger_model->get_name($opp_voucher_name_d->ledger_id);
+ if ($opp_voucher_name_q->num_rows() > 1)
+ {
+ $ledgerst[$counter][2] = "(" . $opp_ledger_name . ")";
+ } else {
+ $ledgerst[$counter][2] = $opp_ledger_name;
+ }
+ }
+ } else {
+ if ($opp_voucher_name_q = $this->db->query("SELECT * FROM voucher_items WHERE voucher_id = ? AND dc = ?", array($row->vid, "D")))
+ {
+ $opp_voucher_name_d = $opp_voucher_name_q->row();
+ $opp_ledger_name = $this->Ledger_model->get_name($opp_voucher_name_d->ledger_id);
+ if ($opp_voucher_name_q->num_rows() > 1)
+ {
+ $ledgerst[$counter][2] = "(" . $opp_ledger_name . ")";
+ } else {
+ $ledgerst[$counter][2] = $opp_ledger_name;
+ }
+ }
+
+ }
+
+ $ledgerst[$counter][3] = ($row->vdraft == 1) ? "Draft" : "Active";
+ $ledgerst[$counter][4] = ucfirst(n_to_v($row->vtype));
+
+ if ($row->ldc == "D")
+ {
+ if ($row->vdraft == 0)
+ $cur_balance += $row->lamount;
+ $ledgerst[$counter][5] = convert_dc($row->ldc);
+ $ledgerst[$counter][6] = $row->lamount;
+ $ledgerst[$counter][7] = "";
+ $ledgerst[$counter][8] = "";
+
+ } else {
+ if ($row->vdraft == 0)
+ $cur_balance -= $row->lamount;
+ $ledgerst[$counter][5] = "";
+ $ledgerst[$counter][6] = "";
+ $ledgerst[$counter][7] = convert_dc($row->ldc);
+ $ledgerst[$counter][8] = $row->lamount;
+ }
+
+ if ($row->vdraft == 0)
+ {
+ if ($cur_balance == 0)
+ {
+ $ledgerst[$counter][9] = "";
+ $ledgerst[$counter][10] = 0;
+ } else if ($cur_balance < 0) {
+ $ledgerst[$counter][9] = "Cr";
+ $ledgerst[$counter][10] = convert_cur(-$cur_balance);
+ } else {
+ $ledgerst[$counter][9] = "Dr";
+ $ledgerst[$counter][10] = convert_cur($cur_balance);
+ }
+ } else {
+ $ledgerst[$counter][9] = "";
+ $ledgerst[$counter][10] = "";
+ }
+ $counter++;
+ }
+
+ $ledgerst[$counter][0]= "Closing Balance";
+ $ledgerst[$counter][1]= "";
+ $ledgerst[$counter][2]= "";
+ $ledgerst[$counter][3]= "";
+ $ledgerst[$counter][4]= "";
+ $ledgerst[$counter][5]= "";
+ $ledgerst[$counter][6]= "";
+ $ledgerst[$counter][7]= "";
+ $ledgerst[$counter][8]= "";
+ if ($cur_balance < 0)
+ {
+ $ledgerst[$counter][9]= "Cr";
+ $ledgerst[$counter][10]= convert_cur(-$cur_balance);
+ } else {
+ $ledgerst[$counter][9]= "Dr";
+ $ledgerst[$counter][10]= convert_cur($cur_balance);
+ }
+ $counter++;
+
+ $ledgerst[$counter] = array ("", "", "", "", "", "", "", "", "", "", "");
+ $counter++;
+
+ /* Final Opening and Closing Balance */
+ $clbalance = $this->Ledger_model->get_ledger_balance($ledger_id);
+
+ $ledgerst[$counter] = array ("Opening Balance", convert_dc($optype), $opbalance, "", "", "", "", "", "", "", "");
+ $counter++;
+
+ if ($clbalance == 0)
+ $ledgerst[$counter] = array ("Closing Balance", "", 0, "", "", "", "", "", "", "", "");
+ else if ($clbalance < 0)
+ $ledgerst[$counter] = array ("Closing Balance", "Cr", convert_cur(-$clbalance), "", "", "", "", "", "", "", "");
+ else
+ $ledgerst[$counter] = array ("Closing Balance", "Dr", convert_cur($clbalance), "", "", "", "", "", "", "", "");
+
+ $this->load->helper('csv');
+ echo array_to_csv($ledgerst, "ledgerst.csv");
+ return;
+ }
return;
}
}
commit 3c97d01daaf6ae25d520d8cb3a4662172247532a
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Wed Dec 8 21:58:16 2010 +0530
Added README.txt file
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
diff --git a/README.txt b/README.txt
new file mode 100644
index 0000000..9e8d2a0
--- /dev/null
+++ b/README.txt
@@ -0,0 +1,22 @@
+Webzash - Easy to use web based double entry accounting software
+================================================================
+
+http://webzash.org
+http://webzash.wordpress.com
+
+Webzash is a web based double entry accouting software written in PHP - CodeIgniter and uses MySQL as database backend.
+
+It is licensed under GNU Affero General Public License, version 3.
+http://www.gnu.org/licenses/agpl-3.0.txt
+
+Features include
+- No setup required
+- Works on Shared Hosting environment
+- Very easy to use
+- Community driven
+- Support for multiple accounts
+- Support for DRAFT vouchers
+- Support for colored tags
+- Reports include balance sheet, profit and loss statement, trial balance, ledger statement
+
+Note : Webzash includes works under other copyright notices and distributed according to the terms of the GNU General Public License or a compatible license
commit ca1bf4c51091ebd5f99fbd93a6215b84646abcd8
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Wed Dec 8 21:43:10 2010 +0530
Added Trial Balance Download CSV
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
diff --git a/system/application/controllers/report.php b/system/application/controllers/report.php
index 43e8269..6c97fc6 100644
--- a/system/application/controllers/report.php
+++ b/system/application/controllers/report.php
@@ -34,10 +34,10 @@ class Report extends Controller {
function trialbalance($period = NULL)
{
$this->template->set('page_title', 'Trial Balance');
+ $this->template->set('nav_links', array('report/download/trialbalance' => 'Download CSV'));
+
$this->load->library('accountlist');
- $a = new Accountlist(0);
- $data['a'] = $a;
- $this->template->load('template', 'report/trialbalance', $data);
+ $this->template->load('template', 'report/trialbalance');
return;
}
@@ -56,6 +56,110 @@ class Report extends Controller {
$this->template->load('template', 'report/ledgerst', $data);
return;
}
+
+ function download($statement, $id = NULL)
+ {
+ if ($statement == "trialbalance")
+ {
+ $this->load->model('Ledger_model');
+ $all_ledgers = $this->Ledger_model->get_all_ledgers();
+ $counter = 0;
+ $trialbalance = array();
+ $temp_dr_total = 0;
+ $temp_cr_total = 0;
+
+ $trialbalance[$counter][0]= "Ledger";
+ $trialbalance[$counter][1]= "";
+ $trialbalance[$counter][2]= "Opening";
+ $trialbalance[$counter][3]= "";
+ $trialbalance[$counter][4]= "Closing";
+ $trialbalance[$counter][5]= "";
+ $trialbalance[$counter][6]= "Dr Total";
+ $trialbalance[$counter][7]= "";
+ $trialbalance[$counter][8]= "Cr Total";
+ $counter++;
+
+ foreach ($all_ledgers as $ledger_id => $ledger_name)
+ {
+ if ($ledger_id == 0) continue;
+
+ $trialbalance[$counter][0] = $ledger_name;
+
+ list ($opbal_amount, $opbal_type) = $this->Ledger_model->get_op_balance($ledger_id);
+ if ($opbal_amount == 0)
+ {
+ $trialbalance[$counter][1] = "";
+ $trialbalance[$counter][2] = 0;
+ } else {
+ $trialbalance[$counter][1] = convert_dc($opbal_type);
+ $trialbalance[$counter][2] = $opbal_amount;
+ }
+
+ $clbal_amount = $this->Ledger_model->get_ledger_balance($ledger_id);
+
+ if ($clbal_amount == 0)
+ {
+ $trialbalance[$counter][3] = "";
+ $trialbalance[$counter][4] = 0;
+ } else if ($clbal_amount < 0) {
+ $trialbalance[$counter][3] = "Cr";
+ $trialbalance[$counter][4] = convert_cur(-$clbal_amount);
+ } else {
+ $trialbalance[$counter][3] = "Dr";
+ $trialbalance[$counter][4] = convert_cur($clbal_amount);
+ }
+
+ $dr_total = $this->Ledger_model->get_dr_total($ledger_id);
+ if ($dr_total)
+ {
+ $trialbalance[$counter][5] = "Dr";
+ $trialbalance[$counter][6] = convert_cur($dr_total);
+ $temp_dr_total += $dr_total;
+ } else {
+ $trialbalance[$counter][5] = "";
+ $trialbalance[$counter][6] = 0;
+ }
+
+ $cr_total = $this->Ledger_model->get_cr_total($ledger_id);
+ if ($cr_total)
+ {
+ $trialbalance[$counter][7] = "Cr";
+ $trialbalance[$counter][8] = convert_cur($cr_total);
+ $temp_cr_total += $cr_total;
+ } else {
+ $trialbalance[$counter][7] = "";
+ $trialbalance[$counter][8] = 0;
+ }
+ $counter++;
+ }
+
+ $trialbalance[$counter][0]= "";
+ $trialbalance[$counter][1]= "";
+ $trialbalance[$counter][2]= "";
+ $trialbalance[$counter][3]= "";
+ $trialbalance[$counter][4]= "";
+ $trialbalance[$counter][5]= "";
+ $trialbalance[$counter][6]= "";
+ $trialbalance[$counter][7]= "";
+ $trialbalance[$counter][8]= "";
+ $counter++;
+
+ $trialbalance[$counter][0]= "Total";
+ $trialbalance[$counter][1]= "";
+ $trialbalance[$counter][2]= "";
+ $trialbalance[$counter][3]= "";
+ $trialbalance[$counter][4]= "";
+ $trialbalance[$counter][5]= "Dr";
+ $trialbalance[$counter][6]= convert_cur($temp_dr_total);
+ $trialbalance[$counter][7]= "Cr";
+ $trialbalance[$counter][8]= convert_cur($temp_cr_total);
+
+ $this->load->helper('csv');
+ echo array_to_csv($trialbalance, "trialbalance.csv");
+ return;
+ }
+ return;
+ }
}
/* End of file report.php */
commit c31026df25ead5cd448dc960182ffc7587072c92
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Wed Dec 8 21:42:18 2010 +0530
Added CSV Helper
Downloaded from http://maestric.com/doc/php/codeigniter_csv
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
diff --git a/system/application/helpers/csv_helper.php b/system/application/helpers/csv_helper.php
new file mode 100755
index 0000000..70bafda
--- /dev/null
+++ b/system/application/helpers/csv_helper.php
@@ -0,0 +1,101 @@
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+
+// ------------------------------------------------------------------------
+
+/**
+ * CSV Helpers
+ * Inspiration from PHP Cookbook by David Sklar and Adam Trachtenberg
+ *
+ * @author Jérôme Jaglale
+ * @link http://maestric.com/en/doc/php/codeigniter_csv
+ */
+
+// ------------------------------------------------------------------------
+
+/**
+ * Array to CSV
+ *
+ * download == "" -> return CSV string
+ * download == "toto.csv" -> download file toto.csv
+ */
+if ( ! function_exists('array_to_csv'))
+{
+ function array_to_csv($array, $download = "")
+ {
+ if ($download != "")
+ {
+ header('Content-Type: application/csv');
+ header('Content-Disposition: attachement; filename="' . $download . '"');
+ }
+
+ ob_start();
+ $f = fopen('php://output', 'w') or show_error("Can't open php://output");
+ $n = 0;
+ foreach ($array as $line)
+ {
+ $n++;
+ if ( ! fputcsv($f, $line))
+ {
+ show_error("Can't write line $n: $line");
+ }
+ }
+ fclose($f) or show_error("Can't close php://output");
+ $str = ob_get_contents();
+ ob_end_clean();
+
+ if ($download == "")
+ {
+ return $str;
+ }
+ else
+ {
+ echo $str;
+ }
+ }
+}
+
+// ------------------------------------------------------------------------
+
+/**
+ * Query to CSV
+ *
+ * download == "" -> return CSV string
+ * download == "toto.csv" -> download file toto.csv
+ */
+if ( ! function_exists('query_to_csv'))
+{
+ function query_to_csv($query, $headers = TRUE, $download = "")
+ {
+ if ( ! is_object($query) OR ! method_exists($query, 'list_fields'))
+ {
+ show_error('invalid query');
+ }
+
+ $array = array();
+
+ if ($headers)
+ {
+ $line = array();
+ foreach ($query->list_fields() as $name)
+ {
+ $line[] = $name;
+ }
+ $array[] = $line;
+ }
+
+ foreach ($query->result_array() as $row)
+ {
+ $line = array();
+ foreach ($row as $item)
+ {
+ $line[] = $item;
+ }
+ $array[] = $line;
+ }
+
+ echo array_to_csv($array, $download);
+ }
+}
+
+/* End of file csv_helper.php */
+/* Location: ./system/helpers/csv_helper.php */
\ No newline at end of file
commit c4a1edae6f135fbac68b885187c29487113121c1
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Wed Dec 8 17:47:20 2010 +0530
Added Manage accounts edit and delete actions
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
diff --git a/system/application/assets/css/admin-style.css b/system/application/assets/css/admin-style.css
index a2647a1..a17a5e6 100644
--- a/system/application/assets/css/admin-style.css
+++ b/system/application/assets/css/admin-style.css
@@ -104,14 +104,15 @@ body {
margin:0 18px 0 0;
}
-#content #main ul#main-links-nav li a
-{
- color:#000000;
- font-size:100%;
- background-color:#EEE;
- border:1px solid;
- border-color: #696 #363 #363 #696;
- padding:3px;
+#content #main ul#main-links-nav li a {
+ -moz-border-radius:3px 3px 3px 3px;
+ border-radius:3px 3px 3px 3px;
+ background:repeat-x scroll 0 0 transparent;
+ color:#FFFFFF;
+ font-size:11px;
+ font-weight:bold;
+ padding:4px 10px;
+ text-shadow:-1px -1px 0 #333333;
text-decoration:none;
}
diff --git a/system/application/controllers/admin/manage.php b/system/application/controllers/admin/manage.php
index 6045959..33c3cc1 100644
--- a/system/application/controllers/admin/manage.php
+++ b/system/application/controllers/admin/manage.php
@@ -148,6 +148,164 @@ class Manage extends Controller {
}
return;
}
+
+ function edit($database_label)
+ {
+ $this->template->set('page_title', 'Edit a webzash account');
+
+ $ini_file = "system/application/config/accounts/" . $database_label . ".ini";
+
+ /* Form fields */
+ $data['database_name'] = array(
+ 'name' => 'database_name',
+ 'id' => 'database_name',
+ 'maxlength' => '100',
+ 'size' => '40',
+ 'value' => '',
+ );
+
+ $data['database_username'] = array(
+ 'name' => 'database_username',
+ 'id' => 'database_username',
+ 'maxlength' => '100',
+ 'size' => '40',
+ 'value' => '',
+ );
+
+ $data['database_password'] = array(
+ 'name' => 'database_password',
+ 'id' => 'database_password',
+ 'maxlength' => '100',
+ 'size' => '40',
+ 'value' => '',
+ );
+
+ $data['database_host'] = array(
+ 'name' => 'database_host',
+ 'id' => 'database_host',
+ 'maxlength' => '100',
+ 'size' => '40',
+ 'value' => '',
+ );
+
+ $data['database_port'] = array(
+ 'name' => 'database_port',
+ 'id' => 'database_port',
+ 'maxlength' => '100',
+ 'size' => '40',
+ 'value' => '',
+ );
+ $data['database_label'] = $database_label;
+
+ /* Repopulating form */
+ if ($_POST)
+ {
+ $data['database_host']['value'] = $this->input->post('database_host', TRUE);
+ $data['database_port']['value'] = $this->input->post('database_port', TRUE);
+ $data['database_name']['value'] = $this->input->post('database_name', TRUE);
+ $data['database_username']['value'] = $this->input->post('database_username', TRUE);
+ $data['database_password']['value'] = $this->input->post('database_password', TRUE);
+ } else {
+ /* Check if database ini file exists */
+ if ( ! get_file_info($ini_file))
+ {
+ $this->messages->add("Invalid account. Account setting file labeled " . $database_label . " does not exists", 'error');
+ } else {
+ /* Parsing database ini file */
+ $active_accounts = parse_ini_file($ini_file);
+ if ( ! $active_accounts)
+ {
+ $CI->messages->add("Invalid account setting file", 'error');
+ } else {
+ /* Check if all needed variables are set in ini file */
+ if (isset($active_accounts['db_hostname']))
+ $data['database_host']['value'] = $active_accounts['db_hostname'];
+ else
+ $CI->messages->add("Hostname missing from account setting file", 'error');
+
+ if (isset($active_accounts['db_port']))
+ $data['database_port']['value'] = $active_accounts['db_port'];
+ else
+ $CI->messages->add("Port missing from account setting file. Default MySQL port is 3306", 'error');
+
+ if (isset($active_accounts['db_name']))
+ $data['database_name']['value'] = $active_accounts['db_name'];
+ else
+ $CI->messages->add("Database name missing from account setting file", 'error');
+
+ if (isset($active_accounts['db_username']))
+ $data['database_username']['value'] = $active_accounts['db_username'];
+ else
+ $CI->messages->add("Database username missing from account setting file", 'error');
+
+ if ( ! isset($active_accounts['db_password']))
+ $CI->messages->add("Database password missing from account setting file", 'error');
+ }
+ }
+ }
+
+ /* Form validations */
+ $this->form_validation->set_rules('database_name', 'Database Name', 'trim|required');
+
+ /* Validating form */
+ if ($this->form_validation->run() == FALSE)
+ {
+ $this->messages->add(validation_errors(), 'error');
+ $this->template->load('admin_template', 'admin/manage/edit', $data);
+ return;
+ }
+ else
+ {
+ $data_database_host = $this->input->post('database_host', TRUE);
+ $data_database_port = $this->input->post('database_port', TRUE);
+ $data_database_name = $this->input->post('database_name', TRUE);
+ $data_database_username = $this->input->post('database_username', TRUE);
+ $data_database_password = $this->input->post('database_password', TRUE);
+
+ $ini_file = "system/application/config/accounts/" . $database_label . ".ini";
+
+ $con_details = "[database]" . "\r\n" . "db_hostname = \"" . $data_database_host . "\"" . "\r\n" . "db_port = \"" . $data_database_port . "\"" . "\r\n" . "db_name = \"" . $data_database_name . "\"" . "\r\n" . "db_username = \"" . $data_database_username . "\"" . "\r\n" . "db_password = \"" . $data_database_password . "\"" . "\r\n";
+
+ $con_details_html = '[database]<br />db_hostname = "' . $data_database_host . '"<br />db_port = "' . $data_database_port . '"<br />db_name = "' . $data_database_name . '"<br />db_username = "' . $data_database_username . '"<br />db_password = "' . $data_database_password . '"<br />';
+
+ /* Writing the connection string to end of file - writing in 'a' append mode */
+ if ( ! write_file($ini_file, $con_details))
+ {
+ $this->messages->add("Failed to edit account settings file. Please check if \"" . $ini_file . "\" file is writable", 'error');
+ $this->messages->add("You can manually update the text file \"" . $ini_file . "\" with the following content :<br /><br />" . $con_details_html, 'error');
+ $this->template->load('admin_template', 'admin/manage/edit', $data);
+ return;
+ } else {
+ $this->messages->add("Successfully updated webzash account settings", 'success');
+ redirect('admin/manage');
+ return;
+ }
+ }
+ return;
+ }
+
+ function delete($database_label)
+ {
+ $this->template->set('page_title', 'Delete a webzash account');
+
+ $ini_file = "system/application/config/accounts/" . $database_label . ".ini";
+ $this->messages->add("Please delete " . $ini_file . " file manually", 'error');
+ $this->messages->add("Note that only the settings file will be delete. Account database will have to be deleted manually", 'status');
+ /*
+ if ( ! get_file_info($ini_file))
+ {
+ $this->messages->add("Cannot delete account settings. Account setting file labeled " . $database_label . " does not exists", 'error');
+ } else {
+ if (unlink($ini_file))
+ {
+ $this->messages->add("Account settings file delete", 'success');
+ } else {
+ $this->messages->add("Cannot delete account settings. Please delete " . $ini_file . " file manually", 'error');
+ }
+ } */
+ redirect('admin/manage');
+ return;
+ }
}
/* End of file manage.php */
diff --git a/system/application/views/admin/manage/edit.php b/system/application/views/admin/manage/edit.php
new file mode 100644
index 0000000..378062f
--- /dev/null
+++ b/system/application/views/admin/manage/edit.php
@@ -0,0 +1,47 @@
+<?php
+ echo form_open('admin/manage/edit/' . $database_label);
+
+ echo "<p>";
+ echo "Label";
+ echo "<br />";
+ echo $database_label;
+ echo "</p>";
+
+ echo "<p>";
+ echo form_label('Database Name', 'database_name');
+ echo "<br />";
+ echo form_input($database_name);
+ echo "</p>";
+
+ echo "<p>";
+ echo form_label('Database Username', 'database_username');
+ echo "<br />";
+ echo form_input($database_username);
+ echo "</p>";
+
+ echo "<p>";
+ echo form_label('Database Password', 'database_password');
+ echo "<br />";
+ echo form_password($database_password);
+ echo "</p>";
+
+ echo "<p>";
+ echo form_label('Database Host', 'database_host');
+ echo "<br />";
+ echo form_input($database_host);
+ echo "</p>";
+
+ echo "<p>";
+ echo form_label('Database Port', 'database_port');
+ echo "<br />";
+ echo form_input($database_port);
+ echo "</p>";
+
+ echo "<p>";
+ echo form_submit('submit', 'Edit');
+ echo " ";
+ echo anchor('admin/manage', 'Back', array('title' => 'Back to active account list'));
+ echo "</p>";
+
+ echo form_close();
+
diff --git a/system/application/views/admin/manage/index.php b/system/application/views/admin/manage/index.php
index 66ac375..23d07af 100644
--- a/system/application/views/admin/manage/index.php
+++ b/system/application/views/admin/manage/index.php
@@ -5,7 +5,7 @@ echo $this->session->userdata('db_active_label');
echo "</p>";
echo "<table border=0 cellpadding=5 class=\"simple-table manage-account-table\">";
-echo "<thead><tr><th>Label</th><th>Hostname</th><th>Port</th><th>Database</th><th>Username</th><th></th></tr></thead>";
+echo "<thead><tr><th>Label</th><th>Hostname</th><th>Port</th><th>Database</th><th>Username</th><th></th><th></th></tr></thead>";
echo "<tbody>";
$odd_even = "odd";
foreach ($accounts as $label)
@@ -37,10 +37,18 @@ foreach ($accounts as $label)
echo "<td>" . $db_port . "</td>";
echo "<td>" . $db_name . "</td>";
echo "<td>" . $db_user . "</td>";
+
+ echo "<td>";
if ($this->session->userdata('db_active_label') == $label)
- echo "<td>Active</td>";
+ echo "Active";
else
- echo "<td>" . anchor("admin/active/index/" . $label, "Activate", array('title' => 'Activate ' . ucfirst($label) . ' Account', 'class' => 'red-link')) . "</td>";
+ echo anchor("admin/active/index/" . $label, "Activate", array('title' => 'Activate ' . ucfirst($label) . ' Account', 'class' => 'red-link'));
+ echo "</td>";
+ echo "<td>";
+ echo anchor("admin/manage/edit/" . $label, "Edit", array('title' => 'Edit ' . ucfirst($label) . ' Account', 'class' => 'red-link'));
+ echo " " . anchor('admin/manage/delete/' . $label, img(array('src' => asset_url() . "images/icons/delete.png", 'border' => '0', 'alt' => 'Delete Account Settings', 'class' => "confirmClick", 'title' => "Delete Account Settings")), array('title' => 'Delete Account Settings')) . " ";
+ echo "</td>";
+
echo "</tr>";
$odd_even = ($odd_even == "odd") ? "even" : "odd";
}
diff --git a/system/application/views/admin_template.php b/system/application/views/admin_template.php
index 8449be7..6d69061 100644
--- a/system/application/views/admin_template.php
+++ b/system/application/views/admin_template.php
@@ -55,7 +55,7 @@ $(document).ready(function(){
<?php if (isset($nav_links)) {
echo "<ul id=\"main-links-nav\">";
foreach ($nav_links as $link => $title) {
- echo "<li>" . anchor($link, $title, array('title' => $title, 'class' => 'nav-links-item')) . "</li>";
+ echo "<li>" . anchor($link, $title, array('title' => $title, 'class' => 'nav-links-item', 'style' => 'background-image:url(\'' . asset_url() . 'images/buttons/navlink.png\');')) . "</li>";
}
echo "</ul>";
} ?>
commit 7284c7fe4da8cb54b888d09e3d76fbf2f536cd0d
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Wed Dec 8 11:48:48 2010 +0530
Added Admin area message
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
diff --git a/system/application/views/admin_template.php b/system/application/views/admin_template.php
index 89bb44d..8449be7 100644
--- a/system/application/views/admin_template.php
+++ b/system/application/views/admin_template.php
@@ -33,7 +33,7 @@ $(document).ready(function(){
<div id="container">
<div id="header">
<div id="logo">
- Webzash
+ Webzash <span style="font-size:18px;color:#FF0000;">Admin area</span>
</div>
<div id="admin">
<?php echo anchor('', 'Back to accounts', array('title' => "Back to accounts", 'style' => 'color:#000000; text-decoration:none')); ?>
commit 9759ae94297e57305c839e99c0d0d50b2a4a2e55
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Wed Dec 8 11:45:52 2010 +0530
Manage accounts now uses the simple table style
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
diff --git a/system/application/assets/css/tables.css b/system/application/assets/css/tables.css
index fedfd6a..0988cf2 100644
--- a/system/application/assets/css/tables.css
+++ b/system/application/assets/css/tables.css
@@ -145,7 +145,7 @@
.trial-balance-table td {
padding-right: 20px;
}
-
+
/* balance sheet */
.balance-sheet-table {
border:1px solid #BBBBBB;
@@ -235,3 +235,7 @@
.ledger-summary td {
padding: 8px 8px 8px 8px;
}
+
+.manage-account-table td {
+ padding-right: 20px;
+}
diff --git a/system/application/views/admin/manage/index.php b/system/application/views/admin/manage/index.php
index aa95930..66ac375 100644
--- a/system/application/views/admin/manage/index.php
+++ b/system/application/views/admin/manage/index.php
@@ -4,8 +4,8 @@ echo "<b>Currently active account : </b>";
echo $this->session->userdata('db_active_label');
echo "</p>";
-echo "<table border=0 cellpadding=5 class=\"generaltable\">";
-echo "<thead><tr><th>Label</th><th>Hostname</th><th>Port</th><th>Database</th><th>Username</th><th>Actions</th></tr></thead>";
+echo "<table border=0 cellpadding=5 class=\"simple-table manage-account-table\">";
+echo "<thead><tr><th>Label</th><th>Hostname</th><th>Port</th><th>Database</th><th>Username</th><th></th></tr></thead>";
echo "<tbody>";
$odd_even = "odd";
foreach ($accounts as $label)
@@ -37,7 +37,10 @@ foreach ($accounts as $label)
echo "<td>" . $db_port . "</td>";
echo "<td>" . $db_name . "</td>";
echo "<td>" . $db_user . "</td>";
- echo "<td>" . anchor("admin/active/index/" . $label, "Activate", array('title' => 'Activate ' . ucfirst($label) . ' Account', 'style' => 'color:#000000;')) . "</td>";
+ if ($this->session->userdata('db_active_label') == $label)
+ echo "<td>Active</td>";
+ else
+ echo "<td>" . anchor("admin/active/index/" . $label, "Activate", array('title' => 'Activate ' . ucfirst($label) . ' Account', 'class' => 'red-link')) . "</td>";
echo "</tr>";
$odd_even = ($odd_even == "odd") ? "even" : "odd";
}
diff --git a/system/application/views/tag/index.php b/system/application/views/tag/index.php
index a5ae0ad..bb3db1d 100644
--- a/system/application/views/tag/index.php
+++ b/system/application/views/tag/index.php
@@ -1,7 +1,7 @@
<?php
$tags_q = $this->db->get("tags");
echo "<table border=0 cellpadding=5 class=\"simple-table tag-table\">";
- echo "<thead><tr><th>Title</th><th>Color</th><th colspan=5></th></tr></thead>";
+ echo "<thead><tr><th>Title</th><th>Color</th><th></th></tr></thead>";
echo "<tbody>";
$odd_even = "odd";
foreach ($tags_q->result() as $row)
commit 5323b4c66af52ab6dc5eaee82ca65d5bc55e26d2
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Wed Dec 8 11:38:46 2010 +0530
Tag list now uses the simple table style
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
diff --git a/system/application/views/tag/index.php b/system/application/views/tag/index.php
index 522b45f..a5ae0ad 100644
--- a/system/application/views/tag/index.php
+++ b/system/application/views/tag/index.php
@@ -1,7 +1,7 @@
<?php
$tags_q = $this->db->get("tags");
- echo "<table border=0 cellpadding=5 class=\"generaltable\">";
- echo "<thead><tr><th>Title</th><th>Color</th><th colspan=5>Actions</th></tr></thead>";
+ echo "<table border=0 cellpadding=5 class=\"simple-table tag-table\">";
+ echo "<thead><tr><th>Title</th><th>Color</th><th colspan=5></th></tr></thead>";
echo "<tbody>";
$odd_even = "odd";
foreach ($tags_q->result() as $row)
@@ -10,9 +10,9 @@
echo "<td>" . $row->title . "</td>";
echo "<td>" . $this->Tag_model->show_voucher_tag($row->id) . "</td>";
- echo "<td>" . anchor('tag/edit/' . $row->id , img(array('src' => asset_url() . "images/icons/edit.png", 'border' => '0', 'alt' => 'Edit Tag')), array('title' => 'Edit Tag')) . "</td>";
-
- echo "<td>" . anchor('tag/delete/' . $row->id , img(array('src' => asset_url() . "images/icons/delete.png", 'border' => '0', 'alt' => 'Delete Tag', 'class' => "confirmClick", 'title' => "Delete Tag")), array('title' => 'Delete Tag')) . "</td>";
+ echo "<td>" . anchor('tag/edit/' . $row->id , "Edit", array('title' => 'Edit Tag', 'class' => 'red-link'));
+ echo " ";
+ echo anchor('tag/delete/' . $row->id , img(array('src' => asset_url() . "images/icons/delete.png", 'border' => '0', 'alt' => 'Delete Tag', 'class' => "confirmClick", 'title' => "Delete Tag")), array('title' => 'Delete Tag')) . "</td>";
echo "</tr>";
$odd_even = ($odd_even == "odd") ? "even" : "odd";
}
commit e83434de115ecafef44c165d29f92468413834fd
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Wed Dec 8 11:24:45 2010 +0530
View Voucher now uses the simple table style
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
diff --git a/system/application/assets/css/tables.css b/system/application/assets/css/tables.css
index 0c0aeb6..fedfd6a 100644
--- a/system/application/assets/css/tables.css
+++ b/system/application/assets/css/tables.css
@@ -130,6 +130,18 @@
padding-right: 8px;
}
+.voucher-view-table td {
+ padding-right: 30px;
+}
+
+.voucher-view-table tr.voucher-total {
+ background-color:#FFFFE0;
+}
+
+.voucher-view-table tr.voucher-difference {
+ background-color:#FFE9E8;
+}
+
.trial-balance-table td {
padding-right: 20px;
}
@@ -140,7 +152,7 @@
}
.balance-sheet-table td {
- border:1px solid #EEEEEE;
+ border:1px solid #EEEEEE;
}
.balance-sheet-table tr.tr-group td {
diff --git a/system/application/views/voucher/edit.php b/system/application/views/voucher/edit.php
index d9aa7c3..7022da2 100644
--- a/system/application/views/voucher/edit.php
+++ b/system/application/views/voucher/edit.php
@@ -232,9 +232,9 @@ $(document).ready(function() {
}
echo "<tr><td colspan=7></td></tr>";
- echo "<tr id=\"total\"><td colspan=2>TOTAL</td><td id=\"dr-total\">0</td><td id=\"cr-total\">0</td><td>" . img(array('src' => asset_url() . "images/icons/gear.png", 'border' => '0', 'alt' => 'Recalculate Total', 'class' => 'recalculate', 'title' => 'Recalculate Total')) . "</td><td></td><td></td></tr>";
+ echo "<tr id=\"total\"><td colspan=2><strong>Total</strong></td><td id=\"dr-total\">0</td><td id=\"cr-total\">0</td><td>" . img(array('src' => asset_url() . "images/icons/gear.png", 'border' => '0', 'alt' => 'Recalculate Total', 'class' => 'recalculate', 'title' => 'Recalculate Total')) . "</td><td></td><td></td></tr>";
- echo "<tr id=\"difference\"><td colspan=2>DIFFERENCE</td><td id=\"dr-diff\"></td><td id=\"cr-diff\"></td><td></td><td></td><td></td></tr>";
+ echo "<tr id=\"difference\"><td colspan=2><strong>Difference</strong></td><td id=\"dr-diff\"></td><td id=\"cr-diff\"></td><td></td><td></td><td></td></tr>";
echo "</table>";
echo "<p>";
diff --git a/system/application/views/voucher/view.php b/system/application/views/voucher/view.php
index ebbeef2..f85e5ba 100644
--- a/system/application/views/voucher/view.php
+++ b/system/application/views/voucher/view.php
@@ -3,7 +3,7 @@
Voucher Date : <span class="bold"><?php echo date_mysql_to_php($cur_voucher->date); ?></span>
</p>
-<table border=0 cellpadding=5 class="generaltable">
+<table border=0 cellpadding=5 class="simple-table voucher-view-table">
<thead><tr><th>Type</th><th>Ledger A/C</th><th>Dr Amount</th><th>Cr Amount</th></tr></thead>
<?php
$odd_even = "odd";
@@ -14,26 +14,25 @@ foreach ($cur_voucher_ledgers->result() as $row)
echo "<td>" . $this->Ledger_model->get_name($row->ledger_id) . "</td>";
if ($row->dc == "D")
{
- echo "<td>" . $row->amount . "</td>";
+ echo "<td>Dr " . $row->amount . "</td>";
echo "<td></td>";
} else {
echo "<td></td>";
- echo "<td>" . $row->amount . "</td>";
+ echo "<td>Cr " . $row->amount . "</td>";
}
echo "</tr>";
$odd_even = ($odd_even == "odd") ? "even" : "odd";
}
?>
-<tr><td colspan=4><hr /></td></tr>
-<tr id="total"><td colspan=2>TOTAL</td><td id=dr-total><?php echo $cur_voucher->dr_total; ?></td><td id=cr-total"><?php echo $cur_voucher->cr_total; ?></td></tr>
+<tr class="voucher-total"><td colspan=2><strong>Total</strong></td><td id=dr-total>Dr <?php echo $cur_voucher->dr_total; ?></td><td id=cr-total">Cr <?php echo $cur_voucher->cr_total; ?></td></tr>
<?php
if ($cur_voucher->dr_total != $cur_voucher->cr_total)
{
$difference = $cur_voucher->dr_total - $cur_voucher->cr_total;
if ($difference < 0)
- echo "<tr id=\"difference\"><td colspan=2>DIFFERENCE</td><td id=\"dr-diff\"></td><td id=\"cr-diff\">" . $cur_voucher->cr_total . "</td></tr>";
+ echo "<tr class=\"voucher-difference\"><td colspan=2><strong>Difference</strong></td><td id=\"dr-diff\"></td><td id=\"cr-diff\">" . $cur_voucher->cr_total . "</td></tr>";
else
- echo "<tr id=\"difference\"><td colspan=2>DIFFERENCE</td><td id=\"dr-diff\">" . $cur_voucher->dr_total . "</td><td id=\"cr-diff\"></td></tr>";
+ echo "<tr class=\"voucher-difference\"><td colspan=2><strong>Difference</strong></td><td id=\"dr-diff\">" . $cur_voucher->dr_total . "</td><td id=\"cr-diff\"></td></tr>";
}
?>
</table>
commit d1fbea37b08b2df1772ed3ddf260b636b37fc229
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Wed Dec 8 11:03:52 2010 +0530
Edit Voucher now uses the voucher table style
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
diff --git a/system/application/views/voucher/edit.php b/system/application/views/voucher/edit.php
index 23c444a..d9aa7c3 100644
--- a/system/application/views/voucher/edit.php
+++ b/system/application/views/voucher/edit.php
@@ -194,7 +194,7 @@ $(document).ready(function() {
echo form_input_date($voucher_date);
echo "</p>";
- echo "<table class=\"vouchertable\">";
+ echo "<table class=\"voucher-table\">";
echo "<thead><tr><th>Type</th><th>Ledger A/C</th><th>Dr Amount</th><th>Cr Amount</th><th colspan=2>Actions</th><th colspan=2>Cur Balance</th></tr></thead>";
foreach ($ledger_dc as $i => $ledger)
@@ -230,11 +230,11 @@ $(document).ready(function() {
echo "</tr>";
}
- echo "<tr><td colspan=4><hr /></td><td></td></tr>";
+ echo "<tr><td colspan=7></td></tr>";
- echo "<tr id=\"total\"><td colspan=2>TOTAL</td><td id=\"dr-total\">0</td><td id=\"cr-total\">0</td><td>" . img(array('src' => asset_url() . "images/icons/gear.png", 'border' => '0', 'alt' => 'Recalculate Total', 'class' => 'recalculate', 'title' => 'Recalculate Total')) . "</tr>";
+ echo "<tr id=\"total\"><td colspan=2>TOTAL</td><td id=\"dr-total\">0</td><td id=\"cr-total\">0</td><td>" . img(array('src' => asset_url() . "images/icons/gear.png", 'border' => '0', 'alt' => 'Recalculate Total', 'class' => 'recalculate', 'title' => 'Recalculate Total')) . "</td><td></td><td></td></tr>";
- echo "<tr id=\"difference\"><td colspan=2>DIFFERENCE</td><td id=\"dr-diff\"></td><td id=\"cr-diff\"></td></tr>";
+ echo "<tr id=\"difference\"><td colspan=2>DIFFERENCE</td><td id=\"dr-diff\"></td><td id=\"cr-diff\"></td><td></td><td></td><td></td></tr>";
echo "</table>";
echo "<p>";
commit 4296603d57460c59646e5a6d1b106bed58cdb8ac
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Wed Dec 8 11:00:08 2010 +0530
New Voucher now uses the voucher table style
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
diff --git a/system/application/assets/css/tables.css b/system/application/assets/css/tables.css
index ffaa97b..0c0aeb6 100644
--- a/system/application/assets/css/tables.css
+++ b/system/application/assets/css/tables.css
@@ -92,6 +92,33 @@
}
/******************************************************************************/
+/****************************** VOUCHER TABLE *********************************/
+/******************************************************************************/
+
+.voucher-table {
+ font-family:"Lucida Sans Unicode", "Lucida Grande", Sans-Serif;
+ font-size:13px;
+ border-collapse:collapse;
+ text-align:left;
+}
+
+.voucher-table th {
+ font-weight:normal;
+ color:#000000;
+ padding:5px 8px;
+ background-color:#EEEEEE;
+}
+
+.voucher-table td {
+ color:#000000;
+ padding:8px 8px 8px 8px;
+}
+
+.voucher-table tr.new-row {
+ background-color:#FFFFE0;
+}
+
+/******************************************************************************/
/****************************** CUSTOM TABLES *********************************/
/******************************************************************************/
diff --git a/system/application/controllers/voucher.php b/system/application/controllers/voucher.php
index f66438b..6d2ef11 100644
--- a/system/application/controllers/voucher.php
+++ b/system/application/controllers/voucher.php
@@ -945,6 +945,8 @@ class Voucher extends Controller {
echo '<td>';
echo img(array('src' => asset_url() . "images/icons/delete.png", 'border' => '0', 'alt' => 'Remove Ledger', 'class' => 'deleterow'));
echo '</td>';
+ echo '<td class="ledger-balance"><div></div>';
+ echo '</td>';
echo '</tr>';
return;
}
diff --git a/system/application/views/voucher/add.php b/system/application/views/voucher/add.php
index 004cc8a..c73c2bf 100644
--- a/system/application/views/voucher/add.php
+++ b/system/application/views/voucher/add.php
@@ -194,8 +194,8 @@ $(document).ready(function() {
echo form_input_date($voucher_date);
echo "</p>";
- echo "<table class=\"vouchertable\">";
- echo "<thead><tr><th>Type</th><th>Ledger A/C</th><th>Dr Amount</th><th>Cr Amount</th><th colspan=2>Actions</th><th colspan=2>Cur Balance</th></tr></thead>";
+ echo "<table class=\"voucher-table\">";
+ echo "<thead><tr><th>Type</th><th>Ledger A/C</th><th>Dr Amount</th><th>Cr Amount</th><th colspan=2></th><th colspan=2>Cur Balance</th></tr></thead>";
foreach ($ledger_dc as $i => $ledger)
{
@@ -230,11 +230,11 @@ $(document).ready(function() {
echo "</tr>";
}
- echo "<tr><td colspan=4><hr /></td><td></td></tr>";
- echo "<tr id=\"total\"><td colspan=2>TOTAL</td><td id=\"dr-total\">0</td><td id=\"cr-total\">0</td><td>" . img(array('src' => asset_url() . "images/icons/gear.png", 'border' => '0', 'alt' => 'Recalculate Total', 'class' => 'recalculate', 'title' => 'Recalculate Total')) . "</tr>";
+ echo "<tr><td colspan=\"7\"></td></tr>";
+ echo "<tr id=\"voucher-total\"><td colspan=2><strong>Total</strong></td><td id=\"dr-total\">0</td><td id=\"cr-total\">0</td><td>" . img(array('src' => asset_url() . "images/icons/gear.png", 'border' => '0', 'alt' => 'Recalculate Total', 'class' => 'recalculate', 'title' => 'Recalculate Total')) . "</td><td></td><td></td></tr>";
+ echo "<tr id=\"voucher-difference\"><td colspan=2><strong>Difference</strong></td><td id=\"dr-diff\"></td><td id=\"cr-diff\"></td><td></td><td></td><td></td></tr>";
- echo "<tr id=\"difference\"><td colspan=2>DIFFERENCE</td><td id=\"dr-diff\"></td><td id=\"cr-diff\"></td></tr>";
echo "</table>";
echo "<p>";
commit 543cfac0115011df37e3380e64024099517f5e83
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Wed Dec 8 10:34:24 2010 +0530
Profit and Loss Statement now uses simple table
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
diff --git a/system/application/assets/css/tables.css b/system/application/assets/css/tables.css
index b4e6be6..ffaa97b 100644
--- a/system/application/assets/css/tables.css
+++ b/system/application/assets/css/tables.css
@@ -107,6 +107,7 @@
padding-right: 20px;
}
+/* balance sheet */
.balance-sheet-table {
border:1px solid #BBBBBB;
}
@@ -132,6 +133,32 @@
padding:8px 8px 8px 8px;
}
+/* profit and loss */
+.profit-loss-table {
+ border:1px solid #BBBBBB;
+}
+
+.profit-loss-table td {
+ border:1px solid #EEEEEE;
+}
+
+.profit-loss-table tr.tr-group td {
+ background-color:#FFFFF0;
+}
+
+.profit-loss-total-table {
+ font-family:"Lucida Sans Unicode", "Lucida Grande", Sans-Serif;
+ font-size:13px;
+ border-collapse:collapse;
+ text-align:left;
+}
+
+.profit-loss-total-table td {
+ border-bottom:1px solid #FFFFFF;
+ color:#000000;
+ padding:8px 8px 8px 8px;
+}
+
.dashboard-cashbank-table {
border-collapse: collapse;
text-align: left;
diff --git a/system/application/views/report/profitandloss.php b/system/application/views/report/profitandloss.php
index cb03336..c134b7d 100644
--- a/system/application/views/report/profitandloss.php
+++ b/system/application/views/report/profitandloss.php
@@ -11,8 +11,8 @@
$gross_expense_total = 0;
$gross_expense_list_q = $this->db->query("SELECT * FROM groups WHERE parent_id = 4 AND affects_gross = 1");
echo "<td>";
- echo "<table border=0 cellpadding=5 class=\"generaltable\" width=\"450\">";
- echo "<thead><tr><th>Gross Expenses</th><th>Amount</th></tr></thead>";
+ echo "<table border=0 cellpadding=5 class=\"simple-table profit-loss-table\" width=\"450\">";
+ echo "<thead><tr><th>Expenses (Gross)</th><th align=\"right\">Amount</th></tr></thead>";
foreach ($gross_expense_list_q->result() as $row)
{
$gross_expense = new Accountlist();
@@ -27,8 +27,8 @@
$gross_income_total = 0;
$gross_income_list_q = $this->db->query("SELECT * FROM groups WHERE parent_id = 3 AND affects_gross = 1");
echo "<td>";
- echo "<table border=0 cellpadding=5 class=\"generaltable\" width=\"450\">";
- echo "<thead><tr><th>Gross Incomes</th><th>Amount</th></tr></thead>";
+ echo "<table border=0 cellpadding=5 class=\"simple-table profit-loss-table\" width=\"450\">";
+ echo "<thead><tr><th>Incomes (Gross)</th><th align=\"right\">Amount</th></tr></thead>";
foreach ($gross_income_list_q->result() as $row)
{
$gross_income = new Accountlist();
@@ -49,7 +49,7 @@
$grosstotal = $gross_expense_total;
echo "<tr style=\"background-color:#F8F8F8;\">";
echo "<td>";
- echo "<table border=0 cellpadding=5 class=\"vouchertable\" width=\"450\">";
+ echo "<table border=0 cellpadding=5 class=\"simple-table profit-loss-total-table\" width=\"450\">";
echo "<tr valign=\"top\">";
echo "<td class=\"bold\">Total Gross Expenses</td>";
echo "<td align=\"right\" class=\"bold\">" . convert_cur($gross_expense_total) . "</td>";
@@ -78,7 +78,7 @@
/* Showing Gross P/L : Incomes */
$grosstotal = $gross_income_total;
echo "<td>";
- echo "<table border=0 cellpadding=5 class=\"vouchertable\" width=\"450\">";
+ echo "<table border=0 cellpadding=5 class=\"simple-table profit-loss-total-table\" width=\"450\">";
echo "<tr valign=\"top\">";
echo "<td class=\"bold\">Total Gross Incomes</td>";
echo "<td align=\"right\" class=\"bold\">" . convert_cur($gross_income_total) . "</td>";
@@ -104,6 +104,8 @@
echo "</td>";
echo "</tr>";
+ echo "<tr><td> </td><td> </td></tr>";
+
/**********************************************************************/
/************************* NET CALCULATIONS ***************************/
/**********************************************************************/
@@ -112,8 +114,8 @@
$net_expense_total = 0;
$net_expense_list_q = $this->db->query("SELECT * FROM groups WHERE parent_id = 4 AND affects_gross != 1");
echo "<td>";
- echo "<table border=0 cellpadding=5 class=\"generaltable\" width=\"450\">";
- echo "<thead><tr><th>Expenses</th><th>Amount</th></tr></thead>";
+ echo "<table border=0 cellpadding=5 class=\"simple-table profit-loss-table\" width=\"450\">";
+ echo "<thead><tr><th>Expenses (Net)</th><th align=\"right\">Amount</th></tr></thead>";
foreach ($net_expense_list_q->result() as $row)
{
$net_expense = new Accountlist();
@@ -128,8 +130,8 @@
$net_income_total = 0;
$net_income_list_q = $this->db->query("SELECT * FROM groups WHERE parent_id = 3 AND affects_gross != 1");
echo "<td>";
- echo "<table border=0 cellpadding=5 class=\"generaltable\" width=\"450\">";
- echo "<thead><tr><th>Incomes</th><th>Amount</th></tr></thead>";
+ echo "<table border=0 cellpadding=5 class=\"simple-table profit-loss-table\" width=\"450\">";
+ echo "<thead><tr><th>Incomes (Net)</th><th align=\"right\">Amount</th></tr></thead>";
foreach ($net_income_list_q->result() as $row)
{
$net_income = new Accountlist();
@@ -150,7 +152,7 @@
$nettotal = $net_expense_total;
echo "<tr style=\"background-color:#F8F8F8;\">";
echo "<td>";
- echo "<table border=0 cellpadding=5 class=\"vouchertable\" width=\"450\">";
+ echo "<table border=0 cellpadding=5 class=\"simple-table profit-loss-total-table\" width=\"450\">";
echo "<tr valign=\"top\">";
echo "<td class=\"bold\">Total Expenses</td>";
echo "<td align=\"right\" class=\"bold\">" . convert_cur($nettotal) . "</td>";
@@ -192,7 +194,7 @@
/* Showing Net P/L : Incomes */
$nettotal = $net_income_total;
echo "<td>";
- echo "<table border=0 cellpadding=5 class=\"vouchertable\" width=\"450\">";
+ echo "<table border=0 cellpadding=5 class=\"simple-table profit-loss-total-table\" width=\"450\">";
echo "<tr valign=\"top\">";
echo "<td class=\"bold\">Total Incomes</td>";
echo "<td align=\"right\" class=\"bold\">" . convert_cur($nettotal) . "</td>";
commit baee436df83fac7c41bcafa5161e575085912cc6
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Wed Dec 8 10:17:27 2010 +0530
Balancesheet now styled with simple table
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
diff --git a/system/application/assets/css/tables.css b/system/application/assets/css/tables.css
index b0ba30e..b4e6be6 100644
--- a/system/application/assets/css/tables.css
+++ b/system/application/assets/css/tables.css
@@ -107,6 +107,31 @@
padding-right: 20px;
}
+.balance-sheet-table {
+ border:1px solid #BBBBBB;
+}
+
+.balance-sheet-table td {
+ border:1px solid #EEEEEE;
+}
+
+.balance-sheet-table tr.tr-group td {
+ background-color:#FFFFF0;
+}
+
+.balance-sheet-total-table {
+ font-family:"Lucida Sans Unicode", "Lucida Grande", Sans-Serif;
+ font-size:13px;
+ border-collapse:collapse;
+ text-align:left;
+}
+
+.balance-sheet-total-table td {
+ border-bottom:1px solid #FFFFFF;
+ color:#000000;
+ padding:8px 8px 8px 8px;
+}
+
.dashboard-cashbank-table {
border-collapse: collapse;
text-align: left;
diff --git a/system/application/libraries/Accountlist.php b/system/application/libraries/Accountlist.php
index 74862a7..2540064 100644
--- a/system/application/libraries/Accountlist.php
+++ b/system/application/libraries/Accountlist.php
@@ -66,13 +66,14 @@ class Accountlist
}
}
+ /* Display Account list in Balance sheet and Profit and Loss st */
function account_st_short($c = 0)
{
$this->counter = $c;
if ($this->id != 0)
{
- echo "<tr class=\"group-tr\">";
- echo "<td class=\"group-td\">";
+ echo "<tr class=\"tr-group\">";
+ echo "<td class=\"td-group\">";
echo $this->print_space($this->counter);
echo " " . $this->name;
echo "</td>";
@@ -100,8 +101,8 @@ class Accountlist
$this->counter++;
foreach ($this->children_ledgers as $id => $data)
{
- echo "<tr class=\"ledger-tr\">";
- echo "<td class=\"ledger-td\">";
+ echo "<tr class=\"tr-ledger\">";
+ echo "<td class=\"td-ledger\">";
echo $this->print_space($this->counter);
echo " " . anchor('report/ledgerst/' . $data['id'], $data['name'], array('title' => $data['name'] . ' Ledger Statement', 'style' => 'color:#000000'));
echo "</td>";
diff --git a/system/application/views/report/balancesheet.php b/system/application/views/report/balancesheet.php
index bd8e016..174c803 100644
--- a/system/application/views/report/balancesheet.php
+++ b/system/application/views/report/balancesheet.php
@@ -7,8 +7,8 @@
$liability = new Accountlist();
echo "<td>";
$liability->init(2);
- echo "<table border=0 cellpadding=5 class=\"generaltable\" width=\"450\">";
- echo "<thead><tr><th>Liabilities</th><th>Amount</th></tr></thead>";
+ echo "<table border=0 cellpadding=5 class=\"simple-table balance-sheet-table\" width=\"450\">";
+ echo "<thead><tr><th>Liabilities</th><th align=\"right\">Amount</th></tr></thead>";
$liability->account_st_short(0);
echo "</table>";
echo "</td>";
@@ -17,8 +17,8 @@
$asset = new Accountlist();
echo "<td>";
$asset->init(1);
- echo "<table border=0 cellpadding=5 class=\"generaltable\" width=\"450\">";
- echo "<thead><tr><th>Assets</th><th>Amount</th></tr></thead>";
+ echo "<table border=0 cellpadding=5 class=\"simple-table balance-sheet-table\" width=\"450\">";
+ echo "<thead><tr><th>Assets</th><th align=\"right\">Amount</th></tr></thead>";
$asset->account_st_short(0);
echo "</table>";
echo "</td>";
@@ -44,7 +44,7 @@
echo "<tr style=\"background-color:#F8F8F8;\">";
echo "<td>";
- echo "<table border=0 cellpadding=5 class=\"vouchertable\" width=\"450\">";
+ echo "<table border=0 cellpadding=5 class=\"balance-sheet-total-table\" width=\"450\">";
echo "<tr valign=\"top\">";
echo "<td class=\"bold\">Liability Total</td>";
echo "<td align=\"right\" class=\"bold\">" . convert_cur($liability_total) . "</td>";
@@ -98,7 +98,7 @@
$total = $asset_total;
echo "<td>";
- echo "<table border=0 cellpadding=5 class=\"vouchertable\" width=\"450\">";
+ echo "<table border=0 cellpadding=5 class=\"balance-sheet-total-table\" width=\"450\">";
echo "<tr valign=\"top\">";
echo "<td class=\"bold\">Asset Total</td>";
echo "<td align=\"right\" class=\"bold\">" . convert_cur($asset_total) . "</td>";
commit 40a9cd23f57612dce45b4bbee9ca25af2a260986
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Wed Dec 8 09:51:55 2010 +0530
Removed eidt and delete links for top level groups
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
diff --git a/system/application/libraries/Accountlist.php b/system/application/libraries/Accountlist.php
index 28abd33..74862a7 100644
--- a/system/application/libraries/Accountlist.php
+++ b/system/application/libraries/Accountlist.php
@@ -140,8 +140,13 @@ class Accountlist
echo "<td>-</td>";
echo "<td>-</td>";
- echo "<td class=\"td-actions\">" . anchor('group/edit/' . $this->id , "Edit", array('title' => 'Edit Group', 'class' => 'red-link'));
- echo " " . anchor('group/delete/' . $this->id, img(array('src' => asset_url() . "images/icons/delete.png", 'border' => '0', 'alt' => 'Delete group')), array('class' => "confirmClick", 'title' => "Delete Group")) . "</td>";
+ if ($this->id <= 4)
+ {
+ echo "<td class=\"td-actions\"></tr>";
+ } else {
+ echo "<td class=\"td-actions\">" . anchor('group/edit/' . $this->id , "Edit", array('title' => 'Edit Group', 'class' => 'red-link'));
+ echo " " . anchor('group/delete/' . $this->id, img(array('src' => asset_url() . "images/icons/delete.png", 'border' => '0', 'alt' => 'Delete group')), array('class' => "confirmClick", 'title' => "Delete Group")) . "</td>";
+ }
echo "</tr>";
}
foreach ($this->children_groups as $id => $data)
diff --git a/system/application/views/welcome_message.php b/system/application/views/welcome_message.php
index 530e7e1..b16ede9 100644
--- a/system/application/views/welcome_message.php
+++ b/system/application/views/welcome_message.php
@@ -87,7 +87,7 @@ jQuery(document).ready(function () {
<div class="dashboard-title">Account Summary</div>
<div class="dashboard-content">
<div>Welcome back, <strong><?php echo $this->config->item('account_name');?> !</strong></div>
- <div id="dashboard-draft">You have <?php echo $draft_count;?> draft voucher(s)</div>
+ <div id="dashboard-draft">You have <?php echo anchor("voucher/show/draft", $draft_count . " draft", array('class' => 'black-link')); ?> voucher(s)</div>
</div>
</div>
<div class="clear"></div>
commit 3f34cf90958ba606ae0dd1ea6cd72c31fa0a8962
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Tue Dec 7 21:52:21 2010 +0530
Added Tags sidebar
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
diff --git a/system/application/assets/css/custom.css b/system/application/assets/css/custom.css
index 192d0cf..7065075 100644
--- a/system/application/assets/css/custom.css
+++ b/system/application/assets/css/custom.css
@@ -162,3 +162,40 @@ ul#pagination-flickr {
.dashboard-log-content {
padding:8px;
}
+
+/******************************* TAGS *****************************************/
+#tag-sidebar {
+ float:right;
+ text-align:left;
+ width:120px;
+ border:1px solid #999999;
+}
+
+#tag-sidebar .tag-title {
+ background-color:#EEEEEE;
+ font-weight:bold;
+ border-bottom:1px solid #999999;
+ padding:8px 8px 2px 8px;
+}
+
+#tag-sidebar .tag-title a {
+ font-weight:normal;
+ text-decoration:none;
+ font-size:12px;
+ color:#FF0000;
+}
+
+#tag-sidebar ul {
+ list-style:none;
+ margin:0;
+ padding:10px 10px 10px 10px;
+}
+
+#tag-sidebar ul li {
+ padding-bottom:5px;
+}
+
+#tag-sidebar ul li a.tag-active {
+ color:#0000FF;
+ text-decoration:none;
+}
diff --git a/system/application/controllers/tag.php b/system/application/controllers/tag.php
index 012fa73..66054c7 100644
--- a/system/application/controllers/tag.php
+++ b/system/application/controllers/tag.php
@@ -25,8 +25,8 @@ class Tag extends Controller {
$data['tag_title'] = array(
'name' => 'tag_title',
'id' => 'tag_title',
- 'maxlength' => '50',
- 'size' => '50',
+ 'maxlength' => '15',
+ 'size' => '15',
'value' => '',
);
$data['tag_color'] = array(
@@ -45,7 +45,7 @@ class Tag extends Controller {
);
/* Form validations */
- $this->form_validation->set_rules('tag_title', 'Tag title', 'trim|required|min_length[2]|max_length[50]|unique[tags.title]');
+ $this->form_validation->set_rules('tag_title', 'Tag title', 'trim|required|min_length[2]|max_length[15]|unique[tags.title]');
$this->form_validation->set_rules('tag_color', 'Tag color', 'trim|required|exact_length[6]|is_hex');
$this->form_validation->set_rules('tag_background', 'Background color', 'trim|required|exact_length[6]|is_hex');
@@ -116,8 +116,8 @@ class Tag extends Controller {
$data['tag_title'] = array(
'name' => 'tag_title',
'id' => 'tag_title',
- 'maxlength' => '50',
- 'size' => '50',
+ 'maxlength' => '15',
+ 'size' => '15',
'value' => $tag_data->title,
);
$data['tag_color'] = array(
@@ -137,7 +137,7 @@ class Tag extends Controller {
$data['tag_id'] = $id;
/* Form validations */
- $this->form_validation->set_rules('tag_title', 'Tag title', 'trim|required|min_length[2]|max_length[50]|uniquewithid[tags.title.' . $id . ']');
+ $this->form_validation->set_rules('tag_title', 'Tag title', 'trim|required|min_length[2]|max_length[15]|uniquewithid[tags.title.' . $id . ']');
$this->form_validation->set_rules('tag_color', 'Tag color', 'trim|required|exact_length[6]|is_hex');
$this->form_validation->set_rules('tag_background', 'Background color', 'trim|required|exact_length[6]|is_hex');
diff --git a/system/application/controllers/voucher.php b/system/application/controllers/voucher.php
index 4434178..f66438b 100644
--- a/system/application/controllers/voucher.php
+++ b/system/application/controllers/voucher.php
@@ -19,10 +19,14 @@ class Voucher extends Controller {
function show($voucher_type)
{
+ $this->load->model('Tag_model');
+ $data['tag_id'] = 0;
if ($voucher_type == "tag")
{
- $tag_id = (int)$this->uri->segment(4);
+ $tag_id = (int)$this->uri->segment(4);
+ $data['tag_id'] = $tag_id;
}
+
switch ($voucher_type)
{
case 'all' :
@@ -54,7 +58,6 @@ class Voucher extends Controller {
$data['voucher_type'] = "";
break;
case 'tag' :
- $this->load->model('Tag_model');
$tag_name = $this->Tag_model->tag_name($tag_id);
$this->template->set('page_title', 'Vouchers Tagged "' . $tag_name . '"');
$data['voucher_type'] = "";
diff --git a/system/application/models/tag_model.php b/system/application/models/tag_model.php
index 0daabaf..7a75042 100644
--- a/system/application/models/tag_model.php
+++ b/system/application/models/tag_model.php
@@ -7,10 +7,11 @@ class Tag_model extends Model {
parent::Model();
}
- function get_all_tags()
+ function get_all_tags($allow_none = TRUE)
{
$options = array();
- $options[0] = "(None)";
+ if ($allow_none)
+ $options[0] = "(None)";
$tag_q = $this->db->query('SELECT * FROM tags ORDER BY title ASC');
foreach ($tag_q->result() as $row)
{
@@ -31,6 +32,18 @@ class Tag_model extends Model {
return "";
}
+ function show_voucher_tag_link($tag_id)
+ {
+ if ($tag_id < 1)
+ return "";
+ $tag_q = $this->db->get_where('tags', array('id' => $tag_id));
+ if ($tag = $tag_q->row())
+ {
+ return "<span class=\"tags\" style=\"color:#" . $tag->color . "; background-color:#" . $tag->background . "\">" . anchor("voucher/show/tag/" . $tag->id , $tag->title, array('style' => 'text-decoration:none;color:#' . $tag->color . ';')) . "</span>";
+ }
+ return "";
+ }
+
function tag_name($tag_id)
{
if ($tag_id < 1)
diff --git a/system/application/views/sidebar/tag.php b/system/application/views/sidebar/tag.php
new file mode 100644
index 0000000..027af49
--- /dev/null
+++ b/system/application/views/sidebar/tag.php
@@ -0,0 +1,18 @@
+<?php
+echo "<div class=\"tag-title\">Tags<span style=\"float:right;\">" . anchor("tag", "Edit") . "</span></div>";
+ echo "<div class=\"tag-content\">";
+ $tags = $this->Tag_model->get_all_tags($allow_none = FALSE);
+ echo "<ul id=\"tag-list\">";
+ if ($tags)
+ {
+ foreach ($tags as $id => $title)
+ {
+
+ echo "<li>" . $this->Tag_model->show_voucher_tag_link($id) . "</li>";
+ }
+ } else {
+ echo "<li>No tags defined</li>";
+ echo "<li>" . anchor("tag/add", "Add one", array('title' => 'Add tag', 'class' => 'blue-link')) . "</li>";
+ }
+ echo "</ul>";
+ echo "</div>";
diff --git a/system/application/views/voucher/index.php b/system/application/views/voucher/index.php
index 7d791ba..4c8496a 100644
--- a/system/application/views/voucher/index.php
+++ b/system/application/views/voucher/index.php
@@ -1,4 +1,7 @@
-<?php echo $voucher_table ?>
+<div id="tag-sidebar">
+ <?php $this->load->view('sidebar/tag', $tag_id); ?>
+</div>
+<?php echo $voucher_table ?>
<div id="pagination-container"><?php echo $this->pagination->create_links(); ?></div>
commit da2f8d7726acba6d1dbf467fc703709b8f343507
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Tue Dec 7 20:42:20 2010 +0530
Added list of tagged vouchers
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
diff --git a/system/application/controllers/voucher.php b/system/application/controllers/voucher.php
index a403b74..4434178 100644
--- a/system/application/controllers/voucher.php
+++ b/system/application/controllers/voucher.php
@@ -19,6 +19,10 @@ class Voucher extends Controller {
function show($voucher_type)
{
+ if ($voucher_type == "tag")
+ {
+ $tag_id = (int)$this->uri->segment(4);
+ }
switch ($voucher_type)
{
case 'all' :
@@ -49,6 +53,12 @@ class Voucher extends Controller {
$this->template->set('page_title', 'Draft Vouchers');
$data['voucher_type'] = "";
break;
+ case 'tag' :
+ $this->load->model('Tag_model');
+ $tag_name = $this->Tag_model->tag_name($tag_id);
+ $this->template->set('page_title', 'Vouchers Tagged "' . $tag_name . '"');
+ $data['voucher_type'] = "";
+ break;
default :
$this->messages->add('Invalid voucher type', 'error');
redirect('voucher/show/all');
@@ -62,17 +72,28 @@ class Voucher extends Controller {
/* Pagination setup */
$this->load->library('pagination');
- $page_count = (int)$this->uri->segment(4);
+
+ if ($voucher_type == "tag")
+ $page_count = (int)$this->uri->segment(5);
+ else
+ $page_count = (int)$this->uri->segment(4);
+
$page_count = $this->input->xss_clean($page_count);
if ( ! $page_count)
$page_count = "0";
/* Pagination configuration */
+ if ($voucher_type == "tag")
+ {
+ $config['base_url'] = site_url('voucher/show/' . $voucher_type. "/" . $tag_id);
+ $config['uri_segment'] = 5;
+ } else {
+ $config['base_url'] = site_url('voucher/show/' . $voucher_type);
+ $config['uri_segment'] = 4;
+ }
$pagination_counter = $this->config->item('row_count');
- $config['base_url'] = site_url('voucher/show/' . $voucher_type);
$config['num_links'] = 10;
$config['per_page'] = $pagination_counter;
- $config['uri_segment'] = 4;
$config['full_tag_open'] = '<ul id="pagination-flickr">';
$config['full_close_open'] = '</ul>';
$config['num_tag_open'] = '<li>';
@@ -100,6 +121,9 @@ class Voucher extends Controller {
} else if ($voucher_type == "draft") {
$voucher_q = $this->db->query("SELECT * FROM vouchers WHERE draft = 1 ORDER BY date DESC, number DESC LIMIT ${page_count}, ${pagination_counter}");
$config['total_rows'] = $this->db->query("SELECT * FROM vouchers WHERE draft = 1")->num_rows();
+ } else if ($voucher_type == "tag") {
+ $voucher_q = $this->db->query("SELECT * FROM vouchers WHERE tag_id = ? ORDER BY date DESC, number DESC LIMIT ${page_count}, ${pagination_counter}", array($tag_id));
+ $config['total_rows'] = $this->db->query("SELECT * FROM vouchers WHERE tag_id = ?", array($tag_id))->num_rows();
} else if ($voucher_type_int > 0) {
$voucher_q = $this->db->query("SELECT * FROM vouchers WHERE type = ? ORDER BY date DESC, number DESC LIMIT ${page_count}, ${pagination_counter}", array($voucher_type_int));
$config['total_rows'] = $this->db->query("SELECT * FROM vouchers WHERE type = ?", array($voucher_type_int))->num_rows();
diff --git a/system/application/models/tag_model.php b/system/application/models/tag_model.php
index d1c63a3..0daabaf 100644
--- a/system/application/models/tag_model.php
+++ b/system/application/models/tag_model.php
@@ -23,11 +23,23 @@ class Tag_model extends Model {
{
if ($tag_id < 1)
return "";
- $tag_q = $this->db->query('SELECT * FROM tags WHERE id = ?', $tag_id);
+ $tag_q = $this->db->get_where('tags', array('id' => $tag_id));
if ($tag = $tag_q->row())
{
return "<span class=\"tags\" style=\"color:#" . $tag->color . "; background-color:#" . $tag->background . "\">" . $tag->title . "</span>";
}
return "";
}
+
+ function tag_name($tag_id)
+ {
+ if ($tag_id < 1)
+ return "";
+ $tag_q = $this->db->get_where('tags', array('id' => $tag_id));
+ if ($tag = $tag_q->row())
+ {
+ return $tag->title;
+ }
+ return "";
+ }
}
commit 9352a70c25a5ce5406edfa1862b7f10b15757844
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Tue Dec 7 19:26:12 2010 +0530
Added draft voucher list
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
diff --git a/system/application/controllers/voucher.php b/system/application/controllers/voucher.php
index 1e5d9bb..a403b74 100644
--- a/system/application/controllers/voucher.php
+++ b/system/application/controllers/voucher.php
@@ -24,31 +24,30 @@ class Voucher extends Controller {
case 'all' :
$this->template->set('page_title', 'All Vouchers');
$data['voucher_type'] = "";
- $data['voucher_table'] = $this->_show_voucher();
break;
case 'receipt' :
$this->template->set('page_title', 'Receipt Vouchers');
$this->template->set('nav_links', array('voucher/add/receipt' => 'New Receipt Voucher'));
$data['voucher_type'] = "receipt";
- $data['voucher_table'] = $this->_show_voucher(1);
break;
case 'payment' :
$this->template->set('page_title', 'Payment Vouchers');
$this->template->set('nav_links', array('voucher/add/payment' => 'New Payment Voucher'));
$data['voucher_type'] = "payment";
- $data['voucher_table'] = $this->_show_voucher(2);
break;
case 'contra' :
$this->template->set('page_title', 'Contra Vouchers');
$this->template->set('nav_links', array('voucher/add/contra' => 'New Contra Voucher'));
$data['voucher_type'] = "contra";
- $data['voucher_table'] = $this->_show_voucher(3);
break;
case 'journal' :
$this->template->set('page_title', 'Journal Vouchers');
$this->template->set('nav_links', array('voucher/add/journal' => 'New Journal Voucher'));
$data['voucher_type'] = "journal";
- $data['voucher_table'] = $this->_show_voucher(4);
+ break;
+ case 'draft' :
+ $this->template->set('page_title', 'Draft Vouchers');
+ $data['voucher_type'] = "";
break;
default :
$this->messages->add('Invalid voucher type', 'error');
@@ -56,32 +55,21 @@ class Voucher extends Controller {
return;
break;
}
- $this->template->load('template', 'voucher/index', $data);
- return;
- }
- function _show_voucher($voucher_type = NULL)
- {
+ $voucher_type_int = v_to_n($voucher_type);
+
$voucher_q = NULL;
/* Pagination setup */
$this->load->library('pagination');
$page_count = (int)$this->uri->segment(4);
$page_count = $this->input->xss_clean($page_count);
- if ( ! $page_count) $page_count = "0";
- $voucher_type_link = "";
- switch ($voucher_type)
- {
- case 1: $voucher_type_link = "receipt"; break;
- case 2: $voucher_type_link = "payment"; break;
- case 3: $voucher_type_link = "contra"; break;
- case 4: $voucher_type_link = "journal"; break;
- default: $voucher_type_link = "all"; break;
- }
+ if ( ! $page_count)
+ $page_count = "0";
/* Pagination configuration */
$pagination_counter = $this->config->item('row_count');
- $config['base_url'] = site_url('voucher/show/' . $voucher_type_link);
+ $config['base_url'] = site_url('voucher/show/' . $voucher_type);
$config['num_links'] = 10;
$config['per_page'] = $pagination_counter;
$config['uri_segment'] = 4;
@@ -104,14 +92,17 @@ class Voucher extends Controller {
$config['last_tag_open'] = '<li class="last">';
$config['last_tag_close'] = '</li>';
- if ($voucher_type > 5)
+ if ($voucher_type_int > 5)
{
$this->messages->add('Invalid voucher type', 'error');
redirect('voucher/show/all');
return;
- } else if ($voucher_type > 0) {
- $voucher_q = $this->db->query("SELECT * FROM vouchers WHERE type = ? ORDER BY date DESC, number DESC LIMIT ${page_count}, ${pagination_counter}", array($voucher_type));
- $config['total_rows'] = $this->db->query("SELECT * FROM vouchers WHERE type = ?", array($voucher_type))->num_rows();
+ } else if ($voucher_type == "draft") {
+ $voucher_q = $this->db->query("SELECT * FROM vouchers WHERE draft = 1 ORDER BY date DESC, number DESC LIMIT ${page_count}, ${pagination_counter}");
+ $config['total_rows'] = $this->db->query("SELECT * FROM vouchers WHERE draft = 1")->num_rows();
+ } else if ($voucher_type_int > 0) {
+ $voucher_q = $this->db->query("SELECT * FROM vouchers WHERE type = ? ORDER BY date DESC, number DESC LIMIT ${page_count}, ${pagination_counter}", array($voucher_type_int));
+ $config['total_rows'] = $this->db->query("SELECT * FROM vouchers WHERE type = ?", array($voucher_type_int))->num_rows();
} else {
$voucher_q = $this->db->query("SELECT * FROM vouchers ORDER BY date DESC, number DESC LIMIT ${page_count}, ${pagination_counter}");
$config['total_rows'] = $this->db->count_all('vouchers');
@@ -129,6 +120,7 @@ class Voucher extends Controller {
{
$html_voucher_type = n_to_v($row->type);
+ /* Showing the credit ledger name for payment and debit for other voucher types */
$ledger_type = ($row->type == 2) ? "C" : "D";
$ledger_q = $this->db->query("SELECT ledgers.name as name FROM voucher_items join ledgers on voucher_items.ledger_id = ledgers.id WHERE voucher_items.voucher_id = ? AND voucher_items.dc = ?", array($row->id, $ledger_type));
$ledger_multiple = ($ledger_q->num_rows() > 1) ? TRUE : FALSE;
@@ -171,7 +163,11 @@ class Voucher extends Controller {
}
$html .= "</tbody>";
$html .= "</table>";
- return $html;
+ $data['voucher_table'] = $html;
+
+ $this->template->load('template', 'voucher/index', $data);
+ return;
+
}
function view($voucher_type, $voucher_id = 0)
diff --git a/system/application/views/template.php b/system/application/views/template.php
index 9493e6b..51953b2 100644
--- a/system/application/views/template.php
+++ b/system/application/views/template.php
@@ -85,6 +85,7 @@ $(document).ready(function() {
<li><?php echo anchor('voucher/show/payment', 'Payment', array('title' => 'Payment Vouchers')); ?></li>
<li><?php echo anchor('voucher/show/contra', 'Contra', array('title' => 'Contra Vouchers')); ?></li>
<li><?php echo anchor('voucher/show/journal', 'Journal', array('title' => 'Journal Vouchers')); ?></li>
+ <li><?php echo anchor('voucher/show/draft', 'Draft', array('title' => 'Draft Vouchers')); ?></li>
</ul>
</li>
<li>
commit 9398f42371213f4cdee061a0935e35c978e5f28a
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Tue Dec 7 19:07:21 2010 +0530
Dynamically adding javascript and css from controllers
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
diff --git a/system/application/controllers/voucher.php b/system/application/controllers/voucher.php
index 7b83f8b..1e5d9bb 100644
--- a/system/application/controllers/voucher.php
+++ b/system/application/controllers/voucher.php
@@ -145,7 +145,7 @@ class Voucher extends Controller {
$html .= $this->Tag_model->show_voucher_tag($row->tag_id);
if ($ledger)
if ($ledger_multiple)
- $html .= anchor('voucher/view/' . strtolower($html_voucher_type) . "/" . $row->id, "( " . $ledger->name . " )", array('title' => 'View ' . ucfirst($html_voucher_type) . ' Voucher', 'class' => 'blue-link'));
+ $html .= anchor('voucher/view/' . strtolower($html_voucher_type) . "/" . $row->id, "(" . $ledger->name . ")", array('title' => 'View ' . ucfirst($html_voucher_type) . ' Voucher', 'class' => 'blue-link'));
else
$html .= anchor('voucher/view/' . strtolower($html_voucher_type) . "/" . $row->id, $ledger->name, array('title' => 'View ' . ucfirst($html_voucher_type) . ' Voucher', 'class' => 'blue-link'));
$html .= "</td>";
diff --git a/system/application/controllers/welcome.php b/system/application/controllers/welcome.php
index 98bff48..bfb8a64 100644
--- a/system/application/controllers/welcome.php
+++ b/system/application/controllers/welcome.php
@@ -13,6 +13,8 @@ class Welcome extends Controller {
$this->load->model('Ledger_model');
$this->load->library('accountlist');
$this->template->set('page_title', 'Welcome to Webzash');
+ $this->template->set('add_css', array("tufte-graph.css"));
+ $this->template->set('add_javascript', array("raphael.js", "jquery.enumerable.js", "jquery.tufte-graph.js"));
/* Draft voucher count */
$draft_q = $this->db->get_where('vouchers', array('draft' => 1));
diff --git a/system/application/views/template.php b/system/application/views/template.php
index 339f70e..9493e6b 100644
--- a/system/application/views/template.php
+++ b/system/application/views/template.php
@@ -10,7 +10,16 @@
<link type="text/css" rel="stylesheet" href="<?php echo asset_url(); ?>css/custom.css">
<link type="text/css" rel="stylesheet" href="<?php echo asset_url(); ?>css/menu.css">
<link type="text/css" rel="stylesheet" href="<?php echo asset_url(); ?>css/jquery.datepick.css">
-<link type="text/css" rel="stylesheet" href="<?php echo asset_url(); ?>css/tufte-graph.css">
+<?php
+/* Dynamically adding css files from controllers */
+if (isset($add_css))
+{
+ foreach ($add_css as $id => $row)
+ {
+ echo "<link type=\"text/css\" rel=\"stylesheet\" href=\"" . asset_url() . "css/" . $row ."\">";
+ }
+}
+?>
<script type="text/javascript" src="<?php echo asset_url(); ?>js/jquery.min.js"></script>
<script type="text/javascript" src="<?php echo asset_url(); ?>js/jquery.datepick.js"></script>
@@ -18,9 +27,16 @@
<script type="text/javascript" src="<?php echo asset_url(); ?>js/hoverIntent.js"></script>
<script type="text/javascript" src="<?php echo asset_url(); ?>js/superfish.js"></script>
<script type="text/javascript" src="<?php echo asset_url(); ?>js/supersubs.js"></script>
-<script type="text/javascript" src="<?php echo asset_url(); ?>js/raphael.js"></script>
-<script type="text/javascript" src="<?php echo asset_url(); ?>js/jquery.enumerable.js"></script>
-<script type="text/javascript" src="<?php echo asset_url(); ?>js/jquery.tufte-graph.js"></script>
+<?php
+/* Dynamically adding javascript files from controllers */
+if (isset($add_javascript))
+{
+ foreach ($add_javascript as $id => $row)
+ {
+ echo "<script type=\"text/javascript\" src=\"" . asset_url() . "js/" . $row ."\"></script>";
+ }
+}
+?>
<script type="text/javascript">
/* Loading JQuery Superfish menu */
commit a37501690f7dd22f7beec6c69c338001e948ac70
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Tue Dec 7 17:11:48 2010 +0530
Converted table heading to small caps
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
diff --git a/system/application/views/report/ledgerst.php b/system/application/views/report/ledgerst.php
index da67538..bf113e9 100644
--- a/system/application/views/report/ledgerst.php
+++ b/system/application/views/report/ledgerst.php
@@ -65,7 +65,7 @@
echo "<table border=0 cellpadding=5 class=\"simple-table ledgerst-table\">";
- echo "<thead><tr><th>DATE</th><th>NO.</th><th>LEDGER NAME</th><th>STATUS</th><th>TYPE</th><th>DR AMOUNT</th><th>CR AMOUNT</th><th>BALANCE</th></tr></thead>";
+ echo "<thead><tr><th>Date</th><th>No.</th><th>Ledger Name</th><th>Status</th><th>Type</th><th>Dr Amount</th><th>Cr Amount</th><th>Balance</th></tr></thead>";
$odd_even = "odd";
$cur_balance = 0;
commit 3e8b24beac37c48905c25d15e8a8b6c13bf0d795
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Tue Dec 7 17:09:26 2010 +0530
Added Ledger name to Ledger Statement
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
diff --git a/system/application/assets/css/tables.css b/system/application/assets/css/tables.css
index fc2caff..b0ba30e 100644
--- a/system/application/assets/css/tables.css
+++ b/system/application/assets/css/tables.css
@@ -121,7 +121,7 @@
}
.ledgerst-table td {
- padding-right: 20px;
+
}
.ledgerst-table .tr-balance {
diff --git a/system/application/views/report/ledgerst.php b/system/application/views/report/ledgerst.php
index 479a2a9..da67538 100644
--- a/system/application/views/report/ledgerst.php
+++ b/system/application/views/report/ledgerst.php
@@ -65,7 +65,7 @@
echo "<table border=0 cellpadding=5 class=\"simple-table ledgerst-table\">";
- echo "<thead><tr><th>DATE</th><th>NUMBER</th><th>STATUS</th><th>TYPE</th><th>DR AMOUNT</th><th>CR AMOUNT</th><th>BALANCE</th></tr></thead>";
+ echo "<thead><tr><th>DATE</th><th>NO.</th><th>LEDGER NAME</th><th>STATUS</th><th>TYPE</th><th>DR AMOUNT</th><th>CR AMOUNT</th><th>BALANCE</th></tr></thead>";
$odd_even = "odd";
$cur_balance = 0;
@@ -75,10 +75,10 @@
/* Opening balance */
if ($optype == "D")
{
- echo "<tr class=\"tr-balance\"><td colspan=6>Opening Balance</td><td>" . convert_dc($optype) . " " . $opbalance . "</td></tr>";
+ echo "<tr class=\"tr-balance\"><td colspan=7>Opening Balance</td><td>" . convert_dc($optype) . " " . $opbalance . "</td></tr>";
$cur_balance += $opbalance;
} else {
- echo "<tr class=\"tr-balance\"><td colspan=6>Opening Balance</td><td>" . convert_dc($optype) . " " . $opbalance . "</td></tr>";
+ echo "<tr class=\"tr-balance\"><td colspan=7>Opening Balance</td><td>" . convert_dc($optype) . " " . $opbalance . "</td></tr>";
$cur_balance -= $opbalance;
}
} else {
@@ -106,9 +106,9 @@
/* Show new current total */
if ($cur_balance < 0)
{
- echo "<tr class=\"tr-balance\"><td colspan=6>Opening</td><td>Cr " . convert_cur(-$cur_balance) . "</td></tr>";
+ echo "<tr class=\"tr-balance\"><td colspan=7>Opening</td><td>Cr " . convert_cur(-$cur_balance) . "</td></tr>";
} else {
- echo "<tr class=\"tr-balance\"><td colspan=6>Opening</td><td>Dr " . convert_cur($cur_balance) . "</td></tr>";
+ echo "<tr class=\"tr-balance\"><td colspan=7>Opening</td><td>Dr " . convert_cur($cur_balance) . "</td></tr>";
}
}
@@ -123,6 +123,39 @@
echo "<td>";
echo anchor('voucher/view/' . n_to_v($row->vtype) . '/' . $row->vid, $row->vnumber, array('title' => 'View ' . ' Voucher', 'style' => 'color:#000000'));
echo "</td>";
+
+ /* Getting opposite Ledger name */
+ echo "<td>";
+ if ($row->ldc == "D")
+ {
+
+ if ($opp_voucher_name_q = $this->db->query("SELECT * FROM voucher_items WHERE voucher_id = ? AND dc = ?", array($row->vid, "C")))
+ {
+ $opp_voucher_name_d = $opp_voucher_name_q->row();
+ $opp_ledger_name = $this->Ledger_model->get_name($opp_voucher_name_d->ledger_id);
+ if ($opp_voucher_name_q->num_rows() > 1)
+ {
+ echo anchor('voucher/view/' . n_to_v($row->vtype) . '/' . $row->vid, "(" . $opp_ledger_name . ")", array('title' => 'View ' . ' Voucher', 'style' => 'color:#000000'));
+ } else {
+ echo anchor('voucher/view/' . n_to_v($row->vtype) . '/' . $row->vid, $opp_ledger_name, array('title' => 'View ' . ' Voucher', 'style' => 'color:#000000'));
+ }
+ }
+ } else {
+ if ($opp_voucher_name_q = $this->db->query("SELECT * FROM voucher_items WHERE voucher_id = ? AND dc = ?", array($row->vid, "D")))
+ {
+ $opp_voucher_name_d = $opp_voucher_name_q->row();
+ $opp_ledger_name = $this->Ledger_model->get_name($opp_voucher_name_d->ledger_id);
+ if ($opp_voucher_name_q->num_rows() > 1)
+ {
+ echo anchor('voucher/view/' . n_to_v($row->vtype) . '/' . $row->vid, "(" . $opp_ledger_name . ")", array('title' => 'View ' . ' Voucher', 'style' => 'color:#000000'));
+ } else {
+ echo anchor('voucher/view/' . n_to_v($row->vtype) . '/' . $row->vid, $opp_ledger_name, array('title' => 'View ' . ' Voucher', 'style' => 'color:#000000'));
+ }
+ }
+
+ }
+ echo "</td>";
+
echo "<td>";
echo ($row->vdraft == 1) ? "Draft" : "Active";
echo "</td>";
@@ -162,9 +195,9 @@
/* Current Page Closing Balance */
if ($cur_balance < 0)
{
- echo "<tr class=\"tr-balance\"><td colspan=6>Closing</td><td>Cr " . convert_cur(-$cur_balance) . "</td></tr>";
+ echo "<tr class=\"tr-balance\"><td colspan=7>Closing</td><td>Cr " . convert_cur(-$cur_balance) . "</td></tr>";
} else {
- echo "<tr class=\"tr-balance\"><td colspan=6>Closing</td><td>Dr " . convert_cur($cur_balance) . "</td></tr>";
+ echo "<tr class=\"tr-balance\"><td colspan=7>Closing</td><td>Dr " . convert_cur($cur_balance) . "</td></tr>";
}
echo "</table>";
commit c814a486ba947cc03bc4e19ba81ebbb4b5be6f8e
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Tue Dec 7 16:54:13 2010 +0530
Ledger Statement now uses simple table style
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
diff --git a/system/application/assets/css/tables.css b/system/application/assets/css/tables.css
index 9eb8061..fc2caff 100644
--- a/system/application/assets/css/tables.css
+++ b/system/application/assets/css/tables.css
@@ -49,27 +49,26 @@
/******************************* SIMPLE TABLE *********************************/
/******************************************************************************/
-.simple-table
-{
- font-family: "Lucida Sans Unicode", "Lucida Grande", Sans-Serif;
- font-size: 13px;
- border-collapse: collapse;
- text-align: left;
-}
-.simple-table th
-{
- font-weight: normal;
- color: #000000;
- padding: 5px 8px;
- border-bottom: 1px solid #999999;
- border-top: 1px solid #999999;
+.simple-table {
+ font-family:"Lucida Sans Unicode", "Lucida Grande", Sans-Serif;
+ font-size:13px;
+ border-collapse:collapse;
+ text-align:left;
+}
+
+.simple-table th {
+ font-weight:normal;
+ color:#000000;
+ padding:5px 8px;
+ border-bottom:1px solid #999999;
+ border-top:1px solid #999999;
background-color:#EEEEEE;
}
-.simple-table td
-{
- border-bottom: 1px solid #BBBBBB;
- color: #000000;
- padding: 8px 8px 8px 8px;
+
+.simple-table td {
+ border-bottom:1px solid #BBBBBB;
+ color:#000000;
+ padding:8px 8px 8px 8px;
}
.simple-table tr.tr-draft {
@@ -113,12 +112,35 @@
text-align: left;
}
-.dashboard-cashbank-table td
-{
+.dashboard-cashbank-table td {
padding: 8px 8px 8px 20px;
}
-.dashboard-cashbank-table td a
-{
+.dashboard-cashbank-table td a {
color: #000000;
}
+
+.ledgerst-table td {
+ padding-right: 20px;
+}
+
+.ledgerst-table .tr-balance {
+ font-weight:bold;
+}
+
+.ledger-summary {
+ font-family: "Lucida Sans Unicode", "Lucida Grande", Sans-Serif;
+ font-size: 13px;
+ border-collapse: collapse;
+ text-align: left;
+ border: 1px solid #BBBBBB;
+ background-color:#FFFFCC;
+}
+
+.ledger-summary tr {
+ border: 1px solid #BBBBBB;
+}
+
+.ledger-summary td {
+ padding: 8px 8px 8px 8px;
+}
diff --git a/system/application/views/report/ledgerst.php b/system/application/views/report/ledgerst.php
index 3bd5cb2..479a2a9 100644
--- a/system/application/views/report/ledgerst.php
+++ b/system/application/views/report/ledgerst.php
@@ -45,21 +45,27 @@
$clbalance = $this->Ledger_model->get_ledger_balance($ledger_id); /* Final Closing Balance */
/* Ledger Summary */
+ echo "<table class=\"ledger-summary\">";
+ echo "<tr>";
if ($optype == "D")
- echo "<b>Opening Balance : </b>Dr " . $opbalance . "<br />";
+ echo "<td><b>Opening Balance</b></td><td>Dr " . $opbalance . "</td>";
else
- echo "<b>Opening Balance : </b>Cr " . $opbalance . "<br />";
+ echo "<td><b>Opening Balance</b></td><td>Cr " . $opbalance . "</td>";
+ echo "</tr>";
+ echo "<tr>";
if ($clbalance < 0)
- echo "<b>Closing Balance : </b>Cr " . convert_cur(-$clbalance) . "<br />";
+ echo "<td><b>Closing Balance</b></td><td>Cr " . convert_cur(-$clbalance) . "</td>";
else
- echo "<b>Closing Balance : </b>Dr " . convert_cur($clbalance) . "<br />";
+ echo "<td><b>Closing Balance</b></td><td>Dr " . convert_cur($clbalance) . "</td>";
+ echo "</tr>";
+ echo "</table>";
echo "<br />";
$ledgerst_q = $this->db->query("SELECT vouchers.id as vid, vouchers.number as vnumber, vouchers.date as vdate, vouchers.draft as vdraft, vouchers.type as vtype, voucher_items.amount as lamount, voucher_items.dc as ldc FROM vouchers join voucher_items on vouchers.id = voucher_items.voucher_id WHERE voucher_items.ledger_id = ? ORDER BY vouchers.date ASC, vouchers.number ASC LIMIT ${page_count}, ${pagination_counter}", array($ledger_id));
- echo "<table border=0 cellpadding=5 class=\"generaltable\">";
+ echo "<table border=0 cellpadding=5 class=\"simple-table ledgerst-table\">";
- echo "<thead><tr><th>Date</th><th>Number</th><th>Status</th><th>Type</th><th>Dr Amount</th><th>Cr Amount</th><th> Balance</th></tr></thead>";
+ echo "<thead><tr><th>DATE</th><th>NUMBER</th><th>STATUS</th><th>TYPE</th><th>DR AMOUNT</th><th>CR AMOUNT</th><th>BALANCE</th></tr></thead>";
$odd_even = "odd";
$cur_balance = 0;
@@ -100,9 +106,9 @@
/* Show new current total */
if ($cur_balance < 0)
{
- echo "<tr class=\"tr-balance\"><td colspan=6>Opening Balance</td><td>Cr " . convert_cur(-$cur_balance) . "</td></tr>";
+ echo "<tr class=\"tr-balance\"><td colspan=6>Opening</td><td>Cr " . convert_cur(-$cur_balance) . "</td></tr>";
} else {
- echo "<tr class=\"tr-balance\"><td colspan=6>Opening Balance</td><td>Dr " . convert_cur($cur_balance) . "</td></tr>";
+ echo "<tr class=\"tr-balance\"><td colspan=6>Opening</td><td>Dr " . convert_cur($cur_balance) . "</td></tr>";
}
}
@@ -156,9 +162,9 @@
/* Current Page Closing Balance */
if ($cur_balance < 0)
{
- echo "<tr class=\"tr-balance\"><td colspan=6>Closing Balance</td><td>Cr " . convert_cur(-$cur_balance) . "</td></tr>";
+ echo "<tr class=\"tr-balance\"><td colspan=6>Closing</td><td>Cr " . convert_cur(-$cur_balance) . "</td></tr>";
} else {
- echo "<tr class=\"tr-balance\"><td colspan=6>Closing Balance</td><td>Dr " . convert_cur($cur_balance) . "</td></tr>";
+ echo "<tr class=\"tr-balance\"><td colspan=6>Closing</td><td>Dr " . convert_cur($cur_balance) . "</td></tr>";
}
echo "</table>";
commit 04141aae329b85579eb036352255581dfd877445
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Tue Dec 7 16:15:54 2010 +0530
Trail balance uses the simple-table style
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
diff --git a/system/application/assets/css/tables.css b/system/application/assets/css/tables.css
index 705173a..9eb8061 100644
--- a/system/application/assets/css/tables.css
+++ b/system/application/assets/css/tables.css
@@ -80,6 +80,10 @@
background-color:#FFFFE6;
}
+.simple-table tr.tr-total {
+ background-color:#FFFFE6;
+}
+
.simple-table a.red-link {
color:#FF0000;
}
@@ -100,6 +104,10 @@
padding-right: 8px;
}
+.trial-balance-table td {
+ padding-right: 20px;
+}
+
.dashboard-cashbank-table {
border-collapse: collapse;
text-align: left;
diff --git a/system/application/views/report/trialbalance.php b/system/application/views/report/trialbalance.php
index 3b924f9..e028a09 100644
--- a/system/application/views/report/trialbalance.php
+++ b/system/application/views/report/trialbalance.php
@@ -2,7 +2,7 @@
$temp_dr_total = 0;
$temp_cr_total = 0;
- echo "<table border=0 cellpadding=5 class=\"generaltable\">";
+ echo "<table border=0 cellpadding=5 class=\"simple-table trial-balance-table\">";
echo "<thead><tr><th>Ledger A/C</th><th>O/P Balance</th><th>C/L Balance</th><th>Dr Total</th><th>Cr Total</th></tr></thead>";
$this->load->model('Ledger_model');
$all_ledgers = $this->Ledger_model->get_all_ledgers();
@@ -57,6 +57,11 @@
echo "</tr>";
$odd_even = ($odd_even == "odd") ? "even" : "odd";
}
- echo "<tr style=\"background-color:#F8F8F8;\"><td colspan=3>TOTAL</td><td>Dr " . convert_cur($temp_dr_total) . "</td><td>Cr " . convert_cur($temp_cr_total) . "</td></tr>";
+ echo "<tr class=\"tr-total\"><td colspan=3>TOTAL ";
+ if ($temp_dr_total == $temp_cr_total)
+ echo "<img src=\"" . asset_url() . "images/icons/match.png\">";
+ else
+ echo "<img src=\"" . asset_url() . "images/icons/nomatch.png\">";
+ echo "</td><td>Dr " . convert_cur($temp_dr_total) . "</td><td>Cr " . convert_cur($temp_cr_total) . "</td></tr>";
echo "</table>";
commit 4a1edfe7f6bbea613f5a5ae64bd2770b8cb38537
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Tue Dec 7 16:14:48 2010 +0530
Added images from GNOME Gion icon theme
ICON Theme : http://art.gnome.org/themes/icon/1340
Licensed under GNU GPL
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
diff --git a/system/application/assets/images/icons/match.png b/system/application/assets/images/icons/match.png
new file mode 100644
index 0000000..2fd3819
Binary files /dev/null and b/system/application/assets/images/icons/match.png differ
diff --git a/system/application/assets/images/icons/nomatch.png b/system/application/assets/images/icons/nomatch.png
new file mode 100644
index 0000000..ed750bd
Binary files /dev/null and b/system/application/assets/images/icons/nomatch.png differ
commit 7f981f2a9cca573176d77be09730f555cb10bc03
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Tue Dec 7 15:53:52 2010 +0530
Styled the Dashboard
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
diff --git a/system/application/assets/css/custom.css b/system/application/assets/css/custom.css
index d7d8919..192d0cf 100644
--- a/system/application/assets/css/custom.css
+++ b/system/application/assets/css/custom.css
@@ -110,3 +110,55 @@ ul#pagination-flickr {
font-weight:italic;
}
+/********************************* DASHBOARD **********************************/
+
+#dashboard-summary {
+ width:500px;
+ float:left;
+}
+
+.dashboard-item {
+ -moz-border-radius:3px 3px 3px 3px;
+ border-radius:3px 3px 3px 3px;
+ float:left;
+ border: 1px solid #BBBBBB;
+ margin-bottom:20px;
+ width:500px;
+}
+
+.dashboard-title {
+ color: #464646;
+ background-color:#EEEEEE;
+ padding:8px;
+ font-weight:bold;
+}
+
+.dashboard-content {
+ padding:8px;
+}
+
+#dashboard-log {
+ float:left;
+ width:450px;
+ margin-left:20px;
+}
+
+.dashboard-log-item {
+ -moz-border-radius:3px 3px 3px 3px;
+ border-radius:3px 3px 3px 3px;
+ float:left;
+ border: 1px solid #BBBBBB;
+ margin-bottom:20px;
+ width:440px;
+}
+
+.dashboard-log-title {
+ color: #464646;
+ background-color:#EEEEEE;
+ padding:8px;
+ font-weight:bold;
+}
+
+.dashboard-log-content {
+ padding:8px;
+}
diff --git a/system/application/assets/css/tables.css b/system/application/assets/css/tables.css
index f20a71c..705173a 100644
--- a/system/application/assets/css/tables.css
+++ b/system/application/assets/css/tables.css
@@ -99,3 +99,18 @@
.account-table .td-actions {
padding-right: 8px;
}
+
+.dashboard-cashbank-table {
+ border-collapse: collapse;
+ text-align: left;
+}
+
+.dashboard-cashbank-table td
+{
+ padding: 8px 8px 8px 20px;
+}
+
+.dashboard-cashbank-table td a
+{
+ color: #000000;
+}
diff --git a/system/application/views/welcome_message.php b/system/application/views/welcome_message.php
index 59f8bd2..530e7e1 100644
--- a/system/application/views/welcome_message.php
+++ b/system/application/views/welcome_message.php
@@ -82,54 +82,73 @@ jQuery(document).ready(function () {
</script>
<h3><This is beta software not meant for production use !></h3>
-<div>
- <div>Welcome back, <strong><?php echo $this->config->item('account_name');?></strong></div>
- <br />
- <div>You have <?php echo $draft_count;?> draft voucher(s)</div>
- <br />
- <?php
- if ($bank_cash_account)
- {
- echo "<table>";
- echo "<tbody>";
- foreach ($bank_cash_account as $id => $row)
- {
- echo "<tr>";
- echo "<td>" . anchor('report/ledgerst/' . $row['id'], $row['name'], array('title' => $row['name'] . ' Statement')) . "</td>";
- echo "<td>";
- if ($row['balance'] == 0)
- echo "0";
- else if ($row['balance'] > 0)
- echo "Dr " . $row['balance'];
- else
- echo "Cr " . -$row['balance'];
- echo "</td>";
- echo "</tr>";
- }
- echo "</tbody>";
- echo "</table>";
- } else {
- echo "You have not created any bank or cash account";
- }
- ?>
+<div id="dashboard-summary">
+ <div id="dashboard-welcome-back" class="dashboard-item">
+ <div class="dashboard-title">Account Summary</div>
+ <div class="dashboard-content">
+ <div>Welcome back, <strong><?php echo $this->config->item('account_name');?> !</strong></div>
+ <div id="dashboard-draft">You have <?php echo $draft_count;?> draft voucher(s)</div>
+ </div>
+ </div>
+ <div class="clear"></div>
+ <div id="dashboard-cash-bank" class="dashboard-item">
+ <div class="dashboard-title">Bank and Cash A/C's</div>
+ <div class="dashboard-content">
+ <?php
+ if ($bank_cash_account)
+ {
+ echo "<table class=\"dashboard-cashbank-table\">";
+ echo "<tbody>";
+ foreach ($bank_cash_account as $id => $row)
+ {
+ echo "<tr>";
+ echo "<td>" . anchor('report/ledgerst/' . $row['id'], $row['name'], array('title' => $row['name'] . ' Statement')) . "</td>";
+ echo "<td>";
+ if ($row['balance'] == 0)
+ echo "0";
+ else if ($row['balance'] > 0)
+ echo "Dr " . $row['balance'];
+ else
+ echo "Cr " . -$row['balance'];
+ echo "</td>";
+ echo "</tr>";
+ }
+ echo "</tbody>";
+ echo "</table>";
+ } else {
+ echo "You have not created any bank or cash account";
+ }
+ ?>
+ </div>
+ </div>
+ <div class="clear"></div>
+ <div>
+ <table border="0">
+ <tbody>
+ <tr>
+ <td width="300">
+ <div id="income-expense" class="graph">
+ <div id="income-expense-graph-header"><h4>Incomes Vs Expenses</h4></div>
+ <div id="income-expense-graph-data"></div>
+ </div>
+ </td>
+ <td width="300">
+ <div id="asset-liability" class="graph">
+ <div id="asset-liability-graph-header"><h4>Assets Vs Liabilities</h4></div>
+ <div id="asset-liability-graph-data""></div>
+ </div>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
</div>
-<div>
- <table border="0">
- <tbody>
- <tr>
- <td width="300">
- <div id="income-expense" class="graph">
- <div id="income-expense-graph-header"><h4>Incomes Vs Expenses</h4></div>
- <div id="income-expense-graph-data"></div>
- </div>
- </td>
- <td width="300">
- <div id="asset-liability" class="graph">
- <div id="asset-liability-graph-header"><h4>Assets Vs Liabilities</h4></div>
- <div id="asset-liability-graph-data""></div>
- </div>
- </td>
- </tr>
- </tbody>
- </table>
+<div id="dashboard-log">
+ <div id="dashboard-recent-log" class="dashboard-log-item">
+ <div class="dashboard-log-title">Recent Activity</div>
+ <div class="dashboard-log-content">
+ Hello World !
+ </div>
+ </div>
</div>
+<div class="clear"></div>
commit ef96ebb00be098c885fe903bc1787dbcd6de09a3
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Tue Dec 7 15:14:12 2010 +0530
Added nav-link buttons and simple-table style to account list
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
diff --git a/system/application/assets/css/custom.css b/system/application/assets/css/custom.css
index 721677d..d7d8919 100644
--- a/system/application/assets/css/custom.css
+++ b/system/application/assets/css/custom.css
@@ -109,3 +109,4 @@ ul#pagination-flickr {
font-size:12px;
font-weight:italic;
}
+
diff --git a/system/application/assets/css/style.css b/system/application/assets/css/style.css
index a6c6153..36f8abd 100644
--- a/system/application/assets/css/style.css
+++ b/system/application/assets/css/style.css
@@ -108,22 +108,18 @@ body {
margin:0 18px 0 0;
}
-#content #main ul#main-links-nav li a
-{
- color:#000000;
- font-size:100%;
- background-color:#EEE;
- border:1px solid;
- border-color: #696 #363 #363 #696;
- padding:3px;
+#content #main ul#main-links-nav li a {
+ -moz-border-radius:3px 3px 3px 3px;
+ border-radius:3px 3px 3px 3px;
+ background:repeat-x scroll 0 0 transparent;
+ color:#FFFFFF;
+ font-size:11px;
+ font-weight:bold;
+ padding:4px 10px;
+ text-shadow:-1px -1px 0 #333333;
text-decoration:none;
}
-#content #main ul#main-links-nav li a:hover
-{
- color:#444444;
-}
-
/* COMMON */
.clear {
clear:both;
diff --git a/system/application/assets/css/tables.css b/system/application/assets/css/tables.css
index d15c9bd..f20a71c 100644
--- a/system/application/assets/css/tables.css
+++ b/system/application/assets/css/tables.css
@@ -52,13 +52,12 @@
.simple-table
{
font-family: "Lucida Sans Unicode", "Lucida Grande", Sans-Serif;
- font-size: 12px;
+ font-size: 13px;
border-collapse: collapse;
text-align: left;
}
.simple-table th
{
- font-size: 12px;
font-weight: normal;
color: #000000;
padding: 5px 8px;
@@ -74,7 +73,11 @@
}
.simple-table tr.tr-draft {
- background-color:#FAF8CC;
+ background-color:#FFFFE6;
+}
+
+.simple-table tr.tr-group td {
+ background-color:#FFFFE6;
}
.simple-table a.red-link {
@@ -84,3 +87,15 @@
.simple-table a.blue-link {
color:#1A2745;
}
+
+/******************************************************************************/
+/****************************** CUSTOM TABLES *********************************/
+/******************************************************************************/
+
+.account-table td {
+ padding-right: 30px;
+}
+
+.account-table .td-actions {
+ padding-right: 8px;
+}
diff --git a/system/application/assets/images/buttons/navlink.png b/system/application/assets/images/buttons/navlink.png
new file mode 100644
index 0000000..1b13e40
Binary files /dev/null and b/system/application/assets/images/buttons/navlink.png differ
diff --git a/system/application/libraries/Accountlist.php b/system/application/libraries/Accountlist.php
index 4f2d054..28abd33 100644
--- a/system/application/libraries/Accountlist.php
+++ b/system/application/libraries/Accountlist.php
@@ -128,17 +128,20 @@ class Accountlist
$this->counter = $c;
if ($this->id != 0)
{
- echo "<tr class=\"group-tr\">";
- echo "<td class=\"group-td\">";
+ echo "<tr class=\"tr-group\">";
+ echo "<td class=\"td-group\">";
echo $this->print_space($this->counter);
- echo " " . $this->name;
+ if ($this->id <= 4)
+ echo " <strong>" . $this->name. "</strong>";
+ else
+ echo " " . $this->name;
echo "</td>";
echo "<td>Group A/C</td>";
echo "<td>-</td>";
echo "<td>-</td>";
- echo "<td>" . anchor('group/edit/' . $this->id , img(array('src' => asset_url() . "images/icons/edit.png", 'border' => '0', 'alt' => 'Edit group')), array('title' => "Edit Group")) . "</td>";
- echo "<td>" . anchor('group/delete/' . $this->id, img(array('src' => asset_url() . "images/icons/delete.png", 'border' => '0', 'alt' => 'Delete group')), array('class' => "confirmClick", 'title' => "Delete Group")) . "</td>";
+ echo "<td class=\"td-actions\">" . anchor('group/edit/' . $this->id , "Edit", array('title' => 'Edit Group', 'class' => 'red-link'));
+ echo " " . anchor('group/delete/' . $this->id, img(array('src' => asset_url() . "images/icons/delete.png", 'border' => '0', 'alt' => 'Delete group')), array('class' => "confirmClick", 'title' => "Delete Group")) . "</td>";
echo "</tr>";
}
foreach ($this->children_groups as $id => $data)
@@ -152,8 +155,8 @@ class Accountlist
$this->counter++;
foreach ($this->children_ledgers as $id => $data)
{
- echo "<tr class=\"ledger-tr\">";
- echo "<td class=\"ledger-td\">";
+ echo "<tr class=\"tr-ledger\">";
+ echo "<td class=\"td-ledger\">";
echo $this->print_space($this->counter);
echo " " . anchor('report/ledgerst/' . $data['id'], $data['name'], array('title' => $data['name'] . ' Ledger Statement', 'style' => 'color:#000000'));
echo "</td>";
@@ -181,8 +184,8 @@ class Accountlist
}
echo "</td>";
- echo "<td>" . anchor('ledger/edit/' . $data['id'], img(array('src' => asset_url() . "images/icons/edit.png", 'border' => '0', 'alt' => 'Edit Ledger')), array('title' => "Edit Ledger")) . "</td>";
- echo "<td>" . anchor('ledger/delete/' . $data['id'], img(array('src' => asset_url() . "images/icons/delete.png", 'border' => '0', 'alt' => 'Delete Ledger')), array('class' => "confirmClick", 'title' => "Delete Ledger")) . "</td>";
+ echo "<td class=\"td-actions\">" . anchor('ledger/edit/' . $data['id'], 'Edit', array('title' => "Edit Ledger", 'class' => 'red-link'));
+ echo " " . anchor('ledger/delete/' . $data['id'], img(array('src' => asset_url() . "images/icons/delete.png", 'border' => '0', 'alt' => 'Delete Ledger')), array('class' => "confirmClick", 'title' => "Delete Ledger")) . "</td>";
echo "</tr>";
}
$this->counter--;
diff --git a/system/application/views/account/index.php b/system/application/views/account/index.php
index 8799421..bcb50d7 100644
--- a/system/application/views/account/index.php
+++ b/system/application/views/account/index.php
@@ -5,8 +5,8 @@
$asset = new Accountlist();
echo "<td>";
$asset->init(0);
- echo "<table border=0 cellpadding=5 class=\"generaltable\">";
- echo "<thead><tr><th>Account Name</th><th>Type</th><th>O/P Balance</th><th>C/L Balance</th><th colspan=2>Actions</th></tr></thead>";
+ echo "<table border=0 cellpadding=5 class=\"simple-table account-table\">";
+ echo "<thead><tr><th>Account Name</th><th>Type</th><th>O/P Balance</th><th>C/L Balance</th><th></th></tr></thead>";
$asset->account_st_main(-1);
echo "</table>";
echo "</td>";
diff --git a/system/application/views/template.php b/system/application/views/template.php
index c6e96de..339f70e 100644
--- a/system/application/views/template.php
+++ b/system/application/views/template.php
@@ -97,7 +97,7 @@ $(document).ready(function() {
<?php if (isset($nav_links)) {
echo "<ul id=\"main-links-nav\">";
foreach ($nav_links as $link => $title) {
- echo "<li>" . anchor($link, $title, array('title' => $title, 'class' => 'nav-links-item')) . "</li>";
+ echo "<li>" . anchor($link, $title, array('title' => $title, 'class' => 'nav-links-item', 'style' => 'background-image:url(\'' . asset_url() . 'images/buttons/navlink.png\');')) . "</li>";
}
echo "</ul>";
} ?>
commit 75ecb62e10686c49a0295db5bd8d0ed37dba7877
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Tue Dec 7 14:09:00 2010 +0530
Added simple table styled voucher list
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
diff --git a/system/application/assets/css/custom.css b/system/application/assets/css/custom.css
index 3bc6707..721677d 100644
--- a/system/application/assets/css/custom.css
+++ b/system/application/assets/css/custom.css
@@ -64,7 +64,7 @@ ul#pagination-flickr {
border:solid 1px #FFFFFF;
}
#pagination-flickr .active{
- color:#ff0084;
+ color:#000000;
font-weight:bold;
display:block;
float:left;
diff --git a/system/application/assets/css/tables.css b/system/application/assets/css/tables.css
index b614095..d15c9bd 100644
--- a/system/application/assets/css/tables.css
+++ b/system/application/assets/css/tables.css
@@ -19,23 +19,23 @@
background:none repeat scroll 0 0 #F8FBFC;
}
-tr.tr-odd {
+.generaltable tr.tr-odd {
background:none repeat scroll 0 0 #E5F1F4;
}
-tr.tr-even {
+.generaltable tr.tr-even {
background:none repeat scroll 0 0 #F8FBFC;
}
-tr.tr-balance {
+.generaltable tr.tr-balance {
background:none repeat scroll 0 0 #FFF8C6;
}
-tr.tr-draft {
+.generaltable tr.tr-draft {
background:none repeat scroll 0 0 #DDDDDD;
}
-tr.new-row {
+.generaltable tr.new-row {
background:none repeat scroll 0 0 #EEEEEE;
}
@@ -44,3 +44,43 @@ tr.new-row {
color:#FFFFFF;
font-weight:bold;
}
+
+/******************************************************************************/
+/******************************* SIMPLE TABLE *********************************/
+/******************************************************************************/
+
+.simple-table
+{
+ font-family: "Lucida Sans Unicode", "Lucida Grande", Sans-Serif;
+ font-size: 12px;
+ border-collapse: collapse;
+ text-align: left;
+}
+.simple-table th
+{
+ font-size: 12px;
+ font-weight: normal;
+ color: #000000;
+ padding: 5px 8px;
+ border-bottom: 1px solid #999999;
+ border-top: 1px solid #999999;
+ background-color:#EEEEEE;
+}
+.simple-table td
+{
+ border-bottom: 1px solid #BBBBBB;
+ color: #000000;
+ padding: 8px 8px 8px 8px;
+}
+
+.simple-table tr.tr-draft {
+ background-color:#FAF8CC;
+}
+
+.simple-table a.red-link {
+ color:#FF0000;
+}
+
+.simple-table a.blue-link {
+ color:#1A2745;
+}
diff --git a/system/application/assets/images/icons/delete.png b/system/application/assets/images/icons/delete.png
index 6fc4d3b..8b0054a 100644
Binary files a/system/application/assets/images/icons/delete.png and b/system/application/assets/images/icons/delete.png differ
diff --git a/system/application/assets/images/icons/email.png b/system/application/assets/images/icons/email.png
index 63ac1a4..f328466 100644
Binary files a/system/application/assets/images/icons/email.png and b/system/application/assets/images/icons/email.png differ
diff --git a/system/application/controllers/voucher.php b/system/application/controllers/voucher.php
index 9a8d7c1..7b83f8b 100644
--- a/system/application/controllers/voucher.php
+++ b/system/application/controllers/voucher.php
@@ -120,13 +120,15 @@ class Voucher extends Controller {
/* Pagination initializing */
$this->pagination->initialize($config);
- $html = "<table border=0 cellpadding=5 class=\"generaltable\">";
- $html .= "<thead><tr><th>Date</th><th>Number</th><th>Ledger A/C</th><th>Type</th><th>Status</th><th>DR Amount</th><th>CR Amount</th><th colspan=5>Actions</th></tr></thead>";
+ $html = "<table border=0 cellpadding=5 class=\"simple-table\">";
+ $html .= "<thead><tr><th>Date</th><th>No</th><th>Ledger A/C</th><th>Type</th><th>Status</th><th>DR Amount</th><th>CR Amount</th><th></th></tr></thead>";
$html .= "<tbody>";
$odd_even = "odd";
foreach ($voucher_q->result() as $row)
{
+ $html_voucher_type = n_to_v($row->type);
+
$ledger_type = ($row->type == 2) ? "C" : "D";
$ledger_q = $this->db->query("SELECT ledgers.name as name FROM voucher_items join ledgers on voucher_items.ledger_id = ledgers.id WHERE voucher_items.voucher_id = ? AND voucher_items.dc = ?", array($row->id, $ledger_type));
$ledger_multiple = ($ledger_q->num_rows() > 1) ? TRUE : FALSE;
@@ -137,18 +139,17 @@ class Voucher extends Controller {
$html .= "\">";
$html .= "<td>" . date_mysql_to_php($row->date) . "</td>";
- $html .= "<td>" . $row->number . "</td>";
+ $html .= "<td>" . anchor('voucher/view/' . strtolower($html_voucher_type) . "/" . $row->id, $row->number, array('title' => 'View ' . ucfirst($html_voucher_type) . ' Voucher', 'class' => 'blue-link')) . "</td>";
$html .= "<td>";
$html .= $this->Tag_model->show_voucher_tag($row->tag_id);
if ($ledger)
if ($ledger_multiple)
- $html .= "(" . $ledger->name . ")";
+ $html .= anchor('voucher/view/' . strtolower($html_voucher_type) . "/" . $row->id, "( " . $ledger->name . " )", array('title' => 'View ' . ucfirst($html_voucher_type) . ' Voucher', 'class' => 'blue-link'));
else
- $html .= $ledger->name;
+ $html .= anchor('voucher/view/' . strtolower($html_voucher_type) . "/" . $row->id, $ledger->name, array('title' => 'View ' . ucfirst($html_voucher_type) . ' Voucher', 'class' => 'blue-link'));
$html .= "</td>";
- $html_voucher_type = n_to_v($row->type);
$html .= "<td>" . ucfirst($html_voucher_type) . "</td>";
if ($row->draft == 0)
$html .= "<td>Active</td>";
@@ -157,15 +158,13 @@ class Voucher extends Controller {
$html .= "<td>" . $row->dr_total . "</td>";
$html .= "<td>" . $row->cr_total . "</td>";
- $html .= "<td>" . anchor('voucher/view/' . strtolower($html_voucher_type) . "/" . $row->id , img(array('src' => asset_url() . "images/icons/view.png", 'border' => '0', 'alt' => 'View ' . ucfirst($html_voucher_type) . ' Voucher')), array('title' => 'View ' . ucfirst($html_voucher_type) . ' Voucher')) . "</td>";
-
- $html .= "<td>" . anchor('voucher/edit/' . strtolower($html_voucher_type) . "/" . $row->id , img(array('src' => asset_url() . "images/icons/edit.png", 'border' => '0', 'alt' => 'Edit ' . ucfirst($html_voucher_type) . ' Voucher')), array('title' => 'Edit ' . ucfirst($html_voucher_type) . ' Voucher')) . "</td>";
+ $html .= "<td>" . anchor('voucher/edit/' . strtolower($html_voucher_type) . "/" . $row->id , "Edit", array('title' => 'Edit ' . ucfirst($html_voucher_type) . ' Voucher', 'class' => 'red-link')) . " ";
- $html .= "<td>" . anchor('voucher/delete/' . strtolower($html_voucher_type) . "/" . $row->id , img(array('src' => asset_url() . "images/icons/delete.png", 'border' => '0', 'alt' => 'Delete ' . ucfirst($html_voucher_type) . ' Voucher', 'class' => "confirmClick", 'title' => "Delete voucher")), array('title' => 'Delete ' . ucfirst($html_voucher_type) . ' Voucher')) . "</td>";
+ $html .= " " . anchor('voucher/delete/' . strtolower($html_voucher_type) . "/" . $row->id , img(array('src' => asset_url() . "images/icons/delete.png", 'border' => '0', 'alt' => 'Delete ' . ucfirst($html_voucher_type) . ' Voucher', 'class' => "confirmClick", 'title' => "Delete voucher")), array('title' => 'Delete ' . ucfirst($html_voucher_type) . ' Voucher')) . " ";
- $html .= "<td>" . anchor_popup('voucher/printhtml/' . strtolower($html_voucher_type) . "/" . $row->id , img(array('src' => asset_url() . "images/icons/print.png", 'border' => '0', 'alt' => 'Print ' . ucfirst($html_voucher_type) . ' Voucher')), array('title' => 'Print ' . ucfirst($html_voucher_type) . ' Voucher')) . "</td>";
+ $html .= " " . anchor_popup('voucher/printhtml/' . strtolower($html_voucher_type) . "/" . $row->id , img(array('src' => asset_url() . "images/icons/print.png", 'border' => '0', 'alt' => 'Print ' . ucfirst($html_voucher_type) . ' Voucher')), array('title' => 'Print ' . ucfirst($html_voucher_type) . ' Voucher')) . " ";
- $html .= "<td>" . anchor_popup('voucher/email/' . strtolower($html_voucher_type) . "/" . $row->id , img(array('src' => asset_url() . "images/icons/email.png", 'border' => '0', 'alt' => 'Email ' . ucfirst($html_voucher_type) . ' Voucher')), array('title' => 'Email ' . ucfirst($html_voucher_type) . ' Voucher', 'width' => '500', 'height' => '300')) . "</td>";
+ $html .= " " . anchor_popup('voucher/email/' . strtolower($html_voucher_type) . "/" . $row->id , img(array('src' => asset_url() . "images/icons/email.png", 'border' => '0', 'alt' => 'Email ' . ucfirst($html_voucher_type) . ' Voucher')), array('title' => 'Email ' . ucfirst($html_voucher_type) . ' Voucher', 'width' => '500', 'height' => '300')) . "</td>";
$html .= "</tr>";
$odd_even = ($odd_even == "odd") ? "even" : "odd";
commit 27acf86e71e2debf23b2074016f9add99afaec59
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Mon Dec 6 21:50:18 2010 +0530
Auto configure base_url
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
diff --git a/system/application/config/config.php b/system/application/config/config.php
index 87bccd1..08e7d6d 100644
--- a/system/application/config/config.php
+++ b/system/application/config/config.php
@@ -11,7 +11,21 @@
| http://example.com/
|
*/
-$config['base_url'] = "http://localhost/webzash/";
+// $config['base_url'] = "http://localhost/webzash/";
+
+/*
+|--------------------------------------------------------------------------
+| Base Site URL : Auto configuration
+|--------------------------------------------------------------------------
+|
+| Automatically configure base_url. Works with both http and https
+| Taken fom http://codeigniter.com/wiki/Automatic_configbase_url/
+|
+*/
+
+$config['base_url'] = ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == "on") ? "https" : "http");
+$config['base_url'] .= "://".$_SERVER['HTTP_HOST'];
+$config['base_url'] .= str_replace(basename($_SERVER['SCRIPT_NAME']),"",$_SERVER['SCRIPT_NAME']);
/*
|--------------------------------------------------------------------------
commit d4a99a7ead5f90ec3d56631f71b042da5a65f519
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Mon Dec 6 16:27:01 2010 +0530
Showing even one bank account
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
diff --git a/system/application/controllers/welcome.php b/system/application/controllers/welcome.php
index c9240d2..98bff48 100644
--- a/system/application/controllers/welcome.php
+++ b/system/application/controllers/welcome.php
@@ -20,7 +20,7 @@ class Welcome extends Controller {
/* Bank and Cash Ledger accounts */
$bank_q = $this->db->get_where('ledgers', array('type' => 'B'));
- if ($bank_q->num_rows() > 1)
+ if ($bank_q->num_rows() > 0)
{
foreach ($bank_q->result() as $row)
{
commit cdb4226f474534ceaf9a29bb794d1f1bf5703fb7
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Mon Dec 6 16:02:30 2010 +0530
Show voucher date before voucher number
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
diff --git a/system/application/controllers/voucher.php b/system/application/controllers/voucher.php
index 18301c7..9a8d7c1 100644
--- a/system/application/controllers/voucher.php
+++ b/system/application/controllers/voucher.php
@@ -121,7 +121,7 @@ class Voucher extends Controller {
$this->pagination->initialize($config);
$html = "<table border=0 cellpadding=5 class=\"generaltable\">";
- $html .= "<thead><tr><th>Number</th><th>Date</th><th>Ledger A/C</th><th>Type</th><th>Status</th><th>DR Amount</th><th>CR Amount</th><th colspan=5>Actions</th></tr></thead>";
+ $html .= "<thead><tr><th>Date</th><th>Number</th><th>Ledger A/C</th><th>Type</th><th>Status</th><th>DR Amount</th><th>CR Amount</th><th colspan=5>Actions</th></tr></thead>";
$html .= "<tbody>";
$odd_even = "odd";
@@ -135,8 +135,9 @@ class Voucher extends Controller {
$html .= "<tr class=\"tr-" . $odd_even;
$html .= ($row->draft == 1) ? " tr-draft " : "";
$html .= "\">";
- $html .= "<td>" . $row->number . "</td>";
+
$html .= "<td>" . date_mysql_to_php($row->date) . "</td>";
+ $html .= "<td>" . $row->number . "</td>";
$html .= "<td>";
$html .= $this->Tag_model->show_voucher_tag($row->tag_id);
diff --git a/system/application/views/report/ledgerst.php b/system/application/views/report/ledgerst.php
index 9c6fdf4..3bd5cb2 100644
--- a/system/application/views/report/ledgerst.php
+++ b/system/application/views/report/ledgerst.php
@@ -59,7 +59,7 @@
echo "<table border=0 cellpadding=5 class=\"generaltable\">";
- echo "<thead><tr><th>Number</th><th>Date</th><th>Status</th><th>Type</th><th>Dr Amount</th><th>Cr Amount</th><th> Balance</th></tr></thead>";
+ echo "<thead><tr><th>Date</th><th>Number</th><th>Status</th><th>Type</th><th>Dr Amount</th><th>Cr Amount</th><th> Balance</th></tr></thead>";
$odd_even = "odd";
$cur_balance = 0;
@@ -112,10 +112,10 @@
echo ($row->vdraft == 1) ? " tr-draft " : "";
echo "\">";
echo "<td>";
- echo anchor('voucher/view/' . n_to_v($row->vtype) . '/' . $row->vid, $row->vnumber, array('title' => 'View ' . ' Voucher', 'style' => 'color:#000000'));
+ echo date_mysql_to_php($row->vdate);
echo "</td>";
echo "<td>";
- echo date_mysql_to_php($row->vdate);
+ echo anchor('voucher/view/' . n_to_v($row->vtype) . '/' . $row->vid, $row->vnumber, array('title' => 'View ' . ' Voucher', 'style' => 'color:#000000'));
echo "</td>";
echo "<td>";
echo ($row->vdraft == 1) ? "Draft" : "Active";
commit a0f966942f859c36ee474805b7b08c4452732e71
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Mon Dec 6 15:49:49 2010 +0530
Removed debugging data
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
diff --git a/system/application/controllers/welcome.php b/system/application/controllers/welcome.php
index 8629c4a..c9240d2 100644
--- a/system/application/controllers/welcome.php
+++ b/system/application/controllers/welcome.php
@@ -49,7 +49,7 @@ class Welcome extends Controller {
$expense = new Accountlist();
$expense->init(4);
- $data['expense_total'] = $expense->total; var_dump($data);
+ $data['expense_total'] = $expense->total;
$this->template->load('template', 'welcome_message', $data);
return;
commit 22d7024a897bdd0e2d53d4a546941a718d5e7b6d
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Mon Dec 6 15:47:12 2010 +0530
Updated Dashboard
- Added graph for assets vs liabilities
- Added graph for incomes vs expenses
- Added draft voucher count
- Added balance of cash and bank accounts
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
diff --git a/system/application/controllers/welcome.php b/system/application/controllers/welcome.php
index c14fd24..8629c4a 100644
--- a/system/application/controllers/welcome.php
+++ b/system/application/controllers/welcome.php
@@ -10,8 +10,48 @@ class Welcome extends Controller {
function index()
{
+ $this->load->model('Ledger_model');
+ $this->load->library('accountlist');
$this->template->set('page_title', 'Welcome to Webzash');
- $this->template->load('template', 'welcome_message');
+
+ /* Draft voucher count */
+ $draft_q = $this->db->get_where('vouchers', array('draft' => 1));
+ $data['draft_count'] = $draft_q->num_rows();
+
+ /* Bank and Cash Ledger accounts */
+ $bank_q = $this->db->get_where('ledgers', array('type' => 'B'));
+ if ($bank_q->num_rows() > 1)
+ {
+ foreach ($bank_q->result() as $row)
+ {
+ $data['bank_cash_account'][] = array(
+ 'id' => $row->id,
+ 'name' => $row->name,
+ 'balance' => $this->Ledger_model->get_ledger_balance($row->id),
+ );
+ }
+ } else {
+ $data['bank_cash_account'] = array();
+ }
+
+ /* Calculating total of Assets, Liabilities, Incomes, Expenses */
+ $asset = new Accountlist();
+ $asset->init(1);
+ $data['asset_total'] = $asset->total;
+
+ $liability = new Accountlist();
+ $liability->init(2);
+ $data['liability_total'] = -$liability->total;
+
+ $income = new Accountlist();
+ $income->init(3);
+ $data['income_total'] = -$income->total;
+
+ $expense = new Accountlist();
+ $expense->init(4);
+ $data['expense_total'] = $expense->total; var_dump($data);
+
+ $this->template->load('template', 'welcome_message', $data);
return;
}
}
diff --git a/system/application/views/welcome_message.php b/system/application/views/welcome_message.php
index e993b6d..59f8bd2 100644
--- a/system/application/views/welcome_message.php
+++ b/system/application/views/welcome_message.php
@@ -1,4 +1,135 @@
-<h3>This is beta software not meant to be used in production use.</h3>
-Enjoy !<br /><br />
-Send your feedback to : pshah.mumbai(a)gmail.com<br /><br />
-Any contribution is welcomed :)
+<style type="text/css">
+ #income-expense-graph-header {
+ width: 200px;
+ text-align: center;
+ padding-bottom:10px;
+ }
+ #income-expense-graph-data {
+ width: 200px;
+ height: 200px;
+ text-align: center;
+ }
+ #asset-liability-graph-header {
+ width: 200px;
+ text-align: center;
+ padding-bottom:10px;
+ }
+ #asset-liability-graph-data {
+ width: 200px;
+ height: 200px;
+ text-align: center;
+ }
+</style>
+
+<script type="text/javascript">
+jQuery(document).ready(function () {
+ jQuery('#income-expense-graph-data').tufteBar({
+ data: [
+ // First element is the y-value
+ // Other elements are arbitary - they are not used by the lib
+ // but are passed back into callback functions
+ [<?php echo $income_total; ?>, {label: 'Incomes'}],
+ [<?php echo $expense_total; ?>, {label: 'Expenses'}]
+ ],
+
+ // Bar width in arbitrary units, 1.0 means the bars will be snuggled
+ // up next to each other
+ barWidth: 0.5,
+
+ // The label on top of the bar - can contain HTML
+ // formatNumber inserts commas as thousands separators in a number
+ barLabel: function(index) {
+ return $.tufteBar.formatNumber(this[0])
+ },
+
+ // The label on the x-axis - can contain HTML
+ axisLabel: function(index) { return this[1].label },
+
+ // The color of the bar
+ color: function(index) {
+ return ['#33CC66', '#C00000'][index % 2]
+ },
+ });
+
+ jQuery('#asset-liability-graph-data').tufteBar({
+ data: [
+ // First element is the y-value
+ // Other elements are arbitary - they are not used by the lib
+ // but are passed back into callback functions
+ [<?php echo $asset_total; ?>, {label: 'Assets'}],
+ [<?php echo $liability_total; ?>, {label: 'Liabilities'}]
+ ],
+
+ // Bar width in arbitrary units, 1.0 means the bars will be snuggled
+ // up next to each other
+ barWidth: 0.5,
+
+ // The label on top of the bar - can contain HTML
+ // formatNumber inserts commas as thousands separators in a number
+ barLabel: function(index) {
+ return $.tufteBar.formatNumber(this[0])
+ },
+
+ // The label on the x-axis - can contain HTML
+ axisLabel: function(index) { return this[1].label },
+
+ // The color of the bar
+ color: function(index) {
+ return ['#33CC66', '#C00000'][index % 2]
+ },
+ });
+});
+</script>
+
+<h3><This is beta software not meant for production use !></h3>
+<div>
+ <div>Welcome back, <strong><?php echo $this->config->item('account_name');?></strong></div>
+ <br />
+ <div>You have <?php echo $draft_count;?> draft voucher(s)</div>
+ <br />
+ <?php
+ if ($bank_cash_account)
+ {
+ echo "<table>";
+ echo "<tbody>";
+ foreach ($bank_cash_account as $id => $row)
+ {
+ echo "<tr>";
+ echo "<td>" . anchor('report/ledgerst/' . $row['id'], $row['name'], array('title' => $row['name'] . ' Statement')) . "</td>";
+ echo "<td>";
+ if ($row['balance'] == 0)
+ echo "0";
+ else if ($row['balance'] > 0)
+ echo "Dr " . $row['balance'];
+ else
+ echo "Cr " . -$row['balance'];
+ echo "</td>";
+ echo "</tr>";
+ }
+ echo "</tbody>";
+ echo "</table>";
+ } else {
+ echo "You have not created any bank or cash account";
+ }
+ ?>
+</div>
+<div>
+ <table border="0">
+ <tbody>
+ <tr>
+ <td width="300">
+ <div id="income-expense" class="graph">
+ <div id="income-expense-graph-header"><h4>Incomes Vs Expenses</h4></div>
+ <div id="income-expense-graph-data"></div>
+ </div>
+ </td>
+ <td width="300">
+ <div id="asset-liability" class="graph">
+ <div id="asset-liability-graph-header"><h4>Assets Vs Liabilities</h4></div>
+ <div id="asset-liability-graph-data""></div>
+ </div>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+</div>
commit 0b0c140f76f67b7c4cbc3c8aebfd5fb92c8e628d
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Mon Dec 6 15:46:16 2010 +0530
Added jQuery TufteGraph javascript graph library
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
diff --git a/system/application/assets/css/tufte-graph.css b/system/application/assets/css/tufte-graph.css
new file mode 100644
index 0000000..a868b4b
--- /dev/null
+++ b/system/application/assets/css/tufte-graph.css
@@ -0,0 +1,41 @@
+.graph {
+ margin-bottom: 50px;
+ margin-top: 30px;
+ clear: both;
+ font-family: georgia, serif;
+ font-size: 14px;
+}
+
+.graph .label {
+ text-align: center;
+ padding-top: 5px;
+ padding-bottom: 5px;
+}
+.graph-header h3 {
+ margin-bottom: 0px;
+}
+.graph-header {
+ text-align: center;
+}
+.graph-header p {
+ margin-top: 0px;
+}
+
+.graph .legend td, .graph .legend, .graph .legend tr {
+ padding: 0px;
+ margin: 0px;
+ border-collapse:collapse;
+}
+
+.graph .legend {
+ margin-left: 10px;
+}
+.graph .legend td {
+ padding-right: 5px;
+}
+
+.graph .legend .color-box {
+ width: 14px;
+ height: 10px;
+ overflow: hidden;
+}
diff --git a/system/application/assets/js/jquery.enumerable.js b/system/application/assets/js/jquery.enumerable.js
new file mode 100644
index 0000000..c34d423
--- /dev/null
+++ b/system/application/assets/js/jquery.enumerable.js
@@ -0,0 +1,102 @@
+(function ( $ ) {
+ var methods = {
+ // $([1,2,3]).collect(function() { return this * this }) // => [1, 4, 9]
+ collect: function(enumerable, callback) {
+ var result = [];
+ $.each(enumerable, function(index) {
+ result.push(callback.call(this, index));
+ });
+ return result;
+ },
+
+ // $([1,2,3]).inject(0, function(a) { return a + this }) // => 6
+ inject: function(enumerable, initialValue, callback) {
+ var accumulator = initialValue;
+
+ $.each(enumerable, function (index) {
+ accumulator = callback.call(this, accumulator, index);
+ });
+ return accumulator;
+ },
+
+ // $([1,2,3]).select(function() { return this % 2 == 1 }) // => [1, 3]
+ select: function(enumerable, callback) {
+ var result = [];
+ $.each(enumerable, function(index) {
+ if (callback.call(this, index))
+ result.push(this);
+ });
+ return result;
+ },
+
+ // $([1,2,3]).reject(function() { return this % 2 == 1 }) // => [2]
+ reject: function(enumerable, callback) {
+ return $.select(enumerable, negate(callback));
+ },
+
+ // $([1,2]).any(function() { return this == 1 }) // => true
+ any: function(enumerable, callback) {
+ return $.inject(enumerable, false, function(accumulator, index) {
+ return accumulator || callback.call(this, index);
+ });
+ },
+
+ // $([1,1]).any(function() { return this == 1 }) // => true
+ all: function(enumerable, callback) {
+ return $.inject(enumerable, true, function(accumulator, index) {
+ return accumulator && callback.call(this, index);
+ });
+ },
+
+ // $([1,2,3]).sum() // => 6
+ sum: function(enumerable) {
+ return $.inject(enumerable, 0, function(accumulator) {
+ return accumulator + this;
+ });
+ }
+ };
+
+ var staticFunctions = {};
+ var iteratorFunctions = {};
+ $.each( methods, function(name, f){
+ staticFunctions[name] = makeStaticFunction(f);
+ iteratorFunctions[name] = makeIteratorFunction(staticFunctions[name]);
+ });
+ $.extend(staticFunctions);
+ $.fn.extend(iteratorFunctions);
+
+ // Private methods
+ function makeStaticFunction(f) {
+ return function() {
+ if (arguments.length > 1) // The first argument is the enumerable
+ validateCallback(arguments[arguments.length - 1]);
+
+ return f.apply(this, arguments);
+ }
+ }
+
+ function makeIteratorFunction(staticFunction) {
+ return function() {
+ // arguments isn't a real array, concat doesn't work
+ // unless you explicitly convert it
+ function toArray() {
+ var result = []
+ for (var i = 0; i < this.length; i++)
+ result.push(this[i])
+ return(result)
+ }
+ return staticFunction.apply(this, [this].concat(toArray.apply(arguments)))
+ }
+ }
+
+ function validateCallback(callback) {
+ if (!jQuery.isFunction(callback))
+ throw("callback needs to be a function, it was: " + callback);
+ }
+
+ function negate(f) {
+ return function() {
+ return !f.apply(this, arguments)
+ }
+ }
+})( jQuery );
diff --git a/system/application/assets/js/jquery.tufte-graph.js b/system/application/assets/js/jquery.tufte-graph.js
new file mode 100644
index 0000000..37ad08f
--- /dev/null
+++ b/system/application/assets/js/jquery.tufte-graph.js
@@ -0,0 +1,233 @@
+(function($) {
+ //
+ // Public interface
+ //
+
+ // The main event - creates a pretty graph. See index.html for documentation.
+ $.fn.tufteBar = function(options) {
+ var defaultCopy = $.extend(true, {}, $.fn.tufteBar.defaults);
+ var options = $.extend(true, defaultCopy, options);
+
+ return this.each(function () {
+ draw(makePlot($(this), options), options);
+ });
+ }
+
+ // Defaults are exposed publically so you can reuse bits that you find
+ // handy (the colors, for instance)
+ $.fn.tufteBar.defaults = {
+ barWidth: 0.8,
+ colors: ['#07093D', '#0C0F66', '#476FB2'],
+ color: function(index, stackedIndex, options) { return options.colors[stackedIndex % options.colors.length]; },
+ barLabel: function(index, stackedIndex) {
+ return $.tufteBar.formatNumber(totalValue(this[0]));
+ },
+ axisLabel: function(index, stackedIndex) { return index; },
+ legend: {
+ color: function(index, options) { return options.colors[index % options.colors.length]; },
+ label: function(index) { return this; }
+ }
+ }
+
+ $.tufteBar = {
+ // Add thousands separators to a number to make it look pretty.
+ // 1000 -> 1,000
+ formatNumber: function(nStr) {
+ // http://www.mredkj.com/javascript/nfbasic.html
+ nStr += '';
+ x = nStr.split('.');
+ x1 = x[0];
+ x2 = x.length > 1 ? '.' + x[1] : '';
+ var rgx = /(\d+)(\d{3})/;
+ while (rgx.test(x1)) {
+ x1 = x1.replace(rgx, '$1' + ',' + '$2');
+ }
+ return x1 + x2;
+ }
+ }
+
+ //
+ // Private functions
+ //
+
+ // This function should be applied to any option used from the options hash.
+ // It allows options to be provided as either static values or functions which are
+ // evaluated each time they are used
+ function resolveOption(option, element) {
+ // the @arguments@ special variable looks like an array, but really isn't, so we
+ // need to transform it in order to perform array function on it
+ function toArray() {
+ var result = []
+ for (var i = 0; i < this.length; i++)
+ result.push(this[i])
+ return(result)
+ }
+
+ return $.isFunction(option) ? option.apply(element, toArray.apply(arguments).slice(2, arguments.length)) : option;
+ }
+
+ // Returns the total value of a bar, for labeling or plotting. Y values can either be
+ // a single number (for a normal graph), or an array of numbers (for a stacked graph)
+ function totalValue(value) {
+ if (value instanceof Array)
+ return $.sum(value);
+ else
+ return value;
+ }
+
+ function draw(plot, options) {
+ var ctx = plot.ctx;
+ var axis = plot.axis;
+
+ // Iterate over each bar
+ $(options.data).each(function (i) {
+ var element = this;
+ var x = i + 0.5;
+ var all_y = null;
+
+ if (element[0] instanceof Array) {
+ // This is a stacked bar, so the data is all good to go
+ all_y = element[0];
+ } else {
+ // This is a normal bar, wrap in an array to make it a stacked bar with one data point
+ all_y = [element[0]];
+ }
+
+ if ($(all_y).any(function() { return isNaN(+this); })) {
+ throw("Non-numeric value provided for y: " + element[0]);
+ }
+
+ var lastY = 0;
+
+ pixel_scaling_function = function(axis) {
+ var scale = axis.pixelLength / (axis.max - axis.min);
+ return function (value) {
+ return (value - axis.min) * scale;
+ }
+ }
+
+ // These functions transform a value from plot coordinates to pixel coordinates
+ var t = {}
+ t.W = pixel_scaling_function(axis.x);
+ t.H = pixel_scaling_function(axis.y);
+ t.X = t.W;
+ // Y needs to invert the result since 0 in plot coords is bottom left, but 0 in pixel coords is top left
+ t.Y = function(y) { return axis.y.pixelLength - t.H(y) };
+
+ // Iterate over each data point for this bar and render a rectangle for each
+ $(all_y).each(function(stackedIndex) {
+ var optionResolver = function(option) { // Curry resolveOption for convenience
+ return resolveOption(option, element, i, stackedIndex, options);
+ }
+
+ var y = all_y[stackedIndex];
+ var halfBar = optionResolver(options.barWidth) / 2;
+ var left = x - halfBar,
+ width = halfBar * 2,
+ top = lastY + y,
+ height = y;
+
+ // Need to both fill and stroke the rect to make sure the whole area is covered
+ // You get nasty artifacts otherwise
+ var color = optionResolver(options.color);
+ var coords = [t.X(left), t.Y(top), t.W(width), t.H(height)];
+
+ ctx.rect(coords[0], coords[1], coords[2], coords[3]).attr({stroke: color, fill: color});
+
+ lastY = lastY + y;
+ });
+
+ addLabel = function(klass, text, pos) {
+ html = '<div style="position:absolute;" class="label ' + klass + '">' + text + "</div>";
+ $(html).css(pos).appendTo( plot.target );
+ }
+
+ var optionResolver = function(option) { // Curry resolveOption for convenience
+ return resolveOption(option, element, i, options);
+ }
+ addLabel('bar-label', optionResolver(options.barLabel), {
+ left: t.X(x - 0.5),
+ bottom: t.H(lastY),
+ width: t.W(1)
+ });
+ addLabel('axis-label', optionResolver(options.axisLabel), {
+ left: t.X(x - 0.5),
+ top: t.Y(0),
+ width: t.W(1)
+ });
+ });
+ addLegend(plot, options);
+ }
+
+ // If legend data has been provided, transform it into an
+ // absolutely positioned table placed at the top right of the graph
+ function addLegend(plot, options) {
+ if (options.legend.data) {
+ elements = $(options.legend.data).collect(function(i) {
+ var optionResolver = (function (element) {
+ return function(option) { // Curry resolveOption for convenience
+ return resolveOption(option, element, i, options);
+ }
+ })(this);
+
+ var colorBox = '<div class="color-box" style="background-color:' + optionResolver(options.legend.color) + '"></div>';
+ var label = optionResolver(options.legend.label);
+
+ return "<tr><td>" + colorBox + "</td><td>" + label + "</td></tr>";
+ });
+
+ $('<table class="legend">' + elements.reverse().join("") + '</table>').css({
+ position: 'absolute',
+ top: '0px',
+ left: plot.width + 'px'
+ }).appendTo( plot.target );
+ }
+ }
+
+ // Calculates the range of the graph by looking for the
+ // maximum y-value
+ function makeAxis(options) {
+ var axis = {
+ x: {},
+ y: {}
+ }
+
+ axis.x.min = 0
+ axis.x.max = options.data.length;
+ axis.y.min = 0;
+ axis.y.max = 0;
+
+ $(options.data).each(function() {
+ var y = totalValue(this[0]);
+ if( y < axis.y.min ) throw("Negative values not supported");
+ if( y > axis.y.max ) axis.y.max = y;
+ });
+
+ if( axis.x.max <= 0) throw("You must have at least one data point");
+ if( axis.y.max <= 0) throw("You must have at least one y-value greater than 0");
+
+ return axis;
+ }
+
+ // Creates the canvas object to draw on, and set up the axes
+ function makePlot(target, options) {
+ var plot = {};
+ plot.target = target;
+ plot.width = target.width();
+ plot.height = target.height();
+ target.html( '' ).css( 'position', 'relative' );
+
+ if( plot.width <= 0 || plot.height <= 0 ) {
+ throw "Invalid dimensions for plot, width = " + plot.width + ", height = " + plot.height;
+ }
+
+ // the canvas
+ plot.ctx = Raphael(target[0].id, plot.width, plot.height);
+
+ plot.axis = makeAxis(options);
+ plot.axis.x.pixelLength = plot.width;
+ plot.axis.y.pixelLength = plot.height;
+
+ return plot;
+ }
+} )( jQuery );
diff --git a/system/application/assets/js/raphael.js b/system/application/assets/js/raphael.js
new file mode 100644
index 0000000..7d48370
--- /dev/null
+++ b/system/application/assets/js/raphael.js
@@ -0,0 +1,1690 @@
+/*
+ * Raphael 0.5.12 - JavaScript Vector Library
+ *
+ * Copyright (c) 2008 Dmitry Baranovskiy (http://raphaeljs.com)
+ * Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) license.
+ */
+var Raphael = (function (type) {
+ var r = function () {
+ return r._create.apply(r, arguments);
+ };
+ r.version = "0.5.12";
+ r.type = type;
+ var C = {};
+ function Matrix(m11, m12, m21, m22, dx, dy) {
+ this.m = [
+ [m11 || 1, m12 || 0, 0],
+ [m21 || 0, m22 || 1, 0],
+ [dx || 0, dy || 0, 1]
+ ];
+ }
+
+ C._getX = C._getY = C._getW = C._getH = function (x) { return x; };
+
+ if (type == "VML") {
+ Matrix.prototype.toString = function () {
+ return "progid:DXImageTransform.Microsoft.Matrix(M11=" + this.m[0][0] +
+ ", M12=" + this.m[1][0] + ", M21=" + this.m[0][1] + ", M22=" + this.m[1][1] +
+ ", Dx=" + this.m[2][0] + ", Dy=" + this.m[2][1] + ", sizingmethod='auto expand', filtertype='bilinear')";
+ };
+ var thePath = function (params, pathString, VML) {
+ var g = document.createElement("rvml:group"), gl = g.style;
+ gl.position = "absolute";
+ gl.left = 0;
+ gl.top = 0;
+ gl.width = VML.width + "px";
+ gl.height = VML.height + "px";
+ var el = document.createElement("rvml:shape"), ol = el.style;
+ ol.width = VML.width + "px";
+ ol.height = VML.height + "px";
+ el.path = "";
+ if (params["class"]) {
+ el.className = params["class"];
+ }
+ el.coordsize = this.coordsize;
+ el.coordorigin = this.coordorigin;
+ g.appendChild(el);
+ VML.canvas.appendChild(g);
+ var p = new Element(el, g, VML);
+ setFillAndStroke(p, params);
+ if (params.gradient) {
+ addGrdientFill(p, params.gradient);
+ }
+ p.isAbsolute = true;
+ p.type = "path";
+ p.path = [];
+ p.last = {x: 0, y: 0, bx: 0, by: 0, isAbsolute: true};
+ p.Path = "";
+ p.absolutely = function () {
+ this.isAbsolute = true;
+ return this;
+ };
+ p.relatively = function () {
+ this.isAbsolute = false;
+ return this;
+ };
+ p.redraw = function () {
+ this.Path = "";
+ var oldPath = this.path;
+ this.path = [];
+ for (var i = 0, ii = oldPath.length; i < ii; i++) {
+ if (oldPath[i].type != "end") {
+ this[oldPath[i].type + "To"].apply(this, oldPath[i].arg);
+ } else {
+ this.andClose();
+ }
+ }
+ return this;
+ };
+ p.moveTo = function (x, y) {
+ var d = this.isAbsolute?"m":"t";
+ var _getX = this.isAbsolute ? VML._getX : VML._getW;
+ var _getY = this.isAbsolute ? VML._getY : VML._getH;
+ d += Math.round(_getX(parseFloat(x, 10))) + " " + Math.round(_getY(parseFloat(y, 10)));
+ this[0].path = this.Path += d;
+ this.last.x = (this.isAbsolute ? 0 : this.last.x) + _getX(parseFloat(x, 10));
+ this.last.y = (this.isAbsolute ? 0 : this.last.y) + _getY(parseFloat(y, 10));
+ this.last.isAbsolute = this.isAbsolute;
+ this.path.push({type: "move", arg: [].slice.call(arguments, 0), pos: this.isAbsolute});
+ return this;
+ };
+ p.lineTo = function (x, y) {
+ var d = this.isAbsolute?"l":"r";
+ var _getX = this.isAbsolute ? VML._getX : VML._getW;
+ var _getY = this.isAbsolute ? VML._getY : VML._getH;
+ d += Math.round(_getX(parseFloat(x, 10))) + " " + Math.round(_getY(parseFloat(y, 10)));
+ this[0].path = this.Path += d;
+ this.last.x = (this.isAbsolute ? 0 : this.last.x) + _getX(parseFloat(x, 10));
+ this.last.y = (this.isAbsolute ? 0 : this.last.y) + _getY(parseFloat(y, 10));
+ this.last.isAbsolute = this.isAbsolute;
+ this.path.push({type: "line", arg: [].slice.call(arguments, 0), pos: this.isAbsolute});
+ return this;
+ };
+ p.arcTo = function (rx, ry, large_arc_flag, sweep_flag, x2, y2) {
+ // for more information of where this math came from visit:
+ // http://www.w3.org/TR/SVG11/implnote.html#ArcImplementationNotes
+ x2 = (this.isAbsolute ? 0 : this.last.x) + x2;
+ y2 = (this.isAbsolute ? 0 : this.last.y) + y2;
+ var x1 = this.last.x,
+ y1 = this.last.y,
+ x = (x1 - x2) / 2,
+ y = (y1 - y2) / 2,
+ k = (large_arc_flag == sweep_flag ? -1 : 1) *
+ Math.sqrt((rx * rx * ry * ry - rx * rx * y * y - ry * ry * x * x) / (rx * rx * y * y + ry * ry * x * x)),
+ cx = k * rx * y / ry + (x1 + x2) / 2,
+ cy = k * -ry * x / rx + (y1 + y2) / 2,
+ d = sweep_flag ? (this.isAbsolute?"wa":"wr") : (this.isAbsolute?"at":"ar"),
+ _getX = this.isAbsolute ? VML._getX : VML._getW,
+ _getY = this.isAbsolute ? VML._getY : VML._getH,
+ left = Math.round(cx - rx),
+ top = Math.round(cy - ry);
+ d += [left, top, Math.round(left + rx * 2), Math.round(top + ry * 2), Math.round(x1), Math.round(y1), Math.round(_getX(parseFloat(x2, 10))), Math.round(_getX(parseFloat(y2, 10)))].join(", ");
+ this[0].path = this.Path += d;
+ this.last.x = (this.isAbsolute ? 0 : this.last.x) + _getX(parseFloat(x2, 10));
+ this.last.y = (this.isAbsolute ? 0 : this.last.y) + _getY(parseFloat(y2, 10));
+ this.last.isAbsolute = this.isAbsolute;
+ this.path.push({type: "arc", arg: [].slice.call(arguments, 0), pos: this.isAbsolute});
+ return this;
+ };
+ p.cplineTo = function (x1, y1, w1) {
+ if (!w1) {
+ return this.lineTo(x1, y1);
+ } else {
+ var p = {};
+ p._getX = this.isAbsolute ? VML._getX : VML._getW;
+ p._getY = this.isAbsolute ? VML._getY : VML._getH;
+ var x = Math.round(p._getX(Math.round(parseFloat(x1, 10) * 100) / 100));
+ var y = Math.round(p._getY(Math.round(parseFloat(y1, 10) * 100) / 100));
+ var w = Math.round(VML._getW(Math.round(parseFloat(w1, 10) * 100) / 100));
+ var d = this.isAbsolute?"c":"v";
+ var attr = [Math.round(this.last.x) + w, Math.round(this.last.y), x - w, y, x, y];
+ d += attr.join(" ") + " ";
+ this.last.x = (this.isAbsolute ? 0 : this.last.x) + attr[4];
+ this.last.y = (this.isAbsolute ? 0 : this.last.y) + attr[5];
+ this.last.bx = attr[2];
+ this.last.by = attr[3];
+ this[0].path = this.Path += d;
+ this.path.push({type: "cpline", arg: [].slice.call(arguments, 0), pos: this.isAbsolute});
+ return this;
+ }
+ };
+ p.curveTo = function () {
+ var d = this.isAbsolute?"c":"v";
+ var _getX = this.isAbsolute ? VML._getX : VML._getW;
+ var _getY = this.isAbsolute ? VML._getY : VML._getH;
+ if (arguments.length == 6) {
+ this.last.bx = (this.isAbsolute ? 0 : this.last.x) + _getX(parseFloat(arguments[2], 10));
+ this.last.by = (this.isAbsolute ? 0 : this.last.y) + _getY(parseFloat(arguments[3], 10));
+ this.last.x = (this.isAbsolute ? 0 : this.last.x) + _getX(parseFloat(arguments[4], 10));
+ this.last.y = (this.isAbsolute ? 0 : this.last.y) + _getY(parseFloat(arguments[5], 10));
+ d += Math.round(_getX(parseFloat(arguments[0], 10))) + " " +
+ Math.round(_getY(parseFloat(arguments[1], 10))) + " " +
+ Math.round(_getX(parseFloat(arguments[2], 10))) + " " +
+ Math.round(_getY(parseFloat(arguments[3], 10))) + " " +
+ Math.round(_getX(parseFloat(arguments[4], 10))) + " " +
+ Math.round(_getY(parseFloat(arguments[5], 10))) + " ";
+ this.last.isAbsolute = this.isAbsolute;
+ }
+ if (arguments.length == 4) {
+ var bx = this.last.x * 2 - this.last.bx;
+ var by = this.last.y * 2 - this.last.by;
+ this.last.bx = (this.isAbsolute ? 0 : this.last.x) + _getX(parseFloat(arguments[0], 10));
+ this.last.by = (this.isAbsolute ? 0 : this.last.y) + _getY(parseFloat(arguments[1], 10));
+ this.last.x = (this.isAbsolute ? 0 : this.last.x) + _getX(parseFloat(arguments[2], 10));
+ this.last.y = (this.isAbsolute ? 0 : this.last.y) + _getY(parseFloat(arguments[3], 10));
+ d += [Math.round(bx), Math.round(by),
+ Math.round(_getX(parseFloat(arguments[0], 10))),
+ Math.round(_getY(parseFloat(arguments[1], 10))),
+ Math.round(_getX(parseFloat(arguments[2], 10))),
+ Math.round(_getY(parseFloat(arguments[3], 10)))].join(" ");
+ }
+ this[0].path = this.Path += d;
+ this.path.push({type: "curve", arg: [].slice.call(arguments, 0), pos: this.isAbsolute});
+ return this;
+ };
+ p.addRoundedCorner = function (r, dir) {
+ var R = .5522 * r, rollback = this.isAbsolute, o = this;
+ if (rollback) {
+ this.relatively();
+ rollback = function () {
+ o.absolutely();
+ };
+ } else {
+ rollback = function () {};
+ }
+ var actions = {
+ l: function () {
+ return {
+ u: function () {
+ o.curveTo(-R, 0, -r, -(r - R), -r, -r);
+ },
+ d: function () {
+ o.curveTo(-R, 0, -r, r - R, -r, r);
+ }
+ };
+ },
+ r: function () {
+ return {
+ u: function () {
+ o.curveTo(R, 0, r, -(r - R), r, -r);
+ },
+ d: function () {
+ o.curveTo(R, 0, r, r - R, r, r);
+ }
+ };
+ },
+ u: function () {
+ return {
+ r: function () {
+ o.curveTo(0, -R, -(R - r), -r, r, -r);
+ },
+ l: function () {
+ o.curveTo(0, -R, R - r, -r, -r, -r);
+ }
+ };
+ },
+ d: function () {
+ return {
+ r: function () {
+ o.curveTo(0, R, -(R - r), r, r, r);
+ },
+ l: function () {
+ o.curveTo(0, R, R - r, r, -r, r);
+ }
+ };
+ }
+ };
+ actions[dir.charAt(0)]()[dir.charAt(1)]();
+ rollback();
+ return o;
+ };
+ p.andClose = function () {
+ this[0].path = (this.Path += "x e");
+ return this;
+ };
+ if (typeof pathString == "string") {
+ p.absolutely();
+ C.pathfinder(p, pathString);
+ }
+ return p;
+ };
+ var setFillAndStroke = function (o, params) {
+ var s = o[0].style;
+ o.attrs = o.attrs || {};
+ for (var par in params) {
+ o.attrs[par] = params[par];
+ }
+ params["font-family"] && (s.fontFamily = params["font-family"]);
+ params["font-size"] && (s.fontSize = params["font-size"]);
+ params["font"] && (s.font = params["font"]);
+ params["font-weight"] && (s.fontWeight = params["font-weight"]);
+ if (typeof params.opacity != "undefined" || typeof params["stroke-width"] != "undefined" || typeof params.fill != "undefined" || typeof params.stroke != "undefined") {
+ o = o.shape || o[0];
+ var fill = (o.getElementsByTagName("fill") && o.getElementsByTagName("fill")[0]) || document.createElement("rvml:fill");
+ if ("fill-opacity" in params || "opacity" in params) {
+ fill.opacity = ((params["fill-opacity"] + 1 || 2) - 1) * ((params.opacity + 1 || 2) - 1);
+ }
+ if (params.fill) {
+ fill.on = true;
+ }
+ if (fill.on == undefined || params.fill == "none") {
+ fill.on = false;
+ }
+ if (fill.on && params.fill) {
+ var isURL = params.fill.match(/^url\(([^\)]+)\)$/i);
+ if (isURL) {
+ fill.src = isURL[1];
+ fill.type = "tile";
+ } else {
+ fill.color = params.fill;
+ fill.src = "";
+ fill.type = "solid";
+ }
+ }
+ o.appendChild(fill);
+ var stroke = (o.getElementsByTagName("stroke") && o.getElementsByTagName("stroke")[0]) || document.createElement("rvml:stroke");
+ if ((params.stroke && params.stroke != "none") || params["stroke-width"] || params["stroke-opacity"] || params["stroke-dasharray"]) {
+ stroke.on = true;
+ }
+ if (params.stroke == "none" || typeof stroke.on == "undefined") {
+ stroke.on = false;
+ }
+ if (stroke.on && params.stroke) {
+ stroke.color = params.stroke;
+ }
+ stroke.opacity = ((params["stroke-opacity"] + 1 || 2) - 1) * ((params.opacity + 1 || 2) - 1);
+ params["stroke-linejoin"] && (stroke.joinstyle = params["stroke-linejoin"] || "miter");
+ stroke.miterlimit = params["stroke-miterlimit"] || 8;
+ params["stroke-linecap"] && (stroke.endcap = {butt: "flat", square: "square", round: "round"}[params["stroke-linecap"]] || "miter");
+ params["stroke-width"] && (stroke.weight = (parseFloat(params["stroke-width"], 10) || 1) * 12 / 16);
+ if (params["stroke-dasharray"]) {
+ var dasharray = {
+ "-": "shortdash",
+ ".": "shortdot",
+ "-.": "shortdashdot",
+ "-..": "shortdashdotdot",
+ ". ": "dot",
+ "- ": "dash",
+ "--": "longdash",
+ "- .": "dashdot",
+ "--.": "longdashdot",
+ "--..": "longdashdotdot"
+ };
+ stroke.dashstyle = dasharray[params["stroke-dasharray"]] || "";
+ }
+ o.appendChild(stroke);
+ }
+ };
+ var addGrdientFill = function (o, gradient) {
+ o.attrs = o.attrs || {};
+ o.attrs.gradient = gradient;
+ o = o.shape || o[0];
+ var fill = o.getElementsByTagName("fill");
+ if (fill.length) {
+ fill = fill[0];
+ } else {
+ fill = document.createElement("rvml:fill");
+ }
+ if (gradient.dots.length) {
+ fill.on = true;
+ fill.method = "none";
+ fill.type = (gradient.type.toLowerCase() == "linear") ? "gradient" : "gradientTitle";
+ if (typeof gradient.dots[0].color != "undefined") {
+ fill.color = gradient.dots[0].color || "#000";
+ }
+ if (typeof gradient.dots[gradient.dots.length - 1].color != "undefined") {
+ fill.color2 = gradient.dots[gradient.dots.length - 1].color || "#000";
+ }
+ var colors = [];
+ for (var i = 0, ii = gradient.dots.length; i < ii; i++) {
+ if (gradient.dots[i].offset) {
+ colors.push(gradient.dots[i].offset + " " + gradient.dots[i].color);
+ }
+ };
+ var fillOpacity = gradient.dots[0].opacity || 1;
+ var fillOpacity2 = gradient.dots[gradient.dots.length - 1].opacity || 1;
+ if (colors) {
+ fill.colors.value = colors.join(",");
+ fillOpacity2 += fillOpacity;
+ fillOpacity = fillOpacity2 - fillOpacity;
+ fillOpacity2 -= fillOpacity;
+ }
+ fill.setAttribute("opacity", fillOpacity);
+ fill.setAttribute("opacity2", fillOpacity2);
+ if (gradient.vector) {
+ var angle = Math.round(Math.atan((parseFloat(gradient.vector[3], 10) - parseFloat(gradient.vector[1], 10)) / (parseFloat(gradient.vector[2], 10) - parseFloat(gradient.vector[0], 10))) * 57.29) || 0;
+ fill.angle = 270 - angle;
+ }
+ if (gradient.type.toLowerCase() == "radial") {
+ fill.focus = "100%";
+ fill.focusposition = "0.5 0.5";
+ }
+ }
+ };
+ var Element = function (node, group, vml) {
+ var Rotation = 0,
+ RotX = 0,
+ RotY = 0,
+ Scale = 1;
+ this[0] = node;
+ this.node = node;
+ this.X = 0;
+ this.Y = 0;
+ this.attrs = {};
+ this.Group = group;
+ this.vml = vml;
+ this.rotate = function (deg) {
+ if (deg == undefined) {
+ return Rotation;
+ }
+ Rotation += deg;
+ this.Group.style.rotation = Rotation;
+ return this;
+ };
+ };
+ Element.prototype.setBox = function (params) {
+ var gs = this.Group.style,
+ os = this[0].style;
+ for (var i in params) {
+ this.attrs[i] = params[i];
+ }
+ var attr = this.attrs, x, y, w, h;
+ switch (this.type) {
+ case "circle":
+ x = attr.cx - attr.r;
+ y = attr.cy - attr.r;
+ w = h = attr.r * 2;
+ break;
+ case "ellipse":
+ x = attr.cx - attr.rx;
+ y = attr.cy - attr.ry;
+ w = attr.rx * 2;
+ h = attr.ry * 2;
+ break;
+ case "rect":
+ case "image":
+ x = attr.x;
+ y = attr.y;
+ w = attr.w;
+ h = attr.h;
+ break;
+ case "text":
+ this.textpath.v = ["m", Math.round(attr.x), ", ", Math.round(attr.y - 2), "l", Math.round(attr.x) + 1, ", ", Math.round(attr.y - 2)].join("");
+ return;
+ default:
+ return;
+ }
+ var left = this.vml.width / 2 - w / 2,
+ top = this.vml.height / 2 - h / 2;
+ gs.position = "absolute";
+ gs.left = x - left + "px";
+ gs.top = y - top + "px";
+ this.X = x - left;
+ this.Y = y - top;
+ this.W = w;
+ this.H = h;
+ gs.width = this.vml.width + "px";
+ gs.height = this.vml.height + "px";
+ os.position = "absolute";
+ os.top = top + "px";
+ os.left = left + "px";
+ os.width = w + "px";
+ os.height = h + "px";
+ };
+ Element.prototype.hide = function () {
+ this.Group.style.display = "none";
+ return this;
+ };
+ Element.prototype.show = function () {
+ this.Group.style.display = "block";
+ return this;
+ };
+ Element.prototype.translate = function (x, y) {
+ if (x == undefined && y == undefined) {
+ return {x: this.X, y: this.Y};
+ }
+ this.X += x;
+ this.Y += y;
+ this.Group.style.left = this.X + "px";
+ this.Group.style.top = this.Y + "px";
+ return this;
+ };
+ // depricated
+ Element.prototype.matrix = function (xx, xy, yx, yy, dx, dy) {
+ tMatrix = new Matrix(xx, xy, yx, yy, dx, dy);
+ this.Group.style.filter = tMatrix;
+ return this;
+ };
+ Element.prototype.scale = function (x, y) {
+ if (x == undefined && y == undefined) {
+ return ;
+ // TODO
+ }
+ y = y || x;
+ if (x != 0 && !(x == 1 && y == 1)) {
+ var dirx = Math.round(x / Math.abs(x)),
+ diry = Math.round(y / Math.abs(y)),
+ s = this[0].style;
+ if (dirx != 1 || diry != 1) {
+ s.filter = new Matrix(dirx, 0, 0, diry, 0, 0);
+ }
+ var width = parseInt(s.width, 10) * x * dirx;
+ var height = parseInt(s.height, 10) * y * diry;
+ var left = parseInt(s.left, 10);
+ var top = parseInt(s.top, 10);
+ s.left = this.X = left + this.W / 2 - width / 2;
+ s.top = this.Y = top + this.H / 2 - height / 2;
+ s.width = this.W = width;
+ s.height = this.H = height;
+ }
+ return this;
+ };
+ Element.prototype.getBBox = function () {
+ return {
+ x: this.Group.offsetLeft,
+ y: this.Group.offsetTop,
+ width: this.Group.offsetWidth,
+ height: this.Group.offsetHeight
+ };
+ };
+ Element.prototype.remove = function () {
+ this[0].parentNode.removeChild(this[0]);
+ this.Group.parentNode.removeChild(this.Group);
+ this.shape && this.shape.parentNode.removeChild(this.shape);
+ };
+ Element.prototype.attr = function () {
+ if (arguments.length == 1 && typeof arguments[0] == "string") {
+ return this.attrs[arguments[0]];
+ }
+ if (this.attrs && arguments.length == 1 && arguments[0] instanceof Array) {
+ var values = {};
+ for (var i = 0, ii = arguments[0].length; i < ii; i++) {
+ values[arguments[0][i]] = this.attrs[arguments[0][i]];
+ };
+ return values;
+ }
+ if (this[0].tagName.toLowerCase() == "group") {
+ var children = this[0].childNodes;
+ this.attrs = this.attrs || {};
+ if (arguments.length == 2) {
+ this.attrs[arguments[0]] = arguments[1];
+ } else if (arguments.length == 1 || typeof arguments[0] == "object") {
+ for (var j in arguments[0]) {
+ this.attrs[j] = arguments[0][j];
+ }
+ }
+ for (var i = 0, ii = children.length; i < ii; i++) {
+ this.attr.apply(new item(children[i], this[0], this.vml), arguments);
+ }
+ } else {
+ var params;
+ if (arguments.length == 2) {
+ params = {};
+ params[arguments[0]] = arguments[1];
+ }
+ if (arguments.length == 1 && typeof arguments[0] == "object") {
+ params = arguments[0];
+ }
+ if (params) {
+ setFillAndStroke(this, params);
+ this.setBox(params);
+ if (params.gradient) {
+ addGrdientFill(this, params.gradient);
+ }
+ if (params.text && this.type == "text") {
+ this[0].string = params.text;
+ }
+ if (params.id) {
+ this[0].id = params.id;
+ }
+ }
+ }
+ return this;
+ };
+ Element.prototype.toFront = function () {
+ this.Group.parentNode.appendChild(this.Group);
+ return this;
+ };
+ Element.prototype.toBack = function () {
+ if (this.Group.parentNode.firstChild != this.Group) {
+ this.Group.parentNode.insertBefore(this.Group, this.Group.parentNode.firstChild);
+ }
+ return this;
+ };
+ var theCircle = function (vml, x, y, r) {
+ var g = document.createElement("rvml:group");
+ var o = document.createElement("rvml:oval");
+ g.appendChild(o);
+ vml.canvas.appendChild(g);
+ var res = new Element(o, g, vml);
+ setFillAndStroke(res, {stroke: "#000", fill: "none"});
+ res.setBox({x: x - r, y: y - r, w: r * 2, h: r * 2});
+ res.attrs.cx = x;
+ res.attrs.cy = y;
+ res.attrs.r = r;
+ res.type = "circle";
+ return res;
+ };
+ var theRect = function (vml, x, y, w, h, r) {
+ var g = document.createElement("rvml:group");
+ var o = document.createElement(r ? "rvml:roundrect" : "rvml:rect");
+ if (r) {
+ o.arcsize = r / (Math.min(w, h));
+ }
+ g.appendChild(o);
+ vml.canvas.appendChild(g);
+ var res = new Element(o, g, vml);
+ setFillAndStroke(res, {stroke: "#000"});
+ res.setBox({x: x, y: y, w: w, h: h});
+ res.attrs.x = x;
+ res.attrs.y = y;
+ res.attrs.w = w;
+ res.attrs.h = h;
+ res.attrs.r = r;
+ res.type = "rect";
+ return res;
+ };
+ var theEllipse = function (vml, x, y, rx, ry) {
+ var g = document.createElement("rvml:group");
+ var o = document.createElement("rvml:oval");
+ g.appendChild(o);
+ vml.canvas.appendChild(g);
+ var res = new Element(o, g, vml);
+ setFillAndStroke(res, {stroke: "#000"});
+ res.setBox({x: x - rx, y: y - ry, w: rx * 2, h: ry * 2});
+ res.attrs.cx = x;
+ res.attrs.cy = y;
+ res.attrs.rx = rx;
+ res.attrs.ry = ry;
+ res.type = "ellipse";
+ return res;
+ };
+ var theImage = function (vml, src, x, y, w, h) {
+ var g = document.createElement("rvml:group");
+ var o = document.createElement("rvml:image");
+ o.src = src;
+ g.appendChild(o);
+ vml.canvas.appendChild(g);
+ var res = new Element(o, g, vml);
+ res.type = "image";
+ res.setBox({x: x, y: y, w: w, h: h});
+ res.attrs.x = x;
+ res.attrs.y = y;
+ res.attrs.w = w;
+ res.attrs.h = h;
+ return res;
+ };
+ var theText = function (vml, x, y, text) {
+ // @TODO: setTheBox
+ var g = document.createElement("rvml:group"), gs = g.style;
+ var el = document.createElement("rvml:shape"), ol = el.style;
+ var path = document.createElement("rvml:path"), ps = path.style;
+ path.v = ["m", Math.round(x), ", ", Math.round(y - 2), "l", Math.round(x) + 1, ", ", Math.round(y - 2)].join("");
+ path.textpathok = true;
+ ol.width = vml.width;
+ ol.height = vml.height;
+ gs.position = "absolute";
+ gs.left = 0;
+ gs.top = 0;
+ gs.width = vml.width;
+ gs.height = vml.height;
+ var o = document.createElement("rvml:textpath");
+ o.string = text;
+ o.on = true;
+ o.coordsize = vml.coordsize;
+ o.coordorigin = vml.coordorigin;
+ el.appendChild(o);
+ el.appendChild(path);
+ g.appendChild(el);
+ vml.canvas.appendChild(g);
+ var res = new Element(o, g, vml);
+ res.shape = el;
+ res.textpath = path;
+ res.type = "text";
+ res.attrs.x = x;
+ res.attrs.y = y;
+ res.attrs.w = 1;
+ res.attrs.h = 1;
+ return res;
+ };
+ var theGroup = function (vml) {
+ var el = document.createElement("rvml:group"), els = el.style;
+ els.position = "absolute";
+ els.left = 0;
+ els.top = 0;
+ els.width = vml.width;
+ els.height = vml.height;
+ if (vml.canvas) {
+ vml.canvas.appendChild(el);
+ }
+ var res = new Element(el, el, vml);
+ for (var f in vml) {
+ if (f.charAt(0) != "_" && typeof vml[f] == "function") {
+ res[f] = (function (f) {
+ return function () {
+ var e = vml[f].apply(vml, arguments);
+ el.appendChild(e[0].parentNode);
+ return e;
+ };
+ })(f);
+ }
+ }
+ res.type = "group";
+ return res;
+ };
+ r._create = function () {
+ // container, width, height
+ // x, y, width, height
+ var container, width, height;
+ if (typeof arguments[0] == "string") {
+ container = document.getElementById(arguments[0]);
+ width = arguments[1];
+ height = arguments[2];
+ }
+ if (typeof arguments[0] == "object") {
+ container = arguments[0];
+ width = arguments[1];
+ height = arguments[2];
+ }
+ if (typeof arguments[0] == "number") {
+ container = 1;
+ x = arguments[0];
+ y = arguments[1];
+ width = arguments[2];
+ height = arguments[3];
+ }
+ if (!container) {
+ throw new Error("VML container not found.");
+ }
+ if (!document.namespaces["rvml"]) {
+ document.namespaces.add("rvml","urn:schemas-microsoft-com:vml");
+ document.createStyleSheet().addRule("rvml\\:*", "behavior:url(#default#VML)");
+ }
+ var c = document.createElement("div"),
+ r = C.canvas = document.createElement("rvml:group"),
+ cs = c.style, rs = r.style;
+ C.width = width;
+ C.height = height;
+ width = width || "320px";
+ height = height || "200px";
+ cs.clip = "rect(0 " + width + " " + height + " 0)";
+ cs.position = "absolute";
+ rs.width = width;
+ rs.height = height;
+ r.coordsize = (width == "100%" ? width : parseFloat(width)) + " " + (height == "100%" ? height : parseFloat(height));
+ r.coordorigin = "0 0";
+
+ var b = document.createElement("rvml:rect"), bs = b.style;
+ bs.left = bs.top = 0;
+ bs.width = rs.width;
+ bs.height = rs.height;
+ b.filled = b.stroked = "f";
+
+ r.appendChild(b);
+ c.appendChild(r);
+ if (container == 1) {
+ document.body.appendChild(c);
+ cs.position = "absolute";
+ cs.left = x + "px";
+ cs.top = y + "px";
+ cs.width = width;
+ cs.height = height;
+ container = {
+ style: {
+ width: width,
+ height: height
+ }
+ };
+ } else {
+ cs.width = container.style.width = width;
+ cs.height = container.style.height = height;
+ if (container.firstChild) {
+ container.insertBefore(c, container.firstChild);
+ } else {
+ container.appendChild(c);
+ }
+ }
+ for (var prop in C) {
+ container[prop] = C[prop];
+ }
+ container.clear = function () {
+ var todel = [];
+ for (var i = 0, ii = r.childNodes.length; i < ii; i++) {
+ if (r.childNodes[i] != b) {
+ todel.push(r.childNodes[i]);
+ }
+ }
+ for (i = 0, ii = todel.length; i < ii; i++) {
+ r.removeChild(todel[i]);
+ }
+ };
+ return container;
+ };
+ C.remove = function () {
+ C.canvas.parentNode.parentNode.removeChild(C.canvas.parentNode);
+ };
+ }
+ if (type == "SVG") {
+ Matrix.prototype.toString = function () {
+ return "matrix(" + this.m[0][0] +
+ ", " + this.m[1][0] + ", " + this.m[0][1] + ", " + this.m[1][1] +
+ ", " + this.m[2][0] + ", " + this.m[2][1] + ")";
+ };
+ var thePath = function (params, pathString, SVG) {
+ var el = document.createElementNS(SVG.svgns, "path");
+ el.setAttribute("fill", "none");
+ if (SVG.canvas) {
+ SVG.canvas.appendChild(el);
+ }
+ var p = new Element(el, SVG);
+ if (params) {
+ setFillAndStroke(p, params);
+ }
+ p.isAbsolute = true;
+ p.path = [];
+ p.last = {x: 0, y: 0, bx: 0, by: 0};
+ p.absolutely = function () {
+ this.isAbsolute = true;
+ return this;
+ };
+ p.relatively = function () {
+ this.isAbsolute = false;
+ return this;
+ };
+ p.redraw = function () {
+ this[0].setAttribute("d", "M0 0");
+ var oldPath = this.path;
+ this.path = [];
+ for (var i = 0, ii = oldPath.length; i < ii; i++) {
+ if (oldPath[i].type != "end") {
+ this[oldPath[i].type + "To"].apply(this, oldPath[i].arg);
+ } else {
+ this.andClose();
+ }
+ }
+ return this;
+ };
+ p.moveTo = function (x, y) {
+ var d = this.isAbsolute?"M":"m";
+ var _getX = this.isAbsolute ? SVG._getX : SVG._getW;
+ var _getY = this.isAbsolute ? SVG._getY : SVG._getH;
+ d += _getX(parseFloat(x, 10)) + " " + _getY(parseFloat(y, 10)) + " ";
+ var oldD = this[0].getAttribute("d") || "";
+ this[0].setAttribute("d", oldD + d);
+ this.last.x = (this.isAbsolute ? 0 : this.last.x) + SVG._getX(parseFloat(x, 10));
+ this.last.y = (this.isAbsolute ? 0 : this.last.y) + SVG._getY(parseFloat(y, 10));
+ this.path.push({type: "move", arg: arguments, pos: this.isAbsolute});
+ return this;
+ };
+ p.lineTo = function (x, y) {
+ this.last.x = (this.isAbsolute ? 0 : this.last.x) + SVG._getX(parseFloat(x, 10));
+ this.last.y = (this.isAbsolute ? 0 : this.last.y) + SVG._getY(parseFloat(y, 10));
+ var d = this.isAbsolute?"L":"l";
+ var _getX = this.isAbsolute ? SVG._getX : SVG._getW;
+ var _getY = this.isAbsolute ? SVG._getY : SVG._getH;
+ d += _getX(parseFloat(x, 10)) + " " + _getY(parseFloat(y, 10)) + " ";
+ var oldD = this[0].getAttribute("d") || "";
+ this[0].setAttribute("d", oldD + d);
+ this.path.push({type: "line", arg: arguments, pos: this.isAbsolute});
+ return this;
+ };
+ p.arcTo = function (rx, ry, large_arc_flag, sweep_flag, x, y) {
+ var d = this.isAbsolute ? "A" : "a";
+ var _getX = this.isAbsolute ? SVG._getX : SVG._getW;
+ var _getY = this.isAbsolute ? SVG._getY : SVG._getH;
+ d += [SVG._getW(parseFloat(rx, 10)), SVG._getH(parseFloat(ry, 10)), 0, large_arc_flag, sweep_flag, _getX(parseFloat(x, 10)), _getY(parseFloat(y, 10))].join(" ");
+ var oldD = this[0].getAttribute("d") || "";
+ this[0].setAttribute("d", oldD + d);
+ this.last.x = SVG._getX(parseFloat(x, 10));
+ this.last.y = SVG._getY(parseFloat(y, 10));
+ this.path.push({type: "arc", arg: arguments, pos: this.isAbsolute});
+ return this;
+ };
+ p.cplineTo = function (x1, y1, w1) {
+ if (!w1) {
+ return this.lineTo(x1, y1);
+ } else {
+ var p = {};
+ p._getX = this.isAbsolute ? SVG._getX : SVG._getW;
+ p._getY = this.isAbsolute ? SVG._getY : SVG._getH;
+ var x = p._getX(Math.round(parseFloat(x1, 10) * 100) / 100);
+ var y = p._getY(Math.round(parseFloat(y1, 10) * 100) / 100);
+ var w = SVG._getW(Math.round(parseFloat(w1, 10) * 100) / 100);
+ var d = this.isAbsolute?"C":"c";
+ var attr = [this.last.x + w, this.last.y, x - w, y, x, y];
+ for (var i = 0, ii = attr.length; i < ii; i++) {
+ d += attr[i] + " ";
+ }
+ this.last.x = (this.isAbsolute ? 0 : this.last.x) + attr[4];
+ this.last.y = (this.isAbsolute ? 0 : this.last.y) + attr[5];
+ this.last.bx = attr[2];
+ this.last.by = attr[3];
+ var oldD = this[0].getAttribute("d") || "";
+ this[0].setAttribute("d", oldD + d);
+ this.path.push({type: "cpline", arg: arguments, pos: this.isAbsolute});
+ return this;
+ }
+ };
+ p.curveTo = function () {
+ var p = {};
+ p._getX = this.isAbsolute ? SVG._getX : SVG._getW;
+ p._getY = this.isAbsolute ? SVG._getY : SVG._getH;
+ if (arguments.length == 6) {
+ var d = this.isAbsolute?"C":"c";
+ for (var i = 0, ii = arguments.length; i < ii; i++) {
+ d += p[(i % 2 == 0) ? "_getX" : "_getY"](Math.round(parseFloat(arguments[i], 10) * 100) / 100) + " ";
+ }
+ this.last.x = (this.isAbsolute ? 0 : this.last.x) + p._getX((parseFloat(arguments[4], 10) * 100) / 100);
+ this.last.y = (this.isAbsolute ? 0 : this.last.y) + p._getY((parseFloat(arguments[5], 10) * 100) / 100);
+ this.last.bx = p._getX((parseFloat(arguments[2], 10) * 100) / 100);
+ this.last.by = p._getY((parseFloat(arguments[3], 10) * 100) / 100);
+ } else {
+ if (arguments.length == 4) {
+ var d = this.isAbsolute?"S":"s";
+ for (var i = 0, ii = arguments.length; i < ii; i++) {
+ d += p[i % 2 == 0 ? "_getX" : "_getY"]((parseFloat(arguments[i], 10) * 100) / 100) + " ";
+ }
+ }
+ this.last.x = (this.isAbsolute ? 0 : this.last.x) + p._getX((parseFloat(arguments[2], 10) * 100) / 100);
+ this.last.y = (this.isAbsolute ? 0 : this.last.y) + p._getY((parseFloat(arguments[3], 10) * 100) / 100);
+ this.last.bx = p._getX((parseFloat(arguments[0], 10) * 100) / 100);
+ this.last.by = p._getY((parseFloat(arguments[1], 10) * 100) / 100);
+ }
+ var oldD = this[0].getAttribute("d") || "";
+ this[0].setAttribute("d", oldD + d);
+ this.path.push({type: "curve", arg: arguments, pos: this.isAbsolute});
+ return this;
+ };
+ p.addRoundedCorner = function (r, dir) {
+ var R = .5522 * r, rollback = this.isAbsolute, o = this;
+ if (rollback) {
+ this.relatively();
+ rollback = function () {
+ o.absolutely();
+ };
+ } else {
+ rollback = function () {};
+ }
+ var actions = {
+ l: function () {
+ return {
+ u: function () {
+ o.curveTo(-R, 0, -r, -(r - R), -r, -r);
+ },
+ d: function () {
+ o.curveTo(-R, 0, -r, r - R, -r, r);
+ }
+ };
+ },
+ r: function () {
+ return {
+ u: function () {
+ o.curveTo(R, 0, r, -(r - R), r, -r);
+ },
+ d: function () {
+ o.curveTo(R, 0, r, r - R, r, r);
+ }
+ };
+ },
+ u: function () {
+ return {
+ r: function () {
+ o.curveTo(0, -R, -(R - r), -r, r, -r);
+ },
+ l: function () {
+ o.curveTo(0, -R, R - r, -r, -r, -r);
+ }
+ };
+ },
+ d: function () {
+ return {
+ r: function () {
+ o.curveTo(0, R, -(R - r), r, r, r);
+ },
+ l: function () {
+ o.curveTo(0, R, R - r, r, -r, r);
+ }
+ };
+ }
+ };
+ actions[dir[0]]()[dir[1]]();
+ rollback();
+ return o;
+ };
+ p.andClose = function () {
+ var oldD = this[0].getAttribute("d") || "";
+ this[0].setAttribute("d", oldD + "Z ");
+ this.path.push({type: "end"});
+ return this;
+ };
+ if (typeof pathString == "string") {
+ p.absolutely();
+ C.pathfinder(p, pathString);
+ }
+ return p;
+ };
+ var addGrdientFill = function (o, gradient, SVG) {
+ var el = document.createElementNS(SVG.svgns, gradient.type + "Gradient");
+ el.id = "raphael-gradient-" + SVG.gradients++;
+ if (gradient.vector && gradient.vector.length) {
+ el.setAttribute("x1", gradient.vector[0]);
+ el.setAttribute("y1", gradient.vector[1]);
+ el.setAttribute("x2", gradient.vector[2]);
+ el.setAttribute("y2", gradient.vector[3]);
+ }
+ SVG.defs.appendChild(el);
+ for (var i = 0, ii = gradient.dots.length; i < ii; i++) {
+ var stop = document.createElementNS(SVG.svgns, "stop");
+ stop.setAttribute("offset", gradient.dots[i].offset ? gradient.dots[i].offset : (i == 0) ? "0%" : "100%");
+ stop.setAttribute("stop-color", gradient.dots[i].color || "#fff");
+ if (typeof gradient.dots[i].opacity != "undefined") {
+ stop.setAttribute("stop-opacity", gradient.dots[i].opacity);
+ }
+ el.appendChild(stop);
+ };
+ o.setAttribute("fill", "url(#" + el.id + ")");
+ };
+ var updatePosition = function (o) {
+ if (o.pattern) {
+ var bbox = o.node.getBBox();
+ o.pattern.setAttribute("patternTransform", "translate(" + [bbox.x, bbox.y].join(",") + ")");
+ }
+ };
+ var setFillAndStroke = function (o, params) {
+ var dasharray = {
+ "-": [3, 1],
+ ".": [1, 1],
+ "-.": [3, 1, 1, 1],
+ "-..": [3, 1, 1, 1, 1, 1],
+ ". ": [1, 3],
+ "- ": [4, 3],
+ "--": [8, 3],
+ "- .": [4, 3, 1, 3],
+ "--.": [8, 3, 1, 3],
+ "--..": [8, 3, 1, 3, 1, 3]
+ };
+ for (var att in params) {
+ var value = params[att];
+ o.attrs[att] = value;
+ switch (att) {
+ case "rx":
+ case "cx":
+ case "x":
+ o[0].setAttribute(att, o.svg._getX(value));
+ updatePosition(o);
+ break;
+ case "ry":
+ case "cy":
+ case "y":
+ o[0].setAttribute(att, o.svg._getY(value));
+ updatePosition(o);
+ break;
+ case "width":
+ o[0].setAttribute(att, o.svg._getW(value));
+ break;
+ case "height":
+ o[0].setAttribute(att, o.svg._getH(value));
+ break;
+ case "gradient":
+ addGrdientFill(o[0], value, o.svg);
+ break;
+ case "stroke-dasharray":
+ value = dasharray[value.toLowerCase()];
+ if (value) {
+ var width = params["stroke-width"] || o.attr("stroke-width") || "1",
+ butt = {round: width, square: width, butt: 0}[o.attr("stroke-linecap")] || 0,
+ dashes = [];
+ for (var i = 0, ii = value.length; i < ii; i++) {
+ dashes.push(value[i] * width + ((i % 2) ? 1 : -1) * butt);
+ }
+ value = dashes.join(",");
+ o[0].setAttribute(att, value);
+ }
+ break;
+ case "text":
+ if (o.type == "text") {
+ o[0].childNodes.length && o[0].removeChild(o[0].firstChild);
+ o[0].appendChild(document.createTextNode(value));
+ }
+ break;
+ case "fill":
+ var isURL = value.match(/^url\(([^\)]+)\)$/i);
+ if (isURL) {
+ var el = document.createElementNS(o.svg.svgns, "pattern");
+ var ig = document.createElementNS(o.svg.svgns, "image");
+ el.id = "raphael-pattern-" + o.svg.gradients++;
+ el.setAttribute("x", 0);
+ el.setAttribute("y", 0);
+ el.setAttribute("patternUnits", "userSpaceOnUse");
+ ig.setAttribute("x", 0);
+ ig.setAttribute("y", 0);
+ ig.setAttributeNS(o.svg.xlink, "href", isURL[1]);
+ el.appendChild(ig);
+
+ var img = document.createElement("img");
+ img.style.position = "absolute";
+ img.style.top = "-9999em";
+ img.style.left = "-9999em";
+ img.onload = function () {
+ el.setAttribute("width", this.offsetWidth);
+ el.setAttribute("height", this.offsetHeight);
+ ig.setAttribute("width", this.offsetWidth);
+ ig.setAttribute("height", this.offsetHeight);
+ document.body.removeChild(this);
+ C.safari();
+ };
+ document.body.appendChild(img);
+ img.src = isURL[1];
+ o.svg.defs.appendChild(el);
+ o[0].style.fill = "url(#" + el.id + ")";
+ o[0].setAttribute("fill", "url(#" + el.id + ")");
+ o.pattern = el;
+ updatePosition(o);
+ break;
+ }
+ default :
+ var cssrule = att.replace(/(\-.)/g, function (w) {
+ return w.substring(1).toUpperCase();
+ });
+ o[0].style[cssrule] = value;
+ // Need following line for Firefox
+ o[0].setAttribute(att, value);
+ break;
+ }
+ }
+ };
+ var Element = function (node, svg) {
+ var X = 0,
+ Y = 0,
+ Rotation = {deg: 0, x: 0, y: 0},
+ ScaleX = 1,
+ ScaleY = 1,
+ tMatrix = null;
+ this[0] = node;
+ this.node = node;
+ this.svg = svg;
+ this.attrs = this.attrs || {};
+ this.transformations = []; // rotate, translate, scale, matrix
+ this.rotate = function (deg) {
+ if (deg == undefined) {
+ return Rotation.deg;
+ }
+ var bbox = this.getBBox();
+ Rotation.deg += deg;
+ if (Rotation.deg) {
+ this.transformations[0] = ("rotate(" + Rotation.deg + " " + (bbox.x + bbox.width / 2) + " " + (bbox.y + bbox.height / 2) + ")");
+ } else {
+ this.transformations[0] = "";
+ }
+ this[0].setAttribute("transform", this.transformations.join(" "));
+ return this;
+ };
+ this.translate = function (x, y) {
+ if (x == undefined && y == undefined) {
+ return {x: X, y: Y};
+ }
+ X += x;
+ Y += y;
+ if (X || Y) {
+ this.transformations[1] = "translate(" + X + "," + Y + ")";
+ } else {
+ this.transformations[1] = "";
+ }
+ this[0].setAttribute("transform", this.transformations.join(" "));
+ return this;
+ };
+ this.scale = function (x, y) {
+ if (x == undefined && y == undefined) {
+ return {x: ScaleX, y: ScaleY};
+ }
+ y = y || x;
+ if (x != 0 && !(x == 1 && y == 1)) {
+ ScaleX *= x;
+ ScaleY *= y;
+ if (!(ScaleX == 1 && ScaleY == 1)) {
+ var bbox = this.getBBox(),
+ dx = bbox.x * (1 - ScaleX) + (bbox.width / 2 - bbox.width * ScaleX / 2),
+ dy = bbox.y * (1 - ScaleY) + (bbox.height / 2 - bbox.height * ScaleY / 2);
+ this.transformations[2] = new Matrix(ScaleX, 0, 0, ScaleY, dx, dy);
+ } else {
+ this.transformations[2] = "";
+ }
+ this[0].setAttribute("transform", this.transformations.join(" "));
+ }
+ return this;
+ };
+ };
+ Element.prototype.hide = function () {
+ this[0].style.display = "none";
+ return this;
+ };
+ Element.prototype.show = function () {
+ this[0].style.display = "block";
+ return this;
+ };
+ // depricated
+ Element.prototype.matrix = function (xx, xy, yx, yy, dx, dy) {
+ this.transformations[3] = new Matrix(xx, xy, yx, yy, dx, dy);
+ this[0].setAttribute("transform", this.transformations.join(" "));
+ return this;
+ };
+ Element.prototype.remove = function () {
+ this[0].parentNode.removeChild(this[0]);
+ };
+ Element.prototype.getBBox = function () {
+ return this[0].getBBox();
+ };
+ Element.prototype.attr = function () {
+ if (arguments.length == 1 && typeof arguments[0] == "string") {
+ return this[0].getAttribute(arguments[0]);
+ }
+ if (arguments.length == 1 && arguments[0] instanceof Array) {
+ var values = {};
+ for (var j in arguments[0]) {
+ values[arguments[0][j]] = this.attrs[arguments[0][j]];
+ }
+ return values;
+ }
+ if (arguments.length == 2) {
+ var params = {};
+ params[arguments[0]] = arguments[1];
+ setFillAndStroke(this, params);
+ } else if (arguments.length == 1 && typeof arguments[0] == "object") {
+ setFillAndStroke(this, arguments[0]);
+ }
+ return this;
+ };
+ Element.prototype.toFront = function () {
+ this[0].parentNode.appendChild(this[0]);
+ return this;
+ };
+ Element.prototype.toBack = function () {
+ if (this[0].parentNode.firstChild != this[0]) {
+ this[0].parentNode.insertBefore(this[0], this[0].parentNode.firstChild);
+ }
+ return this;
+ };
+ var theCircle = function (svg, x, y, r) {
+ var el = document.createElementNS(svg.svgns, "circle");
+ el.setAttribute("cx", svg._getX(x));
+ el.setAttribute("cy", svg._getY(y));
+ el.setAttribute("r", r);
+ el.setAttribute("fill", "none");
+ el.setAttribute("stroke", "#000");
+ if (svg.canvas) {
+ svg.canvas.appendChild(el);
+ }
+ var res = new Element(el, svg);
+ res.attrs = res.attrs || {};
+ res.attrs.cx = x;
+ res.attrs.cy = y;
+ res.attrs.r = r;
+ res.attrs.stroke = "#000";
+ res.type = "circle";
+ return res;
+ };
+ var theRect = function (svg, x, y, w, h, r) {
+ var el = document.createElementNS(svg.svgns, "rect");
+ el.setAttribute("x", svg._getX(x));
+ el.setAttribute("y", svg._getY(y));
+ el.setAttribute("width", svg._getW(w));
+ el.setAttribute("height", svg._getH(h));
+ if (r) {
+ el.setAttribute("rx", r);
+ el.setAttribute("ry", r);
+ }
+ el.setAttribute("fill", "none");
+ el.setAttribute("stroke", "#000");
+ if (svg.canvas) {
+ svg.canvas.appendChild(el);
+ }
+ var res = new Element(el, svg);
+ res.attrs = res.attrs || {};
+ res.attrs.x = x;
+ res.attrs.y = y;
+ res.attrs.width = w;
+ res.attrs.height = h;
+ res.attrs.stroke = "#000";
+ if (r) {
+ res.attrs.rx = res.attrs.ry = r;
+ }
+ res.type = "rect";
+ return res;
+ };
+ var theEllipse = function (svg, x, y, rx, ry) {
+ var el = document.createElementNS(svg.svgns, "ellipse");
+ el.setAttribute("cx", svg._getX(x));
+ el.setAttribute("cy", svg._getY(y));
+ el.setAttribute("rx", svg._getW(rx));
+ el.setAttribute("ry", svg._getH(ry));
+ el.setAttribute("fill", "none");
+ el.setAttribute("stroke", "#000");
+ if (svg.canvas) {
+ svg.canvas.appendChild(el);
+ }
+ var res = new Element(el, svg);
+ res.attrs = res.attrs || {};
+ res.attrs.cx = x;
+ res.attrs.cy = y;
+ res.attrs.rx = rx;
+ res.attrs.ry = ry;
+ res.attrs.stroke = "#000";
+ res.type = "ellipse";
+ return res;
+ };
+ var theImage = function (svg, src, x, y, w, h) {
+ var el = document.createElementNS(svg.svgns, "image");
+ el.setAttribute("x", svg._getX(x));
+ el.setAttribute("y", svg._getY(y));
+ el.setAttribute("width", svg._getW(w));
+ el.setAttribute("height", svg._getH(h));
+ el.setAttributeNS(svg.xlink, "href", src);
+ if (svg.canvas) {
+ svg.canvas.appendChild(el);
+ }
+ var res = new Element(el, svg);
+ res.attrs = res.attrs || {};
+ res.attrs.x = x;
+ res.attrs.y = y;
+ res.attrs.width = w;
+ res.attrs.height = h;
+ res.type = "image";
+ return res;
+ };
+ var theText = function (svg, x, y, text) {
+ var el = document.createElementNS(svg.svgns, "text");
+ el.setAttribute("x", x);
+ el.setAttribute("y", y);
+ el.setAttribute("text-anchor", "middle");
+ el.setAttribute("fill", "#000");
+ if (text) {
+ el.appendChild(document.createTextNode(text));
+ }
+ if (svg.canvas) {
+ svg.canvas.appendChild(el);
+ }
+ var res = new Element(el, svg);
+ res.attrs = res.attrs || {};
+ res.attrs.x = x;
+ res.attrs.y = y;
+ res.attrs.fill = "#000";
+ res.type = "text";
+ return res;
+ };
+ var theGroup = function (svg) {
+ var el = document.createElementNS(svg.svgns, "g");
+ if (svg.canvas) {
+ svg.canvas.appendChild(el);
+ }
+ var i = new Element(el, svg);
+ for (var f in svg) {
+ if (f[0] != "_" && typeof svg[f] == "function") {
+ i[f] = (function (f) {
+ return function () {
+ var e = svg[f].apply(svg, arguments);
+ el.appendChild(e[0]);
+ return e;
+ };
+ })(f);
+ }
+ }
+ i.type = "group";
+ return i;
+ };
+ r._create = function () {
+ // container, width, height
+ // x, y, width, height
+ if (typeof arguments[0] == "string") {
+ var container = document.getElementById(arguments[0]);
+ var width = arguments[1];
+ var height = arguments[2];
+ }
+ if (typeof arguments[0] == "object") {
+ var container = arguments[0];
+ var width = arguments[1];
+ var height = arguments[2];
+ }
+ if (typeof arguments[0] == "number") {
+ var container = 1,
+ x = arguments[0],
+ y = arguments[1],
+ width = arguments[2],
+ height = arguments[3];
+ }
+ if (!container) {
+ throw new Error("SVG container not found.");
+ }
+ C.canvas = document.createElementNS(C.svgns, "svg");
+ C.canvas.setAttribute("width", width || 320);
+ C.width = width || 320;
+ C.canvas.setAttribute("height", height || 200);
+ C.height = height || 200;
+ if (container == 1) {
+ document.body.appendChild(C.canvas);
+ C.canvas.style.position = "absolute";
+ C.canvas.style.left = x + "px";
+ C.canvas.style.top = y + "px";
+ } else {
+ if (container.firstChild) {
+ container.insertBefore(C.canvas, container.firstChild);
+ } else {
+ container.appendChild(C.canvas);
+ }
+ }
+ container = {
+ canvas: C.canvas,
+ clear: function () {
+ while (this.canvas.firstChild) {
+ this.canvas.removeChild(this.canvas.firstChild);
+ }
+ this.defs = document.createElementNS(C.svgns, "defs");
+ this.gradients = 0;
+ this.canvas.appendChild(this.defs);
+ }
+ };
+ for (var prop in C) {
+ if (prop != "create") {
+ container[prop] = C[prop];
+ }
+ }
+ container.clear();
+ return container;
+ };
+ C.remove = function () {
+ C.canvas.parentNode.removeChild(C.canvas);
+ };
+ C.svgns = "http://www.w3.org/2000/svg";
+ C.xlink = "http://www.w3.org/1999/xlink";
+ }
+ if (type == "VML" || type == "SVG") {
+ C.circle = function (x, y, r) {
+ return theCircle(this, x, y, r);
+ };
+ C.rect = function (x, y, w, h, r) {
+ return theRect(this, x, y, w, h, r);
+ };
+ C.ellipse = function (x, y, rx, ry) {
+ return theEllipse(this, x, y, rx, ry);
+ };
+ C.path = function (params, pathString) {
+ return thePath(params, pathString, this);
+ };
+ C.image = function (src, x, y, w, h) {
+ return theImage(this, src, x, y, w, h);
+ };
+ C.text = function (x, y, text) {
+ return theText(this, x, y, text);
+ };
+ C.group = function () {
+ return theGroup(this);
+ };
+ C.linerect = function (x, y, w, h, r) {
+ if (r && parseInt(r, 10)) {
+ return this.path({stroke: "#000"}).moveTo(x + r, y).lineTo(x + w - r, y).addRoundedCorner(r, "rd").lineTo(x + w, y + h - r).addRoundedCorner(r, "dl").lineTo(x + r, y + h).addRoundedCorner(r, "lu").lineTo(x, y + r).addRoundedCorner(r, "ur").andClose();
+ }
+ return this.path({stroke: "#000"}).moveTo(x, y).lineTo(x + w, y).lineTo(x + w, y + h).lineTo(x, y + h).andClose();
+ };
+ C.drawGrid = function (x, y, w, h, wv, hv, color) {
+ color = color || "#000";
+ var p = this.path({stroke: color, "stroke-width": 1})
+ .moveTo(x, y).lineTo(x + w, y).lineTo(x + w, y + h).lineTo(x, y + h).lineTo(x, y),
+ rowHeight = h / hv,
+ columnWidth = w / wv;
+ for (var i = 1; i < hv; i++) {
+ p.moveTo(x, y + i * rowHeight).lineTo(x + w, y + i * rowHeight);
+ }
+ for (var i = 1; i < wv; i++) {
+ p.moveTo(x + i * columnWidth, y).lineTo(x + i * columnWidth, y + h);
+ }
+ return p;
+ };
+ C.setGrid = function (xmin, ymin, xmax, ymax, w, h) {
+ var xc = (xmax - xmin) / w;
+ var yc = (ymax - ymin) / h;
+ this._getX = function (x) {
+ return xmin + x * xc;
+ };
+ this._getY = function (y) {
+ return ymin + y * yc;
+ };
+ this._getW = function (w) {
+ return w * xc;
+ };
+ this._getH = function (h) {
+ return h * yc;
+ };
+ };
+ C.clearGrid = function () {
+ this._getX = this._getY = this._getW = this._getH = function (x) { return x; };
+ };
+ C.safari = function () {
+ if (r.type == "SVG") {
+ var rect = C.rect(-C.width, -C.height, C.width * 3, C.height * 3).attr({stroke: "none"});
+ setTimeout(function () {rect.remove();}, 0);
+ }
+ };
+ Element.prototype.animateTo = function (x, y, ms, callback) {
+ clearTimeout(this.animation_in_progress);
+ if ("cx" in this.attrs || "x" in this.attrs) {
+ var is_round = ("cx" in this.attrs),
+ X = this.attrs.cx || this.attrs.x,
+ Y = this.attrs.cy || this.attrs.y;
+ if (x == X && y == Y) {
+ return this;
+ }
+ var dy = y - Y,
+ dx = x - X,
+ coeff = dy / dx,
+ plus = Y - coeff * X,
+ alpha = Math.atan(this.coeff);
+ this.xs = this.step * Math.cos(alpha);
+ if (x < X) {
+ this.xs = -this.xs;
+ }
+ var start = new Date(),
+ that = this;
+ (function () {
+ var time = (new Date()).getTime() - start.getTime();
+ if (time < ms) {
+ var x1 = X + time * dx / ms;
+ var y1 = x1 * coeff + plus;
+ that.attr(is_round ? {cx: x1, cy: y1} : {x: x1, y: y1});
+ that.animation_in_progress = setTimeout(arguments.callee, 1);
+ C.safari();
+ } else {
+ that.attr(is_round ? {cx: x, cy: y} : {x: x, y: y});
+ C.safari();
+ callback && callback.call(that);
+ }
+ })();
+ }
+ return this;
+ };
+ C.pathfinder = function (p, path) {
+ var commands = {
+ M: function (x, y) {
+ this.moveTo(x, y);
+ },
+ m: function (x, y) {
+ this.moveTo(this.last.x + x, this.last.y + y);
+ },
+ C: function (x1, y1, x2, y2, x3, y3) {
+ this.curveTo(x1, y1, x2, y2, x3, y3);
+ },
+ c: function (x1, y1, x2, y2, x3, y3) {
+ this.curveTo(this.last.x + x1, this.last.y + y1, this.last.x + x2, this.last.y + y2, this.last.x + x3, this.last.y + y3);
+ },
+ S: function (x1, y1, x2, y2) {
+ p.curveTo(x1, y1, x2, y2);
+ },
+ s: function (x1, y1, x2, y2) {
+ this.curveTo(this.last.x + x1, this.last.y + y1, this.last.x + x2, this.last.y + y2);
+ },
+ L: function (x, y) {
+ p.lineTo(x, y);
+ },
+ l: function (x, y) {
+ this.lineTo(this.last.x + x, this.last.y + y);
+ },
+ H: function (x) {
+ this.lineTo(x, this.last.y);
+ },
+ h: function (x) {
+ this.lineTo(this.last.x + x, this.last.y);
+ },
+ V: function (y) {
+ this.lineTo(this.last.x, y);
+ },
+ v: function (y) {
+ this.lineTo(this.last.x, this.last.y + y);
+ },
+ A: function (rx, ry, xaxisrotation, largearcflag, sweepflag, x, y) {
+ this.arcTo(rx, ry, largearcflag, sweepflag, x, y);
+ },
+ a: function (rx, ry, xaxisrotation, largearcflag, sweepflag, x, y) {
+ this.arcTo(this.last.x + rx, this.last.y + ry, largearcflag, sweethisflag, this.last.x + x, this.last.y + y);
+ },
+ z: function () {
+ this.andClose();
+ }
+ };
+ path.replace(/([mzlhvcsqta])\s*((-?\d*\.?\d*\s*,?\s*)+)/ig, function (a, b, c) {
+ var params = [];
+ c.replace(/(-?\d*\.?\d*)\s*,?\s*/ig, function (a, b) {
+ b && params.push(+b);
+ });
+ while (params.length >= commands[b].length) {
+ commands[b].apply(p, params.splice(0, commands[b].length));
+ if (!commands[b].length) {
+ break;
+ };
+ }
+ });
+ };
+ return r;
+ } else {
+ return function () {};
+ }
+ })((!(window.SVGPreserveAspectRatio && window.SVGPreserveAspectRatio.SVG_PRESERVEASPECTRATIO_XMINYMIN == 2)) ? "VML" : "SVG");
+
+
+Raphael.vml = !(Raphael.svg = (Raphael.type == "SVG"));
+if (Raphael.vml && window.CanvasRenderingContext2D) {
+ Raphael.type = "Canvas only";
+ Raphael.vml = Raphael.svg = false;
+}
+Raphael.toString = function () {
+ return "Your browser supports " + this.type + ".\nYou are running " + unescape("Rapha%EBl%20") + this.version;
+};
+// generic utilities
+Raphael.hsb2rgb = function (hue, saturation, brightness) {
+ if (typeof hue == "object" && "h" in hue && "s" in hue && "b" in hue) {
+ brightness = hue.b;
+ saturation = hue.s;
+ hue = hue.h;
+ }
+ var red,
+ green,
+ blue;
+ if (brightness == 0) {
+ return {r: 0, g: 0, b: 0, hex: "#000"};
+ } else {
+ var i = Math.floor(hue * 6),
+ f = (hue * 6) - i,
+ p = brightness * (1 - saturation),
+ q = brightness * (1 - (saturation * f)),
+ t = brightness * (1 - (saturation * (1 - f)));
+ [
+ function () {red = brightness; green = t; blue = p;},
+ function () {red = q; green = brightness; blue = p;},
+ function () {red = p; green = brightness; blue = t;},
+ function () {red = p; green = q; blue = brightness;},
+ function () {red = t; green = p; blue = brightness;},
+ function () {red = brightness; green = p; blue = q;},
+ function () {red = brightness; green = t; blue = p;}
+ ][i]();
+ }
+ var rgb = {r: red, g: green, b: blue};
+ red *= 255;
+ green *= 255;
+ blue *= 255;
+ var r = Math.round(red).toString(16);
+ if (r.length == 1) {
+ r = "0" + r;
+ }
+ var g = Math.round(green).toString(16);
+ if (g.length == 1) {
+ g = "0" + g;
+ }
+ var b = Math.round(blue).toString(16);
+ if (b.length == 1) {
+ b = "0" + b;
+ }
+ rgb.hex = "#" + r + g + b;
+ return rgb;
+};
+Raphael.rgb2hsb = function (red, green, blue) {
+ if (typeof red == "object" && "r" in red && "g" in red && "b" in red) {
+ blue = red.b;
+ green = red.g;
+ red = red.r;
+ }
+ if (typeof red == "string" && red.charAt(0) == "#") {
+ if (red.length == 4) {
+ blue = parseInt(red.substring(3), 16);
+ green = parseInt(red.substring(2, 3), 16);
+ red = parseInt(red.substring(1, 2), 16);
+ } else {
+ blue = parseInt(red.substring(5), 16);
+ green = parseInt(red.substring(3, 5), 16);
+ red = parseInt(red.substring(1, 3), 16);
+ }
+ }
+ if (red > 1 || green > 1 || blue > 1) {
+ red /= 255;
+ green /= 255;
+ blue /= 255;
+ }
+ var max = Math.max(red, green, blue),
+ min = Math.min(red, green, blue),
+ hue,
+ saturation,
+ brightness = max;
+ if (min == max) {
+ return {h: 0, s: 0, b: max};
+ } else {
+ var delta = (max - min);
+ saturation = delta / max;
+ if (red == max) {
+ hue = (green - blue) / delta;
+ } else if (green == max) {
+ hue = 2 + ((blue - red) / delta);
+ } else {
+ hue = 4 + ((red - green) / delta);
+ }
+ hue /= 6;
+ if (hue < 0) {
+ hue += 1;
+ }
+ if (hue > 1) {
+ hue -= 1;
+ }
+ }
+ return {h: hue, s: saturation, b: brightness};
+};
+Raphael.getColor = function (value) {
+ var start = arguments.callee.start = arguments.callee.start || {h: 0, s: 1, b: value || .75};
+ var rgb = this.hsb2rgb(start.h, start.s, start.b);
+ start.h += .075;
+ if (start.h > 1) {
+ start.h = 0;
+ start.s -= .2;
+ if (start.s <= 0) {
+ arguments.callee.start = {h: 0, s: 1, b: start.b};
+ }
+ }
+ return rgb.hex;
+};
+Raphael.getColor.reset = function () {
+ this.start = undefined;
+};
\ No newline at end of file
diff --git a/system/application/views/template.php b/system/application/views/template.php
index 5beed8e..c6e96de 100644
--- a/system/application/views/template.php
+++ b/system/application/views/template.php
@@ -10,6 +10,7 @@
<link type="text/css" rel="stylesheet" href="<?php echo asset_url(); ?>css/custom.css">
<link type="text/css" rel="stylesheet" href="<?php echo asset_url(); ?>css/menu.css">
<link type="text/css" rel="stylesheet" href="<?php echo asset_url(); ?>css/jquery.datepick.css">
+<link type="text/css" rel="stylesheet" href="<?php echo asset_url(); ?>css/tufte-graph.css">
<script type="text/javascript" src="<?php echo asset_url(); ?>js/jquery.min.js"></script>
<script type="text/javascript" src="<?php echo asset_url(); ?>js/jquery.datepick.js"></script>
@@ -17,10 +18,13 @@
<script type="text/javascript" src="<?php echo asset_url(); ?>js/hoverIntent.js"></script>
<script type="text/javascript" src="<?php echo asset_url(); ?>js/superfish.js"></script>
<script type="text/javascript" src="<?php echo asset_url(); ?>js/supersubs.js"></script>
+<script type="text/javascript" src="<?php echo asset_url(); ?>js/raphael.js"></script>
+<script type="text/javascript" src="<?php echo asset_url(); ?>js/jquery.enumerable.js"></script>
+<script type="text/javascript" src="<?php echo asset_url(); ?>js/jquery.tufte-graph.js"></script>
<script type="text/javascript">
/* Loading JQuery Superfish menu */
-$(document).ready(function(){
+$(document).ready(function() {
$("ul.sf-menu").supersubs({
minWidth:12,
maxWidth:27,
commit 7f2bd4aa3cb8938b849bff90bc78ad5b78846d81
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Mon Dec 6 12:26:22 2010 +0530
Renamed TODO.txt file
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
diff --git a/TODO.txt b/TODO.txt
deleted file mode 100644
index 0cb0a0c..0000000
--- a/TODO.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-Priority - Task - Person responsible
-
-It is now available online at
-
-http://codaset.com/pshahmumbai/webzash/wiki/Project-Plan
diff --git a/todo.txt b/todo.txt
new file mode 100644
index 0000000..0cb0a0c
--- /dev/null
+++ b/todo.txt
@@ -0,0 +1,5 @@
+Priority - Task - Person responsible
+
+It is now available online at
+
+http://codaset.com/pshahmumbai/webzash/wiki/Project-Plan
commit edaba04ca040938d29c3565a96656ae06788b56b
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Mon Dec 6 12:25:28 2010 +0530
Added AGPL License to the project
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
diff --git a/webzash-agpl-3.0.txt b/webzash-agpl-3.0.txt
new file mode 100644
index 0000000..dba13ed
--- /dev/null
+++ b/webzash-agpl-3.0.txt
@@ -0,0 +1,661 @@
+ GNU AFFERO GENERAL PUBLIC LICENSE
+ Version 3, 19 November 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The GNU Affero General Public License is a free, copyleft license for
+software and other kinds of works, specifically designed to ensure
+cooperation with the community in the case of network server software.
+
+ The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works. By contrast,
+our General Public Licenses are intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+ Developers that use our General Public Licenses protect your rights
+with two steps: (1) assert copyright on the software, and (2) offer
+you this License which gives you legal permission to copy, distribute
+and/or modify the software.
+
+ A secondary benefit of defending all users' freedom is that
+improvements made in alternate versions of the program, if they
+receive widespread use, become available for other developers to
+incorporate. Many developers of free software are heartened and
+encouraged by the resulting cooperation. However, in the case of
+software used on network servers, this result may fail to come about.
+The GNU General Public License permits making a modified version and
+letting the public access it on a server without ever releasing its
+source code to the public.
+
+ The GNU Affero General Public License is designed specifically to
+ensure that, in such cases, the modified source code becomes available
+to the community. It requires the operator of a network server to
+provide the source code of the modified version running there to the
+users of that server. Therefore, public use of a modified version, on
+a publicly accessible server, gives the public access to the source
+code of the modified version.
+
+ An older license, called the Affero General Public License and
+published by Affero, was designed to accomplish similar goals. This is
+a different license, not a version of the Affero GPL, but Affero has
+released a new version of the Affero GPL which permits relicensing under
+this license.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ TERMS AND CONDITIONS
+
+ 0. Definitions.
+
+ "This License" refers to version 3 of the GNU Affero General Public License.
+
+ "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+ "The Program" refers to any copyrightable work licensed under this
+License. Each licensee is addressed as "you". "Licensees" and
+"recipients" may be individuals or organizations.
+
+ To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy. The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+ A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+ To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy. Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+ To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies. Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+ An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License. If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+ 1. Source Code.
+
+ The "source code" for a work means the preferred form of the work
+for making modifications to it. "Object code" means any non-source
+form of a work.
+
+ A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+ The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form. A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+ The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities. However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work. For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+ The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+ The Corresponding Source for a work in source code form is that
+same work.
+
+ 2. Basic Permissions.
+
+ All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met. This License explicitly affirms your unlimited
+permission to run the unmodified Program. The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work. This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+ You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force. You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright. Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+ Conveying under any other circumstances is permitted solely under
+the conditions stated below. Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+ No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+ When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+ 4. Conveying Verbatim Copies.
+
+ You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+ You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+ 5. Conveying Modified Source Versions.
+
+ You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+ a) The work must carry prominent notices stating that you modified
+ it, and giving a relevant date.
+
+ b) The work must carry prominent notices stating that it is
+ released under this License and any conditions added under section
+ 7. This requirement modifies the requirement in section 4 to
+ "keep intact all notices".
+
+ c) You must license the entire work, as a whole, under this
+ License to anyone who comes into possession of a copy. This
+ License will therefore apply, along with any applicable section 7
+ additional terms, to the whole of the work, and all its parts,
+ regardless of how they are packaged. This License gives no
+ permission to license the work in any other way, but it does not
+ invalidate such permission if you have separately received it.
+
+ d) If the work has interactive user interfaces, each must display
+ Appropriate Legal Notices; however, if the Program has interactive
+ interfaces that do not display Appropriate Legal Notices, your
+ work need not make them do so.
+
+ A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit. Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+ 6. Conveying Non-Source Forms.
+
+ You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+ a) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by the
+ Corresponding Source fixed on a durable physical medium
+ customarily used for software interchange.
+
+ b) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by a
+ written offer, valid for at least three years and valid for as
+ long as you offer spare parts or customer support for that product
+ model, to give anyone who possesses the object code either (1) a
+ copy of the Corresponding Source for all the software in the
+ product that is covered by this License, on a durable physical
+ medium customarily used for software interchange, for a price no
+ more than your reasonable cost of physically performing this
+ conveying of source, or (2) access to copy the
+ Corresponding Source from a network server at no charge.
+
+ c) Convey individual copies of the object code with a copy of the
+ written offer to provide the Corresponding Source. This
+ alternative is allowed only occasionally and noncommercially, and
+ only if you received the object code with such an offer, in accord
+ with subsection 6b.
+
+ d) Convey the object code by offering access from a designated
+ place (gratis or for a charge), and offer equivalent access to the
+ Corresponding Source in the same way through the same place at no
+ further charge. You need not require recipients to copy the
+ Corresponding Source along with the object code. If the place to
+ copy the object code is a network server, the Corresponding Source
+ may be on a different server (operated by you or a third party)
+ that supports equivalent copying facilities, provided you maintain
+ clear directions next to the object code saying where to find the
+ Corresponding Source. Regardless of what server hosts the
+ Corresponding Source, you remain obligated to ensure that it is
+ available for as long as needed to satisfy these requirements.
+
+ e) Convey the object code using peer-to-peer transmission, provided
+ you inform other peers where the object code and Corresponding
+ Source of the work are being offered to the general public at no
+ charge under subsection 6d.
+
+ A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+ A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling. In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage. For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product. A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+ "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source. The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+ If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information. But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+ The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed. Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+ Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+ 7. Additional Terms.
+
+ "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law. If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+ When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it. (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.) You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+ Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+ a) Disclaiming warranty or limiting liability differently from the
+ terms of sections 15 and 16 of this License; or
+
+ b) Requiring preservation of specified reasonable legal notices or
+ author attributions in that material or in the Appropriate Legal
+ Notices displayed by works containing it; or
+
+ c) Prohibiting misrepresentation of the origin of that material, or
+ requiring that modified versions of such material be marked in
+ reasonable ways as different from the original version; or
+
+ d) Limiting the use for publicity purposes of names of licensors or
+ authors of the material; or
+
+ e) Declining to grant rights under trademark law for use of some
+ trade names, trademarks, or service marks; or
+
+ f) Requiring indemnification of licensors and authors of that
+ material by anyone who conveys the material (or modified versions of
+ it) with contractual assumptions of liability to the recipient, for
+ any liability that these contractual assumptions directly impose on
+ those licensors and authors.
+
+ All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10. If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term. If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+ If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+ Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+ 8. Termination.
+
+ You may not propagate or modify a covered work except as expressly
+provided under this License. Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+ However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+ Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+ Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License. If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+ 9. Acceptance Not Required for Having Copies.
+
+ You are not required to accept this License in order to receive or
+run a copy of the Program. Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance. However,
+nothing other than this License grants you permission to propagate or
+modify any covered work. These actions infringe copyright if you do
+not accept this License. Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+ 10. Automatic Licensing of Downstream Recipients.
+
+ Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License. You are not responsible
+for enforcing compliance by third parties with this License.
+
+ An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations. If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+ You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License. For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+ 11. Patents.
+
+ A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based. The
+work thus licensed is called the contributor's "contributor version".
+
+ A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version. For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+ In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement). To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+ If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients. "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+ If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+ A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License. You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+ Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+ 12. No Surrender of Others' Freedom.
+
+ If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all. For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+ 13. Remote Network Interaction; Use with the GNU General Public License.
+
+ Notwithstanding any other provision of this License, if you modify the
+Program, your modified version must prominently offer all users
+interacting with it remotely through a computer network (if your version
+supports such interaction) an opportunity to receive the Corresponding
+Source of your version by providing access to the Corresponding Source
+from a network server at no charge, through some standard or customary
+means of facilitating copying of software. This Corresponding Source
+shall include the Corresponding Source for any work covered by version 3
+of the GNU General Public License that is incorporated pursuant to the
+following paragraph.
+
+ Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU General Public License into a single
+combined work, and to convey the resulting work. The terms of this
+License will continue to apply to the part which is the covered work,
+but the work with which it is combined will remain governed by version
+3 of the GNU General Public License.
+
+ 14. Revised Versions of this License.
+
+ The Free Software Foundation may publish revised and/or new versions of
+the GNU Affero General Public License from time to time. Such new versions
+will be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Program specifies that a certain numbered version of the GNU Affero General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation. If the Program does not specify a version number of the
+GNU Affero General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+ If the Program specifies that a proxy can decide which future
+versions of the GNU Affero General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+ Later license versions may give you additional or different
+permissions. However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+ 15. Disclaimer of Warranty.
+
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. Limitation of Liability.
+
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+ 17. Interpretation of Sections 15 and 16.
+
+ If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Affero General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+Also add information on how to contact you by electronic and paper mail.
+
+ If your software can interact with users remotely through a computer
+network, you should also make sure that it provides a way for users to
+get its source. For example, if your program is a web application, its
+interface could display a "Source" link that leads users to an archive
+of the code. There are many ways you could offer source, and different
+solutions will be better for different programs; see section 13 for the
+specific requirements.
+
+ You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU AGPL, see
+<http://www.gnu.org/licenses/>.
diff --git a/webzash-copyright.txt b/webzash-copyright.txt
new file mode 100644
index 0000000..f032899
--- /dev/null
+++ b/webzash-copyright.txt
@@ -0,0 +1,24 @@
+Webzash - easy to use web based double entry accounting software
+
+Copyright (c) 2010 - 2011 Prashant P Shah <pshah.mumbai(a)gmail.com>
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU Affero General Public License as
+published by the Free Software Foundation, either version 3 of the
+License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU Affero General Public License for more details.
+
+You should have received a copy of the GNU Affero General Public License
+along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+Webzash includes works under other copyright notices and distributed
+according to the terms of the GNU General Public License or a compatible
+license, including:
+
+- jQuery Javascript Library
+- jQuery Javascript Library Plugins
+- Codeignitor PHP Based Web Development Framework
13 years, 4 months
Changes to 'master'
by pshah
New branch 'master' available with the following commits:
commit 7d3821e05c61ad05ee3561a262c52e8819a39ab3
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sun Dec 5 22:37:44 2010 +0530
Escaping create database statements
The CI db->query will put a quote around the database
name and the CREATE DATABASE does not work. Using basic
php function to escape database name
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 27414bb105cb95274f0b6ffcb5b5679261c41ef8
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sun Dec 5 22:26:36 2010 +0530
Added backup functionality
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 409a67365386386ae1d68576e9be323eaaca9572
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sun Dec 5 22:01:57 2010 +0530
Removed debugging statements
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit d5ee42db3df9e28e19f621d794948854fec7e541
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sun Dec 5 22:00:12 2010 +0530
Using the row count settings in paginations
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit ad662c66ef468acd26c202920e269e9a17a21d0c
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sun Dec 5 21:36:27 2010 +0530
Loading general setting file
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 0de763f5b3a811d05db36389a2a68a70eaa02b5a
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sun Dec 5 21:29:16 2010 +0530
Added row count settings
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 50b210b4fc1b14f45ed173bd725e0f8f4151b4cf
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sun Dec 5 20:48:21 2010 +0530
Added General application settings link
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 9806dfb8af6b4b7b1fa814a17a476b9e0a2e1432
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sun Dec 5 20:32:27 2010 +0530
Cleanup : Added closing comment to all controllers
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit e57c9698cbb3b6716cd24a626f9093a55f61ed3c
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sun Dec 5 20:27:21 2010 +0530
Cleanup : Moved form_close outside of div
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit a673d48a67947fd97bb14d03c14ae7dade34c9e9
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sun Dec 5 19:38:22 2010 +0530
Cleanup : Removed extra php closing tag from end of view files
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 317dec8ef32f35f5a95c76dd6f33bf3865dbf71f
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Fri Dec 3 21:51:42 2010 +0530
Enabled Global XSS Filter
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 278afd5851825e0a8e5a12d58f1a0a5395924cf5
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Fri Dec 3 21:17:15 2010 +0530
Added basic printer settings
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 1ce60cf31f2ae3526fe6b155d79508c58fd0db99
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Fri Dec 3 15:30:28 2010 +0530
Updated TODO.txt to point to Online Project Plan
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit baedc9493c6452ac75484ebfa8f343dd0bee8821
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Fri Dec 3 15:29:00 2010 +0530
Ledger accounts cannot have primary groups as parent
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 69463e554a30963a354cf310f389b313de3b285a
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Fri Dec 3 15:15:39 2010 +0530
Updated Email settings
- Email settings taken from database
- Account name and address from config
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit da4f2731fb44e404adbbcf1fb550493fd6e059fb
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Fri Dec 3 14:58:27 2010 +0530
Added basic Email settings
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 9ccdccd5a908b6df906959eb3a42b22d2ad5d067
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Fri Dec 3 12:10:12 2010 +0530
Fixed typo
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 37332c3251598e675227bcd530e50defc2bea99a
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Fri Dec 3 11:53:40 2010 +0530
Updated account carry forward
- Use the new carryforward.sql database file
- Updated to manully created the groups, ledgers, tags
based on previous values
- Settings file uses the \r\n for newline
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 8f0c1b7f7df6d2d665bae4acefb67da72b5e0826
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Fri Dec 3 11:47:15 2010 +0530
Updated the save settings file to handle newline
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 494565aaf3408792ef0ed8c4b6dadd2b8b1814fd
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Fri Dec 3 10:57:36 2010 +0530
Added basic account carry forward structure
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 95fa171228b3908d0ed91b8241758a16e484af6d
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Thu Dec 2 22:38:29 2010 +0530
Added favicon ya !
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit d730a3e2d6217cb9d3f322afae1970fe9a2c8cce
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Thu Dec 2 22:26:01 2010 +0530
Updated database to include tag_id in vouchers
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 2c94967b9d2073f16f88b3c66e31959431484895
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Thu Dec 2 22:04:35 2010 +0530
Removed unsed view file
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit f92391c8e0cda2714c369c3d16348f8b9d261e17
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Thu Dec 2 22:02:54 2010 +0530
Show currently active account
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit abfc37af33160660b453c9834ffa11ecaffc5e51
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Thu Dec 2 21:53:18 2010 +0530
Creating database settings file as part of create account
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 92b033f470cc4a0b66ee46e3f298acf30c7e0d30
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Thu Dec 2 21:30:26 2010 +0530
Updated Manage accounts to use new session bases settings
- Updated to use new session based database settings
- Removed old activeaccount.inc that is no longer being used
- Updated to activate account via URL but specifying its label
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit c47510d37d713dcfa5d5e0cd4ad1c1282112d75f
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Thu Dec 2 20:49:59 2010 +0530
Added creating account database settings configuration file
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit b59f3f6603ff517eff2202e0af8a0f189aa43a60
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Thu Dec 2 19:45:22 2010 +0530
Added Label to account list
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit cb0e01f5116fcddbea72d5d4e48bfad80afc1b10
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Thu Dec 2 19:38:54 2010 +0530
Updated the active account to simple session variable
- Changed all database settings stored from session to only
using a simple label to prevent security issues
- Updated the Startup and Admin welcome to verify the database
and set appropriate error messages
- Startup and Admin welcome now shows similar error messages
- Checking the ini files for presence of all values that are
needed
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 064a1fc5508a4a0a9ce72dd3fe3bcdf1633f3a90
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Thu Dec 2 17:28:04 2010 +0530
Updated the code to use new session based database settings
- Removed the default database settings to be selected by session
- Changed database pconnect to FALSE
- Added system/application/config/accounts/ folder to store db settings
- Change the code to use new session based database settings
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 095c5e506dcdea063d45f661d0e92a3c8db52088
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Thu Dec 2 16:09:26 2010 +0530
Updated database to create tags table
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 26e22a229103053fcb809112a9fae7a093921fc0
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Thu Dec 2 12:03:41 2010 +0530
Upadate the Tag list page
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit b64792db8909ff11e9559cf3147fd979e608e9f1
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Wed Dec 1 22:24:36 2010 +0530
Added Tags to Voucher view
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit cb73729f4339a3350118376e54402b5438d8ad37
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Wed Dec 1 22:12:35 2010 +0530
Added rounded border to tags
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 0eda6c8bbe6440b6510540acab89ff96e6e6816e
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Wed Dec 1 22:10:15 2010 +0530
Added basic voucher tagging
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 4e1a15ecc7f9980e400dfc872b558056f63c2194
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Wed Dec 1 21:35:03 2010 +0530
Added Tagging Management
- Added is_hex validation
- Added Tag management in settings
- Added Tag add, edit, delete functionality
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 9d58a5040aa79c0e3791adb40c1927d032099438
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Wed Dec 1 18:56:18 2010 +0530
Converted Ledger Summary from table to plain text
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit abcde2eb26aa6daf27ddfa4dcca040ed4d3542c5
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Wed Dec 1 18:50:52 2010 +0530
Moved Ledger Summary to top
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 590541af06c8769820ede46ca84cedc1fa1e9541
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Wed Dec 1 17:13:27 2010 +0530
Updated Profit and Loss statement to separate Gross and Net
- Separate Gross and Net Calculations
- Net is carried forward to Balance Sheet
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 45da7473bd3728d0a13ec6b7e6f66efc4a03c2fe
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Wed Dec 1 15:52:09 2010 +0530
Updated groups to affect gross profit / loss calculations
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 563ddab7af35ce1b104be48065889dde32bb6e94
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Wed Dec 1 14:37:45 2010 +0530
Added style for fieldset
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 8d95d5fda1238299b031e4ed3ea5b67423c7f6bb
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Wed Dec 1 14:28:42 2010 +0530
Removed Closing Balance from Group Accounts
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit fe53032b6c10426a035e70d24b4312fe1f1af480
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Wed Dec 1 14:24:11 2010 +0530
Added Difference in OP Balance as error message
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit cae2146a99eb022a5678dd648ab781401c448d93
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Wed Dec 1 14:14:34 2010 +0530
Updated Profit and Loss Statement with correct net value
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 31e7382c6b1b9aa62c94288ae0493e98c5e915c3
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Wed Dec 1 13:40:31 2010 +0530
Convert 0.00 to 0
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit c1eec44a3d9ea5a192a392767d25bac929478064
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Wed Dec 1 12:41:55 2010 +0530
Added Diff in OP Balance to Balance Sheet
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit e97ced8f6848e0e4e10c54dc712a5bc0d5714d1c
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Tue Nov 30 22:30:42 2010 +0530
Undo the last commit
Removed the extra space
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 26415876b9a099742d4a90b799cab92e7e0b7ec2
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Tue Nov 30 22:28:16 2010 +0530
Added more space in Chart of accounts tree
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit d9d54edef2070e5fb24a8d4e04db15ca46e37584
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Tue Nov 30 22:24:19 2010 +0530
Converting currency in proper format
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit b90573dd3f56c62da346607c15caf473f09d98b8
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Tue Nov 30 22:16:50 2010 +0530
Added Difference in OP in Chart of accounts
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit c2ecdf4e27364c349a23f3b239c8566e41d07a35
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Tue Nov 30 21:56:13 2010 +0530
Updated Balance Sheet with P&L A/C
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 0286ba11025d1fd40737773fa8f7bb4ce49e4761
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Tue Nov 30 21:03:02 2010 +0530
Cleanup menu links and nav links
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit eeddb39bae1edc4c91f68e489af7a86dddd099c5
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Mon Nov 29 21:18:42 2010 +0530
No need to make ajax call for ledger balance when ledger id is 0
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 5c4da68ed510c62a447923376e97412999655fab
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Mon Nov 29 21:06:50 2010 +0530
Added return statements to all contorllers
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit a91164fe54d2db9cdf6d7d738b81de477630254f
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Mon Nov 29 20:54:34 2010 +0530
Added XSS Filtering to input data
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 771d96b638aa40d70192bc2b2f4a9c015be9557a
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sun Nov 28 12:39:10 2010 +0530
Fixed the final closing balance value in ledger st
Used the actual closing balance value rather than current page
closing balance value in ledger st summary table
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 1867d6d9523f8e94b4c6c67da417ebebf0861fe4
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sun Nov 28 12:29:25 2010 +0530
Check for voucher type in all voucher actions
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 97b531b53fd3788fcf3cf3595a08755ce6030362
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sun Nov 28 12:20:01 2010 +0530
Check for voucher type in voucher show action
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 826ceb46cf004f0eaa4d37445e1f3c9fe3d9aace
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sun Nov 28 12:14:05 2010 +0530
Style the admin section secondary navigation links
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 88a037dc2fda8b0db55aa06705206cc82473210e
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sun Nov 28 12:10:54 2010 +0530
Style the secondary navigation links
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 4224db34560ccc33e55c435793b1a2193513c1fd
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sun Nov 28 10:28:30 2010 +0530
Checking for valid database settings
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 0a75e66e27b7ef5a0a0ed972b28d567ce040d984
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sun Nov 28 10:01:42 2010 +0530
Setting $db['default']['db_debug'] to FALSE
Manually handling if database connection is not valid.
Redirecting the user to admin section.
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 2c7bf5f53aece73c770cb3e00533950623dc4b59
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sat Nov 27 16:27:20 2010 +0530
Dummy change account list
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 093b876d199ade0a31bd2375117b960d3f3d9050
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sat Nov 27 16:08:15 2010 +0530
Updated the anchor code to show title
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit a993fab559d2e2562e272db7d5fcf41358ec9830
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sat Nov 27 16:02:36 2010 +0530
Added basic account management
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit bf29675ce429606b5e04575e13818d08648f7b51
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sat Nov 27 15:37:01 2010 +0530
Added XSS Filter string
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 358b97f68ef7d4ac65457f523382ccc4b52e26aa
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Fri Nov 26 21:22:59 2010 +0530
Added currently active account details to admin welcome view
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 20bb86c7b37f9b6a675be48715db5a4fa35d2c62
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Fri Nov 26 20:52:13 2010 +0530
Added creation of new database
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 83e43b8930cb27d9ab61c6423f49d90be462f3e3
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Fri Nov 26 20:35:25 2010 +0530
Added create account database script
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 45b3917e68babed43203e778b4d4976fa8957713
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Fri Nov 26 19:19:09 2010 +0530
Check for valid database details when creating new account
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 80bcd2c71acba3be0103b8f49778e90f474079cc
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Thu Nov 25 20:57:59 2010 +0530
Added basic Admin create account structure
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 70c778719f694bcd6688e9541e33e661ef72019e
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Thu Nov 25 20:22:17 2010 +0530
Added basic admin structure
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit a6f1a870693156cffa855f0442643d3a231376c2
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Thu Nov 25 19:58:36 2010 +0530
Check for valid database and load account settings
- Check for valid database
- Load account settings into config
- Update template to use the above config settings
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit d9ae529fe2dbacbd6d06e15574b3a3baf95c5c73
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Thu Nov 25 15:01:12 2010 +0530
Added Administer link on top
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 1ca973adaba8526767f485f56cb29b6dfb226106
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Thu Nov 25 14:35:24 2010 +0530
Updated Voucher email
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 9bb527e1c12461a3290a5693cb0937d799f79d4e
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Tue Nov 23 14:32:47 2010 +0530
Added Email settings link
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 17318550fc3ba096c3928b6edef8ff2ceea54fcf
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Tue Nov 23 14:25:11 2010 +0530
Added cash / bank type to Ledgers
N = Normal
B = Cash / Bank
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit c622e56b063b9b24143db581f950a9ee3c95fece
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Tue Nov 23 14:08:55 2010 +0530
Added subsuper plugin for variable width sub menu
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit eaca9110d090208ccc8b845dfdfcb4d4f867d9ed
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Tue Nov 23 14:00:54 2010 +0530
Added jQuery Superfish based menu
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 7a0da9a80c150b4347e7c3a0dcf160852e642ef0
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Mon Nov 22 21:27:27 2010 +0530
Updated Ledger statement to link to voucher view
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 9d547827885fb2295033bf98925663ea90f5bab4
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Mon Nov 22 21:14:21 2010 +0530
Added Voucher view
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 5431245ac2f0924ecc52eaa58008bdee00a53986
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sat Nov 20 22:17:29 2010 +0530
Fixed UI problems
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 659946f2f474ca316bed89667ed5cec4b36e2663
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sat Nov 20 22:09:25 2010 +0530
Added convert currency helper function
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit de98ae1111708b2f6a9d391faf34c9aaa7b5dba8
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sat Nov 20 21:54:16 2010 +0530
Updated correct Ledger statement with draft and summary
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 21443f702968140e730605bd9a57f1752c811b58
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sat Nov 20 21:26:56 2010 +0530
Added Ledger Statement that is not correct
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 66ea2b9e2bb6e46f5b7bee75dd11bb41d9de7da1
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sat Nov 20 20:49:41 2010 +0530
Added Closing Balance to trial balance statement
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit b623b7ad765745c850a4b6cab85ef8fa6d2f2a98
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sat Nov 20 20:41:50 2010 +0530
Added transaction support to Voucher edit
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit c4f40142b82a1bceceaa0c9a2dc4a5f97d21c92e
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sat Nov 20 20:39:49 2010 +0530
Added transaction support to Voucher deletion
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 91700a207f95711fc9b0ad6f6325514fda751021
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sat Nov 20 20:38:39 2010 +0530
Added transcation support to Voucher add
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit b2256d34c441f50698d50d6193f0a6e8aa855027
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Fri Nov 19 20:54:51 2010 +0530
Added O/P and C/L Balance to Ledger statement
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 3af3e4e018edb05a60ebc94e97c53bf24c0ad62b
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Fri Nov 19 20:20:00 2010 +0530
Updated Trial Balance report
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 96f11b1a77f7f5d9e76d2c402d28ed6d3181e2bf
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Fri Nov 19 20:13:44 2010 +0530
More informative status messages
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 070bc55897f258310f0f90dad7d8801f24dbc3a9
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Fri Nov 19 19:29:19 2010 +0530
Display correct Dr/Cr in Charts of accounts
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 06c00ca251e2d4b1c4b632c238f48561a3bcbd2c
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Fri Nov 19 19:21:20 2010 +0530
Validation - only positive amount allowed
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit fd2d2a7b984214fc6800892984ea3f23d24196f7
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Fri Nov 19 15:39:07 2010 +0530
Refactored Account Ledgers
- Added transcations support
- General Cleanup
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit aab78f7d8bc8503ab7719241da7f179249b7c02a
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Fri Nov 19 15:21:06 2010 +0530
Refactored the Group controller and views
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 7bb592ff96e27ff9ca897cfb001ceb25be8a52e6
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Fri Nov 19 15:09:15 2010 +0530
Added DB transactions support to Account Groups
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 6e38e3512051ecf541f22d2acf9602cea61323fa
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Thu Nov 18 21:26:50 2010 +0530
Added sample profit and loss statement
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 9e58508a443a4e4b7cefc72a58f0e0f408701ee3
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Thu Nov 18 21:12:17 2010 +0530
Sample Balance sheet
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit e21b77bedf77b2a22d64c3999b1ccddcea0cf57e
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Thu Nov 18 20:39:55 2010 +0530
Removed old Account list generation code
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit d2255085a87b118c11967fc3cce7d62cb2a09f63
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Thu Nov 18 20:38:12 2010 +0530
Using Accountlist model for Account list
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit aa7235e7cd9332399ce1729dce84361b4f4e3b8e
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Thu Nov 18 19:57:45 2010 +0530
Ledger Statement is shown as descending by voucher number
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit c27dbe63ea4a962195fdb04e4e4ecacd1e5f1ab7
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Thu Nov 18 19:56:18 2010 +0530
Added Pagination to Ledger Statement
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 142a9138362ac8c40d478179d5500464d72d2611
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Thu Nov 18 19:36:28 2010 +0530
Filtering url data
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 5852e5beb08e239e10a2cf499c9fa75dbe2ba9e6
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Wed Nov 17 16:52:40 2010 +0530
Added flickr style pagination to Voucher list
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 643ea133bbaf80c1c77b783a39bbeb286a81860e
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Tue Nov 16 22:03:55 2010 +0530
Added Print settings
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 38b47ea00692ed7f325b5df8a98db174947f2c81
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Tue Nov 16 21:53:10 2010 +0530
Voucher list shows first ledger name
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit fcb479ade27a9d80533c070eff3a3d2b72dc1843
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Mon Nov 15 21:32:51 2010 +0530
Updated Voucher edit
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit ab28bd934eef9b9685b2c62db5f1ed312f97f898
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sun Nov 14 16:19:38 2010 +0530
Corrected submit button name from Create to Update
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit b5dac55b3616f9df3e2f6810fb8552a6506f9ece
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sun Nov 14 16:17:43 2010 +0530
Updated variable names in edit voucher
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 7eeda67e674becbc9861c6ed3db8cf8bcf712b2c
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sun Nov 14 16:08:12 2010 +0530
Updated add voucher to handle repopulation of data
- Moved the ledger form code to controller
- The view just loops through ledgers data received from
controller
- Cleaned up the post variables naming
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit dbd1f22a08eaa3d751a9f835c92ded1dde128ae1
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sun Nov 14 15:38:17 2010 +0530
Updated date helper
Removed need to get the current instance
Added todays date in php format
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 189b32d941f4f8daf8f33debf344e1640fde3f4e
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sun Nov 14 15:30:52 2010 +0530
Added basic voucher update functionality
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 892c2c0ee94d2f2e9429ab24183ae72202b03de4
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sun Nov 14 14:35:49 2010 +0530
Javascript works correctly on add new rows
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 324b55bf0b48c3fc10e8ee66625897d4006e1da3
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sat Nov 13 20:59:56 2010 +0530
Added basic voucher email
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 6f5c0706551982de516a5d739946d12beedd733e
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sat Nov 13 20:23:36 2010 +0530
Added ajax based current ledger balance in vouchers
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 582c5839bda9b7e4e1de4ef915c7823b520f4cab
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sat Nov 13 16:30:32 2010 +0530
Corrected the comment message
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 0bd6042c2fc64767e24a961d6d74150653941adb
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sat Nov 13 16:17:54 2010 +0530
Added different color for draft vouchers
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 7221e6796c6446cfa37f24016b01aa6361ee27a4
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sat Nov 13 16:08:58 2010 +0530
Updated voucher code
- Added recalculation icon
- Added Amount difference row
- Added different initial Dr/Cr depending on voucher type
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 15c6e435963062ed3c7ef81c90c427e2fd1929e6
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sat Nov 13 15:43:32 2010 +0530
Javascript : Added Dr - Cr and Ledger change handlers
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 688e2474206e4848a19ec4b3d0a765a781f6e85c
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sat Nov 13 14:52:24 2010 +0530
Updated the voucher javascript code
- Update the colors as per dr and cr total
- Update the dr amount and cr amount column as per dr/cr dropdown
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 29506219c9b589017be0916b0b1c5f38f6ec10c2
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sat Nov 13 12:49:58 2010 +0530
Javascript to updated the Debit and Credit Total
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit f457fe7668f8af76aefe768fafa6d66fbd39db91
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sat Nov 13 12:09:54 2010 +0530
Updated vouchers to save as draft
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 504a39b6cb9d2664a38d2758c83bf52dc51a7644
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Fri Nov 12 17:15:56 2010 +0530
Added title to links and email voucher link
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 63d437e9f3b8c4a96dc8d6b71fb398c2096b6115
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Fri Nov 12 17:09:05 2010 +0530
Added basic voucher printing
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 57f18afc0325a918a6eded54f60dfdd020e965bc
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Fri Nov 12 16:40:50 2010 +0530
Using site_url function
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 536bdedb1c8e12ab272c695fdcc58a5e184ee989
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Fri Nov 12 16:27:43 2010 +0530
Remove index.php from URL
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit ab878d826d5b0dc37ab88bfb6a436bb0e43b1c5d
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Thu Nov 11 14:41:11 2010 +0530
Added seperate css for new table rows
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 55c098a1c156aa9392985771635bb4fdbc3c7d76
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Thu Nov 11 14:29:48 2010 +0530
Added dynamic table row addition and deletion to voucher
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit a33d687427e50b96a83ebbe1ca55e477b59f211d
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Thu Nov 11 12:03:26 2010 +0530
Added voucher deletion
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit f04af7b6e11f05b99de0f568f11d3690c1e794c2
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Wed Nov 10 18:27:08 2010 +0530
Removed unused debugging code
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit ff264ecd5849f3623187b8ea60bc85fdcafc8ddd
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Wed Nov 10 18:26:25 2010 +0530
Updated the code to use uniquevoucherno validation
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 7a42c6728925a905874c599b68d024caddc920c9
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Wed Nov 10 18:25:36 2010 +0530
Added custom validation for unique voucher number
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 299ddbec24bc1ef94d8fc35301b1a6267e395871
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Wed Nov 10 18:21:54 2010 +0530
Added converting voucher number - voucher type helper
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 60784fedfb55560cae4ce0a9bc413a8c3584a097
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Wed Nov 10 17:55:37 2010 +0530
Updated code to use custom functions
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit ffc499af7c2cea5e0f365ef9d9dace9a9857404b
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Wed Nov 10 15:56:41 2010 +0530
Updated a link style
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit bc35c03ba63d8324b56b395ddd39d83c0924798f
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Wed Nov 10 15:42:44 2010 +0530
Updated travel_group to account_st_short
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 873fb6bb5cb75ad5501c5fce877901ce1047d112
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Wed Nov 10 15:31:30 2010 +0530
Changed company to account
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 9e7cc94321a051b12b15a43d6bb023edecaa6f41
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Wed Nov 10 15:23:16 2010 +0530
Added TODO file
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 2db1645fa74bfc85fcc3f5c500821392c1e5a963
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Wed Nov 10 15:17:28 2010 +0530
Updated ledger statement
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 8eef0b81c5fca3dba98b1e030260c5eb3150bbaa
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Tue Nov 9 22:09:43 2010 +0530
Added Ledger Statement structure
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit ea3775a960831e9dd3c0f6e6f319d44c6aa2fcfb
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Tue Nov 9 21:23:52 2010 +0530
Added reports
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit e3617906c95239ee0dd5be22d8753ee69b411b93
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Mon Nov 8 22:30:05 2010 +0530
Added get_ledger_balance function to Ledger model
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 94e104017027d0585429301845ccebcfcdf00369
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Mon Nov 8 22:29:20 2010 +0530
Added account info in the template
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit e42d2c6c97c3ab329417501620972ae69b52690d
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Mon Nov 8 13:51:13 2010 +0530
Updated to save timezone settigns to database
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 6144685a5940700676d3672e82c8ddfb040c332d
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Mon Nov 8 13:50:38 2010 +0530
Custom mysql to php date conversion function
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 28ff8d081c2fe776867db7cde50818c99245f323
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Mon Nov 8 12:44:13 2010 +0530
Added Settings model, controller and views
Added company settings action
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 04d9ba14c848d4175f2840e0cbc2459fc592096d
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sun Nov 7 22:15:42 2010 +0530
Deleted old template header and footer
Since we are using new Template library that is much easier
the old header and footer are no longer required.
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit fa7e3555d232ab69f140be4ed418070cda8916f0
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sun Nov 7 22:13:35 2010 +0530
Moved to new Template library
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 313e0641bf7aef29b7e9641d103b240979f5f105
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sun Nov 7 21:22:20 2010 +0530
Added Template library
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 4c47779e9e582afc0469f2a8d7a67df4278e59bb
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sun Nov 7 21:21:59 2010 +0530
Cleaned up some CSS
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit f38fed7602cdf71973d43fba06c36a79e7935046
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sun Nov 7 19:01:09 2010 +0530
Updated code to use the new Messages library
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 1af52e9e4073284e5832d606d8113a31e46cdc4e
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sun Nov 7 18:35:17 2010 +0530
Updated vouchers to use the new Messages library
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 580266aec67bd49496f6150fdfa5a8198a90d820
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sun Nov 7 18:25:11 2010 +0530
Replaced default with new Messages library in header
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 92dcbc7171ed654d215616746dce633e0f916a8a
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sun Nov 7 18:24:28 2010 +0530
Added messages library to handle messages
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 9180cb3dd6785122f910caa7c534b8272bda1209
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sun Nov 7 16:02:59 2010 +0530
Updated the Voucher listing page
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 4d8ccb35e2a228352e787eb5dd3872142865ffe5
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sun Nov 7 15:29:58 2010 +0530
Voucher repopulating after POST request
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 7a3e73d3ae18550cccb710899f753647915e6967
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sun Nov 7 15:13:13 2010 +0530
Updated the new voucher forms
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 57e2a212bb05c85c9e2ba5c6aafa738be1618327
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sun Nov 7 15:12:38 2010 +0530
Custom date helpers
Helps to convert date from and to mysql and php
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 3e76d6d0d69a290995de04682da45a744e5b3fdb
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sun Nov 7 15:11:50 2010 +0530
Added is_date validation
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit c514168b479743123e02e754173a030ced3d6274
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sun Nov 7 15:07:04 2010 +0530
Autoload date helper
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit f2e0c72efb4a5eddc21f8190b91b38ae92506be8
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sun Nov 7 11:55:55 2010 +0530
Corrected the datepicker css
commit a915c311ce0e78e71ac4fce5a12962b350036266
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sun Nov 7 11:45:27 2010 +0530
Added new jQuery based datepicker
Datepicker from http://keith-wood.name/datepick.html
This datepicker does not messup the input box existing
date to reset it to own format.
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 85f07ad703b06b7c0092b134c8ebe82e4f2cc941
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sun Nov 7 11:37:17 2010 +0530
Removed all jQuery UI based datepicker code
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 78370ef841af6084b9c4c8a2ecc0a13a7f76845a
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sun Nov 7 11:33:40 2010 +0530
Setup the datepicker plugin
- Added the jQuery UI pluging
- Moved the js code to custom.js
- Added "datepicker" class to input box
- Added css style for datepicker
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit f92ab10c47b4c0bbbe7c1475f5b67314476ad1c2
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sun Nov 7 10:51:42 2010 +0530
Added jQuery date picker
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 2714254b04a9cc8c9808f31e0de88976366b5737
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sun Nov 7 10:41:10 2010 +0530
Changed class to generaltable
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 100fa73cb9aa769d303948d5ebdb4b2d91ae83c0
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sun Nov 7 10:27:47 2010 +0530
Removed the extra / from URL's
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit f95f62264858e648b21634e01b4f72b91fbc74b8
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sun Nov 7 10:17:02 2010 +0530
Added New Voucher
- Voucher model
- Voucher controller
- Voucher add action and view
- Date and Ledger Form Helpers
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 18f4a3936deb0eedf967ee9d27adfbd25a55d88e
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sat Nov 6 22:31:26 2010 +0530
Added Voucher model, controller and views
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 08bce72d562941f1e099b4a4499f0a012b51a6db
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sat Nov 6 19:09:33 2010 +0530
Renamed css from accounts.css to talbles.css
- Renamed the css files
- Changed the header template to load the renamed file
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 96d6cf359577752e19f108fb4bf83dfaba506548
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sat Nov 6 19:04:58 2010 +0530
Matched table style to overall theme
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit a4a11aa5429afc4854130985a0576298c9da5956
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sat Nov 6 18:53:41 2010 +0530
Moved convert_dc helper to a seperate custom helper
Moved the convert_dc helper from form_helper to a seperate
custom helper and autoload the custom helper.
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 17fb65198245d8381de39f3425b2129eb42eb2f2
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sat Nov 6 18:48:04 2010 +0530
Added Ledger add and edit actions
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 880a3df62a0b9172abb6c34342559e350251f5d1
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sat Nov 6 18:47:30 2010 +0530
Updated the account controller to display op balance
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 45db65fd876fd5bcc38be1ffcfd178041c834a54
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sat Nov 6 18:46:47 2010 +0530
Added conversion from D/C to Dr/Cr helper
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 07005fd458daed21b683d5fc2c5aee0223adbf82
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sat Nov 6 15:01:53 2010 +0530
Updated to better status messages for Group controller
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 021c75a3518992aa0bb7fa503f075ca47f8419d7
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sat Nov 6 14:59:48 2010 +0530
Added Dr/Cr Form helper dropdown
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 725bbd0b795f2e1ebc231cd96ea961d5a9a63861
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sat Nov 6 14:58:39 2010 +0530
Added debit credit and currency validation
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 822f271735df840922b4f1df9bea0694134a27e0
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sat Nov 6 13:35:51 2010 +0530
Added Ledger controller and view
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 235d266469b8408936396247c10be0d55178e8d6
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sat Nov 6 13:27:20 2010 +0530
Using Group model
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 413368df4208473e4323dc1ef0a3f2c05fa4954d
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sat Nov 6 12:57:43 2010 +0530
Added Group model
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 216a578a03e0d6be503993496678ac7fc3a29eac
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sat Nov 6 11:58:20 2010 +0530
Cleaned up the Dashboard and Account views
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 34bc1245cdc951f6620029be188e5644441dc492
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Sat Nov 6 11:32:26 2010 +0530
Added group edit action
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit fb3ac5a9f88d4ca111c2126f2bc6386d13d4d174
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Fri Nov 5 20:18:06 2010 +0530
Corrected the id check
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit c27350b0161bdb82189a6fd7536b32b8c98eee60
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Fri Nov 5 19:38:03 2010 +0530
Added group deletion action
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit e6d5d964bc1eae8052c165723c1ea8fe8431cc7c
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Fri Nov 5 19:36:54 2010 +0530
Updated the header template
- Show the error message
- Load the javascript libraries
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 46eb745bba3e6ffd1ee46241c9a181e63968dbaa
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Fri Nov 5 19:35:43 2010 +0530
Added jQuery JavaScript Library v1.4.3
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 1a16f3bcd54e0a8e7392fbcaf41ff286c9ab5f7e
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Fri Nov 5 19:01:37 2010 +0530
Fixed some alignment issue with the chart of accounts
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 7b4262a6c593be3dd54aafaf44695115f17ca77f
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Fri Nov 5 19:01:04 2010 +0530
Updated the header tempate and css to display messages
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 8f100b430913ff5c83fce6024094467e9821aab7
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Fri Nov 5 18:59:34 2010 +0530
Added group controller and new group creation action
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit f9e6a47fb6fa5cff7847533b2521be7cf7eb6c22
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Fri Nov 5 18:59:03 2010 +0530
Added form helper to autoload
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 15f8f0c50af59f474783f20b3e4a41ee35882d76
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Fri Nov 5 18:57:53 2010 +0530
Added custom uniqueness validation
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 945ec413edbd3ba8ad8bce198e2031a1037b4c6d
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Fri Nov 5 14:49:50 2010 +0530
Table based Chart of accounts
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 205d7b6b783c7a36752d43a89a79d0ad92b17e3a
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Fri Nov 5 14:49:10 2010 +0530
Load html helper
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit ed52ae4af2c09571254437bfb65647fd5fd840fa
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Fri Nov 5 12:41:52 2010 +0530
Added icons
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 637dcf87710af141954a56ea36e00484a246e274
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Fri Nov 5 12:04:53 2010 +0530
Added "Accounts" controller
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit bac3e64d734584d9d9c67444c63934dd9b97cffc
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Fri Nov 5 12:03:22 2010 +0530
Added database settings
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 241a0720852a6dac4a9f11f0f780b7058bdb8afa
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Fri Nov 5 10:33:00 2010 +0530
Cleaned the template
- Condensed everything in header and footer views
- Removed menu and sidebar view
- Added new varaibles in the header view
- Cleaned up the CSS and HTML markup
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 37a1e909bbfb204657447cf8c6aaefb9d27a9c07
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Thu Nov 4 20:48:19 2010 +0530
Changed main menu item from Home to Dashboard
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit a08b039dbbbb7e087c51a5336e6299f35ac4bd85
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Thu Nov 4 19:31:46 2010 +0530
Added basic theme template
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 5c7a82abaa36f7deac0aa18a0297cf586fbf0461
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Thu Nov 4 15:00:20 2010 +0530
Added Webzash logo
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit f390956915d604d37929ac9138bf9d620ee1a601
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Thu Nov 4 14:58:19 2010 +0530
Autoload helpers and libraries
Autoload the url and path helper.
Autoload the database and session libraries.
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 18dc93a5a834ec55b797c1a4103b4d81635914ea
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Thu Nov 4 14:52:17 2010 +0530
Set the $config['base_url'] parameter
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 321ce1466b53f41b3150125afe1ddc3cb27c33cf
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Thu Nov 4 14:45:06 2010 +0530
Added custom assets path helper
This helper will return the path to the assets directory
which contains application images, css, javascript, etc files.
It also adds a custom config parameter called $config['asset_path']
which points to the assets directory.
This helper can be called by loading the "path" helper and using
"asset_url()" helper function. It depends on "url" helper.
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
commit 9a40cbeaeb944337e3b111106b93b4486a5d8eb7
Author: Prashant P Shah <pshah.mumbai(a)gmail.com>
Date: Thu Nov 4 14:01:45 2010 +0530
Initial commit. Importing CodeIgnitor 1.7.2 code
Signed-off-by: Prashant P Shah <pshah.mumbai(a)gmail.com>
13 years, 4 months