Example #1
0
		  <div class="panel-body">
			<?php 
$accounts = new accounts();
$bank = new bank();
$bank_result = $bank->get_banks();
$ID = isset($_GET['id']) ? $_GET['id'] : NULL;
if (isset($_POST['add_assets'])) {
    $type = $_POST['assets_type'];
    $amount = $_POST['assets_amount'];
    $payment_mode = $_POST['assets_payment_mode'];
    $bank = $_POST['bank_name'];
    $due_date = $_POST['due_date'];
    $detail = $_POST['assets_detail'];
    // Update old record
    if (isset($ID)) {
        $results = $accounts->update_assets($type, $amount, $payment_mode, $bank, $due_date, $detail, $ID);
    } else {
        // Insert new
        $results = $accounts->create_assets($type, $amount, $payment_mode, $bank, $due_date, $detail);
    }
    if ($results) {
        echo '<div class="alert alert-success" role="alert"> Add Assets Sucessfully </div>';
    } else {
        echo '<div class="alert alert-danger" role="alert"> Error </div>';
    }
}
if (isset($ID)) {
    $assets_result = $accounts->get_assets($ID);
}
?>
			<div class="the-box noborder">