<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html dir="ltr"><head>
<title>Journal Entry</title><meta http-equiv="Content-type" content="text/html; charset=ISO-8859-1">
<link href="default.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="time.js"></script>
<script type="text/javascript" src="currentdate.js"></script>
<script language="JavaScript" src="calendar_us.js"></script>
<link rel="stylesheet" href="calendar.css">
<script type="text/javascript">
var i,d=document;
function add(oRow)
{ oRow.parentNode.replaceChild(oRow.cloneNode(true ),oRow.parentNode.insertRow(oRow.rowIndex+1));
var inpS = oRow.getElementsByTagName('select');
var inpR = oRow.getElementsByTagName('input');
var inpN = oRow.nextSibling.getElementsByTagName('input');
for(i=0;i<inpR.length;i++)
{
if(typeof(inpS[i]) != 'undefined') inpS[i].disabled = true;
if(inpR[i].disabled)inpR[i].disabled=false;
if(inpR[i].type=='text'){inpR[i].disabled=true;inpN[i].value=''};
if(inpR[i].value=='add'){inpR[i].value='ed';inpN[i].disabled=true};
}
}
function ed(oBut)
{ var trow = oBut.parentNode.parentNode
var inpR = trow.getElementsByTagName('input');
var addrow = trow.parentNode.childNodes[trow.parentNode.lastChild.rowIndex-1]
var addeds = d.getElementsByName('added');
for(i=0;i<inpR.length;i++)
{ if(oBut.value=='ed' && inpR[i].type=='text')inpR[i].disabled=false;
if(oBut.value=='lock' && inpR[i].type=='text')inpR[i].disabled=true;
}
if(oBut.value=='ed')
{ oBut.value='lock'
for(i=0;i<addeds.length;i++)
{ addeds[i].disabled=true;
} oBut.disabled=false;
addrow.childNodes[0].firstChild.disabled=true;
addrow.childNodes[1].firstChild.disabled=true;
} else // oBut.value is not 'lock'
{ oBut.value='ed'
for(i=0;i<addeds.length;i++)
{ addeds[i].disabled=false;
} emptyStr(addeds[i-1].parentNode.parentNode)
addrow.childNodes[0].firstChild.disabled=false;
addrow.childNodes[1].firstChild.disabled=false;
}
}
function send(oForm)
{ var inpF = oForm.getElementsByTagName('input');
for(i=0;i<inpF.length;i++)
{ inpF[i].disabled=false;
} //oForm.submit();
}
function check(strt){ return (/^\d*\.?\d*/.exec(strt)==strt)?strt:check(strt.slice(0,(strt.length-1))) }
function emptyStr(oRow)
{ var oInpS=oRow.getElementsByTagName('input');var sum1=0,sum2=0;
oInpS[0].value=check(oInpS[0].value);oInpS[1].value=check(oInpS[1].value);
if( oInpS[0].value && !(oInpS[1].value) || oInpS[1].value && !(oInpS[0].value)) oInpS[2].disabled=false;
else oInpS[2].disabled=true;
//sumus();
}
function sumus()
{ var sum1=0,sum2=0;
var Col1InpS = d.getElementsByName('row[txt1][]');
var Col2InpS = d.getElementsByName('row[txt2][]');
for(i=0;i<Col1InpS.length;i++)
{ sum1+=1*Col1InpS[i].value;sum2+=1*Col2InpS[i].value;
} d.getElementById('s1').innerHTML=sum1;d.getElementById('s2').innerHTML=sum2;
}
function check1()
{
if(getElementById('s1').innerHTML != getElementById('s2').innerHTML)
{
alert(getElementById('s1').innerHTML);
alert('total should be matched before proceed');
return false();
}
}
</script>
</HEAD>
<script type="text/javascript" src="tigra_hints.js"></script>
<style>
.hintsClass {
font-family: tahoma, verdana, arial;
font-size: 12px;
background-color: #f3ffff;
color: #000000;
border: 1px solid #808080;
padding: 5px;
}
.hintSource {
color: green;
text-decoration: underline;
cursor: pointer;
}
</style>
<?
$userid = $_SESSION['userid'];
$sql="SELECT * from 0_ledger where group_id not in(1,7) and user_id = $userid";
$result=mysql_query($sql)or die('Query error:'.''.mysql_errno());
?>
</head>
<body onload="startTime(); currentdate();">
<?php include_once('header.php');
include_once('menu3.php');?>
<script language="JavaScript">
// configuration variable for the hint object, these setting will be shared among all hints created by this object
var HINTS_CFG = {
'wise' : true, // don't go off screen, don't overlap the object in the document
'margin' : 10, // minimum allowed distance between the hint and the window edge (negative values accepted)
'gap' : 0, // minimum allowed distance between the hint and the origin (negative values accepted)
'align' : 'tcbc', // align of the hint and the origin (by first letters origin's top|middle|bottom left|center|right to hint's top|middle|bottom left|center|right)
'css' : 'hintsClass', // a style class name for all hints, applied to DIV element (see style section in the header of the document)
'show_delay' : 50, // a delay between initiating event (mouseover for example) and hint appearing
'hide_delay' : 50, // a delay between closing event (mouseout for example) and hint disappearing
'follow' : false, // hint follows the mouse as it moves
'z-index' : 100, // a z-index for all hint layers
'IEfix' : false, // fix IE problem with windowed controls visible through hints (activate if select boxes are visible through the hints)
'IEtrans' : ['blendTrans(DURATION=.3)', 'blendTrans(DURATION=.3)'], // [show transition, hide transition] - nice transition effects, only work in IE5+
'opacity' : 100 // opacity of the hint in %%
};
// text/HTML of the hints
var HINTS_ITEMS = [
'Date Should not be of Future',
'If Last Actual Budget is Null then <br> it means no entry is passed in last month',
'tooltip for item3<br>This one is multi line',
'tooltip for item4',
'another sample tooltip with the <a href="http://www.softcomplex.com">link</a>'
];
var myHint = new THints(HINTS_ITEMS, HINTS_CFG);
</script>
<div class="clear">
</div>
<div id="menu2">
<ul>
<li><a href="entry.php" style="font-family:Verdana, Arial, Helvetica, sans-serif; font-size:14px">Journal Entry</a></li>
<li><a href="payment.php" style="font-family:Verdana, Arial, Helvetica, sans-serif; font-size:14px">Payments</a></li>
<li><a href="deposit.php" style="font-family:Verdana, Arial, Helvetica, sans-serif; font-size:14px">Receipts</a></li>
<li><a href="showgl.php" style="font-family:Verdana, Arial, Helvetica, sans-serif; font-size:14px">View Journal Entries </a></li>
<li><a href="contra.php" style="font-family:Verdana, Arial, Helvetica, sans-serif; font-size:14px">Contra Entry</a></li>
</ul>
</div>
<div class="clear"></div>
<center>
<table border="0" width="100%">
<tr>
<td width="20%"><font face="Courier New, Courier, mono" size="+1"><b>Journal Entry</b></font></td>
<td align="center" width="50%"><b> Welcome <?= $_SESSION['username'];?></b></td>
<td align="right"><div id="txt1"></div></td>
</tr>
<tr>
<td class="titletext" style=""> </td>
<td align="right" class="titletext" colspan="2">Time:<span id="txt"></span></td>
</tr>
</table>
</center>
</center>
<div class="clear"></div>
<br><?include_once('msgbox.php'); ?>
<form method="post" name='testform' action="" onsubmit="return validate();">
<center>
<table style="border-collapse: collapse;" width="50%" bgcolor="#f9f9f9" border="0" bordercolor="#cccccc" cellpadding="3" cellspacing="0">
<input type="hidden" name='type' id='type' value="Journal">
<tr>
<td width="50%" align="right"><b>Date:</b></td>
<td><input type="text" value="<?=$_POST['testinput']; ?>" name="testinput" readonly="readonly" onmouseover="myHint.show(0, this)" onmouseout="myHint.hide()" />
<script language="JavaScript">
new tcal ({
// form name
'formname': 'testform',
// input name
'controlname': 'testinput'
});
</script>
</a>
</td>
</tr>
</table></center>
<br><center>
<table style="border-collapse: collapse;" id="tblSample" width="95%" bgcolor="#f9f9f9" border="1" bordercolor="#cccccc" cellpadding="3" cellspacing="0" id="testtable">
<tr>
<td colspan="4"><center><span class="headingtext">Transactions</span></center></td>
</tr>
<tr>
<td class="tableheader">Account Description</td>
<td class="tableheader">Debit</td>
<td class="tableheader">Credit</td>
<td class="tableheader"> </td>
</tr>
<tr class="evenrow" id='tr3'>
<td align="center">
<select id="row[txt0][]" name="row[txt0][]" style="width:130px" onchange="return myPopup2();">
<? while($row=mysql_fetch_array($result)) { ?>
<option value="<?=$row['ledger_id']?>"><?=$row['ledgerName'];?></option>
<?}?>
<option value="2">Add New Ledger</option>
</select>
</td>
<td><input type="text" name="row[txt1][]" onKeyUp="this.value=check(this.value); emptyStr(this.parentNode.parentNode)" onBlur="emptyStr(this.parentNode.parentNode)" ></td>
<td><input type="text" name="row[txt2][]" onKeyUp="this.value=check(this.value); emptyStr(this.parentNode.parentNode)" onBlur="emptyStr(this.parentNode.parentNode)"></td>
<td><input type="button" name="added" value="add" onClick="(this.value=='add')?add( this.parentNode.parentNode ):ed(this);sumus(); " disabled="true">
<input type="button" value="del" onClick="ed(this); this.parentNode.parentNode.parentNode.deleteRow( this.parentNode.parentNode.rowIndex ); sumus();" disabled="true"></td>
</tr>
<tr>
<th>Total</th>
<td id="s1"></td>
<td id="s2"></td>
<td></td></tr></tbody></table>
</center>
</div><br><table align="center"><tbody><tr><td><b>Narration:</b></td>
<td>
<textarea cols="40" rows="3" name="narration" id='narration'><?=$_POST['narration']?></textarea></td>
</tr> <input type="hidden" name="counter" id="counter">
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</center>
<br><center><input onclick='return check1();' class="ajaxsubmit" name="Process" id="Process" value="Process Journal Entry" title="Process journal entry only if debits equal to credits" type="submit">
</center>
</form>
</div><br><div id="footer">
<? include_once('footer.html'); ?>
</body>
</html>