echo form_open('ledger/edit/' . $ledger_id); echo "<p>"; echo form_label('Ledger name', 'ledger_name'); echo "<br />"; echo form_input($ledger_name); echo "</p>"; echo "<p>"; echo form_label('Parent group', 'ledger_group_id'); echo "<br />"; echo form_dropdown('ledger_group_id', $ledger_group_id, $ledger_group_active); echo "</p>"; echo "<p>"; echo form_label('Opening balance', 'op_balance'); echo "<br />"; echo "<span id=\"tooltip-target-1\">"; echo form_dropdown_dc('op_balance_dc', $op_balance_dc); echo " "; echo form_input($op_balance); echo "</span>"; echo "<span id=\"tooltip-content-1\"> Assets / Expenses => Dr. Balance<br />Liabilities / Incomes => Cr. Balance</span>"; echo "</p>"; echo "<p>"; echo "<span id=\"tooltip-target-2\">"; echo form_checkbox('ledger_type_cashbank', 1, $ledger_type_cashbank) . " Bank or Cash Account"; echo "</span>"; echo "<span id=\"tooltip-content-2\">Select if Ledger account is a Bank account or a Cash account.</span>"; echo "</p>"; echo "<p>"; echo "<span id=\"tooltip-target-3\">"; echo form_checkbox('reconciliation', 1, $reconciliation) . " Reconciliation"; echo "</span>";
echo "<td>" . form_input($inventory_item_amount_item) . "</td>"; echo "<td>" . img(array('src' => asset_url() . "images/icons/add.png", 'border' => '0', 'alt' => 'Add Ledger', 'class' => 'addinventoryrow')) . "</td>"; echo "<td>" . img(array('src' => asset_url() . "images/icons/delete.png", 'border' => '0', 'alt' => 'Remove Ledger', 'class' => 'deleteinventoryrow')) . "</td>"; echo "<td class=\"inventory-item-balance\"><div></div></td>"; echo "</tr>"; } echo "</table>"; echo "<br />"; echo "<br />"; echo "<table class=\"entry-table\">"; echo "<thead><tr><th>Type</th><th>Ledger Account</th><th>Rate %</th><th>Amount</th><th colspan=2></th><th colspan=2>Cur Balance</th></tr></thead>"; foreach ($ledger_dc as $i => $ledger) { $rate_item_item = array('name' => 'rate_item[' . $i . ']', 'id' => 'rate_item[' . $i . ']', 'maxlength' => '5', 'size' => '5', 'value' => isset($rate_item[$i]) ? $rate_item[$i] : '', 'class' => 'rate-item'); $amount_item_item = array('name' => 'amount_item[' . $i . ']', 'id' => 'amount_item[' . $i . ']', 'maxlength' => '15', 'size' => '15', 'value' => isset($amount_item[$i]) ? $amount_item[$i] : '', 'class' => 'amount-item'); echo "<tr>"; echo "<td>" . form_dropdown_dc('ledger_dc[' . $i . ']', isset($ledger_dc[$i]) ? $ledger_dc[$i] : "D") . "</td>"; echo "<td>" . form_input_ledger('ledger_id[' . $i . ']', isset($ledger_id[$i]) ? $ledger_id[$i] : 0) . "</td>"; echo "<td>" . form_input($rate_item_item) . "</td>"; echo "<td>" . form_input($amount_item_item) . "</td>"; echo "<td>" . img(array('src' => asset_url() . "images/icons/add.png", 'border' => '0', 'alt' => 'Add Ledger', 'class' => 'addrow')) . "</td>"; echo "<td>" . img(array('src' => asset_url() . "images/icons/delete.png", 'border' => '0', 'alt' => 'Remove Ledger', 'class' => 'deleterow')) . "</td>"; echo "<td class=\"ledger-balance\"><div></div></td>"; echo "</tr>"; } echo "<tr><td colspan=\"7\"></td></tr>"; echo "<tr id=\"entry-total\"><td colspan=3><strong>Total</strong></td><td id=\"vr-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 "</table>"; echo "<p>"; echo form_label('Narration', 'entry_narration'); echo "<br />"; echo form_textarea($entry_narration);
function addrow($add_type = 'all') { $i = time() + rand(0, time()) + rand(0, time()) + rand(0, time()); $dr_amount = array('name' => 'dr_amount[' . $i . ']', 'id' => 'dr_amount[' . $i . ']', 'maxlength' => '15', 'size' => '15', 'value' => '', 'class' => 'dr-item', 'disabled' => 'disabled'); $cr_amount = array('name' => 'cr_amount[' . $i . ']', 'id' => 'cr_amount[' . $i . ']', 'maxlength' => '15', 'size' => '15', 'value' => '', 'class' => 'cr-item', 'disabled' => 'disabled'); echo '<tr class="new-row">'; echo '<td>'; echo form_dropdown_dc('ledger_dc[' . $i . ']'); echo '</td>'; echo '<td>'; if ($add_type == 'bankcash') { echo form_input_ledger('ledger_id[' . $i . ']', 0, '', $type = 'bankcash'); } else { if ($add_type == 'nobankcash') { echo form_input_ledger('ledger_id[' . $i . ']', 0, '', $type = 'nobankcash'); } else { echo form_input_ledger('ledger_id[' . $i . ']'); } } echo '</td>'; echo '<td>'; echo form_input($dr_amount); echo '</td>'; echo '<td>'; echo form_input($cr_amount); echo '</td>'; echo '<td>'; echo img(array('src' => asset_url() . "images/icons/add.png", 'border' => '0', 'alt' => 'Add Ledger', 'class' => 'addrow')); echo '</td>'; 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; }
function addrow() { $i = time() + rand(0, time()) + rand(0, time()) + rand(0, time()); $rate_item = array('name' => 'rate_item[' . $i . ']', 'id' => 'rate_item[' . $i . ']', 'maxlength' => '5', 'size' => '5', 'value' => isset($dr_amount[$i]) ? $dr_amount[$i] : "", 'class' => 'rate-item'); $amount_item = array('name' => 'amount_item[' . $i . ']', 'id' => 'amount_item[' . $i . ']', 'maxlength' => '15', 'size' => '15', 'value' => isset($cr_amount[$i]) ? $cr_amount[$i] : "", 'class' => 'amount-item'); echo '<tr class="new-row">'; echo "<td>" . form_dropdown_dc('ledger_dc[' . $i . ']', 'D') . "</td>"; echo "<td>" . form_input_ledger('ledger_id[' . $i . ']', '0') . "</td>"; echo "<td>" . form_input($rate_item) . "</td>"; echo "<td>" . form_input($amount_item) . "</td>"; echo "<td>" . img(array('src' => asset_url() . "images/icons/add.png", 'border' => '0', 'alt' => 'Add Ledger', 'class' => 'addrow')) . "</td>"; echo "<td>" . img(array('src' => asset_url() . "images/icons/delete.png", 'border' => '0', 'alt' => 'Remove Ledger', 'class' => 'deleterow')) . "</td>"; echo "<td class=\"ledger-balance\"><div></div></td>"; echo "</tr>"; return; }