<?php $this->load->model('Ledger_model'); if (!$print_preview) { echo form_open('report/reconciliation/' . $reconciliation_type . '/' . $ledger_id); echo "<p>"; echo form_input_ledger('ledger_id', $ledger_id, '', $type = 'reconciliation'); echo "</p>"; echo "<p>"; echo form_checkbox('show_all', 1, $show_all) . " Show All Entries"; echo "</p>"; echo "<p>"; echo form_submit('submit', 'Submit'); echo "</p>"; echo form_close(); } /* Pagination configuration */ if (!$print_preview) { $pagination_counter = $this->config->item('row_count'); $page_count = (int) $this->uri->segment(5); $page_count = $this->input->xss_clean($page_count); if (!$page_count) { $page_count = "0"; } $config['base_url'] = site_url('report/reconciliation/' . $reconciliation_type . '/' . $ledger_id); $config['num_links'] = 10; $config['per_page'] = $pagination_counter; $config['uri_segment'] = 5; if ($reconciliation_type == 'all') { $config['total_rows'] = (int) $this->db->from('entries')->join('entry_items', 'entries.id = entry_items.entry_id')->where('entry_items.ledger_id', $ledger_id)->count_all_results(); } else {
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; }
<?php $this->load->model('Ledger_model'); 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 */ 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'] = (int) $this->db->from('entries')->join('entry_items', 'entries.id = entry_items.entry_id')->where('entry_items.ledger_id', $ledger_id)->count_all_results(); $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>';
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); echo "</p>";
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; }