} if (!$print_preview) { echo form_open('report/reconciliation/' . $reconciliation_type . '/' . $ledger_id . "/" . $page_count); } echo "<table border=0 cellpadding=5 class=\"simple-table reconciliation-table\">"; echo "<thead><tr><th>Date</th><th>No.</th><th>Ledger Name</th><th>Type</th><th>Dr Amount</th><th>Cr Amount</th><th>Reconciliation Date</th></tr></thead>"; $odd_even = "odd"; foreach ($ledgerst_q->result() as $row) { $current_entry_type = entry_type_info($row->entries_entry_type); echo "<tr class=\"tr-" . $odd_even; if ($row->entry_items_reconciliation_date) { echo " tr-reconciled"; } echo "\">"; echo "<td>"; echo date_mysql_to_php_display($row->entries_date); echo "</td>"; echo "<td>"; echo anchor('entry/view/' . $current_entry_type['label'] . '/' . $row->entries_id, full_entry_number($row->entries_entry_type, $row->entries_number), array('title' => 'View ' . $current_entry_type['name'] . ' Entry', 'class' => 'anchor-link-a')); echo "</td>"; /* Getting opposite Ledger name */ echo "<td>"; echo $this->Ledger_model->get_opp_ledger_name($row->entries_id, $row->entries_entry_type, $row->entry_items_dc, 'html'); if ($row->entries_narration) { echo "<div class=\"small-font\">" . character_limiter($row->entries_narration, 50) . "</div>"; } echo "</td>"; echo "<td>"; echo $current_entry_type['name']; echo "</td>"; if ($row->entry_items_dc == "D") {
echo $current_entry_type['name']; ?> Entry</span></div> <br /> <div id="print-entry-number"><?php echo $current_entry_type['name']; ?> Entry Number : <span class="value"><?php echo full_entry_number($entry_type_id, $cur_entry->number); ?> </span></div> <div id="print-entry-number"><?php echo $current_entry_type['name']; ?> Entry Date : <span class="value"><?php echo date_mysql_to_php_display($cur_entry->date); ?> </span></div> <br /> <table class="print-entry-table"> <tr> <td align=\"right\"> <?php if ($current_entry_type['inventory_entry_type'] == '1') { echo "Purchase Ledger :"; } else { echo "Sale Ledger :"; } ?> </td>
echo anchor('user/profile', 'Profile', array('title' => "Profile", 'class' => 'anchor-link-b')); echo " | "; echo anchor('user/logout', 'Logout', array('title' => "Logout", 'class' => 'anchor-link-b')); echo "</div>"; } ?> <div id="info"> <?php echo $this->config->item('account_name'); echo " ("; echo anchor('user/account', 'change', array('title' => 'Change active account', 'class' => 'anchor-link-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')); ?> </div> </div> <div id="menu"> <ul class="sf-menu"> <li class="current"> <a href="<?php print base_url(); ?> " title="Dashboard">Dashboard</a> </li> <li> <?php echo anchor('account', 'Accounts', array('title' => 'Chart of accounts')); ?>
function email($entry_type, $entry_id = 0) { $this->load->model('Setting_model'); $this->load->model('Ledger_model'); $this->load->library('email'); /* Check access */ if (!check_access('email entry')) { $this->messages->add('Permission denied.', 'error'); redirect('entry/show/' . $entry_type); return; } /* Entry Type */ $entry_type_id = entry_type_name_to_id($entry_type); if (!$entry_type_id) { $this->messages->add('Invalid Entry type.', 'error'); redirect('entry/show/all'); return; } else { $current_entry_type = entry_type_info($entry_type_id); } $account_data = $this->Setting_model->get_current(); /* Load current entry details */ if (!($cur_entry = $this->Entry_model->get_entry($entry_id, $entry_type_id))) { $this->messages->add('Invalid Entry.', 'error'); redirect('entry/show/' . $current_entry_type['label']); return; } $data['entry_type_id'] = $entry_type_id; $data['current_entry_type'] = $current_entry_type; $data['entry_id'] = $entry_id; $data['entry_number'] = $cur_entry->number; $data['email_to'] = array('name' => 'email_to', 'id' => 'email_to', 'size' => '40', 'value' => ''); /* Form validations */ $this->form_validation->set_rules('email_to', 'Email to', 'trim|valid_emails|required'); /* Repopulating form */ if ($_POST) { $data['email_to']['value'] = $this->input->post('email_to', TRUE); } if ($this->form_validation->run() == FALSE) { $data['error'] = validation_errors(); $this->load->view('entry/email', $data); return; } else { $entry_data['entry_type_id'] = $entry_type_id; $entry_data['current_entry_type'] = $current_entry_type; $entry_data['entry_number'] = $cur_entry->number; $entry_data['entry_date'] = date_mysql_to_php_display($cur_entry->date); $entry_data['entry_dr_total'] = $cur_entry->dr_total; $entry_data['entry_cr_total'] = $cur_entry->cr_total; $entry_data['entry_narration'] = $cur_entry->narration; /* Getting Ledger details */ $this->db->from('entry_items')->where('entry_id', $entry_id)->order_by('dc', 'desc'); $ledger_q = $this->db->get(); $counter = 0; $entry_data['ledger_data'] = array(); if ($ledger_q->num_rows() > 0) { foreach ($ledger_q->result() as $row) { $entry_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++; } } /* Preparing message */ $message = $this->load->view('entry/emailpreview', $entry_data, TRUE); /* Getting email configuration */ $config['smtp_timeout'] = '30'; $config['charset'] = 'utf-8'; $config['newline'] = "\r\n"; $config['mailtype'] = "html"; if ($account_data) { $config['protocol'] = $account_data->email_protocol; $config['smtp_host'] = $account_data->email_host; $config['smtp_port'] = $account_data->email_port; $config['smtp_user'] = $account_data->email_username; $config['smtp_pass'] = $account_data->email_password; } else { $data['error'] = 'Invalid account settings.'; } $this->email->initialize($config); /* Sending email */ $this->email->from('', 'Webzash'); $this->email->to($this->input->post('email_to', TRUE)); $this->email->subject($current_entry_type['name'] . ' Entry No. ' . full_entry_number($entry_type_id, $cur_entry->number)); $this->email->message($message); if ($this->email->send()) { $data['message'] = "Email sent."; $this->logger->write_message("success", "Emailed " . $current_entry_type['name'] . " Entry number " . full_entry_number($entry_type_id, $cur_entry->number) . " [id:" . $entry_id . "]"); } else { $data['error'] = "Error sending email. Check you email settings."; $this->logger->write_message("error", "Error emailing " . $current_entry_type['name'] . " Entry number " . full_entry_number($entry_type_id, $cur_entry->number) . " [id:" . $entry_id . "]"); } $this->load->view('entry/email', $data); return; } return; }
<?php $this->db->from('logs')->order_by('id', 'desc'); $logs_q = $this->db->get(); echo "<table border=0 class=\"simple-table\">"; echo "<thead><tr><th width=\"90\">Date</th><th>Host IP</th><th>User</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->user . "</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, 30) . "</td>"; echo "</tr>"; } echo "</table>";
<?php echo form_open('update/index'); echo "<p>"; echo "Required database version : " . "<strong>" . $this->config->item('required_database_version') . "</strong><br />"; echo "Current database version : " . "<strong>" . $account->database_version . "</strong><br />"; echo "</p>"; echo "<p>"; echo "<strong><u>Account Information:</u></strong>" . "<br />"; echo " <strong>Account Label:</strong> " . $this->session->userdata('active_account') . "<br />"; echo " <strong>Account Name:</strong> " . $account->name . "<br />"; echo " <strong>Financial Year Start:</strong> " . date_mysql_to_php_display($account->fy_start) . "<br />"; echo " <strong>Financial Year End:</strong> " . date_mysql_to_php_display($account->fy_end) . "<br />"; echo "</p>"; if ($this->config->item('required_database_version') > $account->database_version) { echo "<p>"; echo "<span class=\"form-warning-text\"><h3>Warning: This process will change your database structure.\n\t\tIt is important to take backup of your current database before continuing, so that you can recover incase of emergency.\n\t\tWithout taking any backups you risk to loose all your data if this process fails.</h3></span>"; echo "</p>"; echo "<p>"; echo form_submit('submit', 'Update'); echo " "; echo anchor('user/account', 'Back', 'Back to account selection'); echo "</p>"; } else { echo "<p>"; echo "<span class=\"form-warning-text\"><h3>Datebase version is already upto date.</h3></span>"; echo "</p>"; echo "<p>"; echo anchor('user/account', 'Back', 'Back to account selection'); echo "</p>"; }
$cur_quantity -= $row->inventory_entry_items_quantity; $cur_rate -= $row->inventory_entry_items_rate_per_unit; $cur_value -= $row->inventory_entry_items_total; } } /* Show relative opening balance */ echo "<tr class=\"tr-balance\"><td colspan=4>Opening Inventory</td><td>" . $cur_quantity . "</td><td>" . convert_cur($cur_rate) . "</td><td>" . convert_cur($cur_value) . "</td><td></td><td></td><td></td></tr>"; } foreach ($inventory_entry_items_q->result() as $row) { $this->db->from('entries')->where('id', $row->entry_id)->limit(1); $entries_q = $this->db->get(); $entries_data = $entries_q->row(); $current_entry_type = entry_type_info($entries_data->entry_type); echo "<tr class=\"tr-" . $odd_even . "\">"; echo "<td>"; echo date_mysql_to_php_display($entries_data->date); echo "</td>"; echo "<td>"; if ($current_entry_type['inventory_entry_type'] == 3) { echo anchor('inventory/transfer/view/' . $current_entry_type['label'] . '/' . $entries_data->id, full_entry_number($entries_data->entry_type, $entries_data->number), array('title' => 'View ' . ' Entry', 'class' => 'anchor-link-a')); } else { echo anchor('inventory/entry/view/' . $current_entry_type['label'] . '/' . $entries_data->id, full_entry_number($entries_data->entry_type, $entries_data->number), array('title' => 'View ' . ' Entry', 'class' => 'anchor-link-a')); } echo "</td>"; /* Getting opposite Ledger name */ echo "<td>"; echo $this->Ledger_model->get_entry_name($entries_data->id, $entries_data->entry_type); echo "</td>"; echo "<td>"; echo $current_entry_type['name']; echo "</td>";