ok dear friend this is the code
error 514 call_user_func_array(array(&$CI, &$method), $params);
add invoice.php
<div class="row">
<div class="col-md-12">
<div class="panel panel-primary" data-collapsed="0">
<div class="panel-heading">
<div class="panel-title" >
<i class="entypo-plus-circled"></i>
<?php echo get_phrase('add_invoice'); ?>
</div>
</div>
<div class="panel-body">
<?php echo form_open('index.php?accountant/invoice_add/create', array('class' => 'form-horizontal form-groups validate invoice-add', 'enctype' => 'multipart/form-data')); ?>
<div class="form-group">
<label for="field-1" class="col-sm-3 control-label"><?php echo get_phrase('invoice_title'); ?></label>
<div class="col-sm-5">
<input type="text" class="form-control" name="title" id="title" data-validate="required"
data-message-required="<?php echo get_phrase('value_required'); ?>" value="" autofocus>
</div>
</div>
<div class="form-group">
<label for="field-1" class="col-sm-3 control-label"><?php echo get_phrase('invoice_number'); ?></label>
<div class="col-sm-5">
<input type="text" class="form-control" name="invoice_number" value="<?php echo rand(10000, 100000); ?>" readonly>
</div>
</div>
<div class="form-group">
<label for="field-1" class="col-sm-3 control-label"><?php echo get_phrase('patient'); ?></label>
<div class="col-sm-5">
<select name="patient_id" class="select2">
<option><?php echo get_phrase('select_a_patient'); ?></option>
<?php
$patients = $this->db->get('patient')->result_array();
foreach ($patients as $row2):
?>
<option value="<?php echo $row2['patient_id']; ?>">
<?php echo $row2['name']; ?>
</option>
<?php endforeach; ?>
</select>
</div>
</div>
<div class="form-group">
<label for="field-1" class="col-sm-3 control-label"><?php echo get_phrase('creation_date'); ?></label>
<div class="col-sm-5">
<div class="input-group">
<span class="input-group-addon"><i class="entypo-calendar"></i></span>
<input type="text" class="form-control datepicker" name="creation_timestamp"
value="<?php echo date("m/d/Y"); ?>" >
</div>
</div>
</div>
<div class="form-group">
<label for="field-1" class="col-sm-3 control-label"><?php echo get_phrase('due_date'); ?></label>
<div class="col-sm-5">
<div class="input-group">
<span class="input-group-addon"><i class="entypo-calendar"></i></span>
<input type="text" class="form-control datepicker" name="due_timestamp"
value="" >
</div>
</div>
</div>
<div class="form-group">
<label for="field-1" class="col-sm-3 control-label"><?php echo get_phrase('vat_percentage'); ?></label>
<div class="col-sm-5">
<div class="input-group">
<span class="input-group-addon"><i class="entypo-info-circled"></i></span>
<input type="text" class="form-control" name="vat_percentage"
value="" >
</div>
</div>
</div>
<div class="form-group">
<label for="field-1" class="col-sm-3 control-label"><?php echo get_phrase('discount_amount'); ?></label>
<div class="col-sm-5">
<div class="input-group">
<span class="input-group-addon"><i class="entypo-info-circled"></i></span>
<input type="text" class="form-control" name="discount_amount"
value="" >
</div>
</div>
</div>
<div class="form-group">
<label for="field-1" class="col-sm-3 control-label"><?php echo get_phrase('payment_status'); ?></label>
<div class="col-sm-5">
<select name="status" class="selectboxit">
<option><?php echo get_phrase('select_a_status'); ?></option>
<option value="paid"><?php echo get_phrase('paid'); ?></option>
<option value="unpaid"><?php echo get_phrase('unpaid'); ?></option>
</select>
</div>
</div>
<hr>
<!-- FORM ENTRY STARTS HERE-->
<div id="invoice_entry">
<div class="form-group">
<label for="field-1" class="col-sm-3 control-label"><?php echo get_phrase('invoice_entry'); ?></label>
<div class="col-sm-5">
<input type="text" class="form-control" name="entry_description[]" value=""
placeholder="<?php echo get_phrase('description'); ?>" >
</div>
<div class="col-sm-2">
<input type="text" class="form-control" name="entry_amount[]" value=""
placeholder="<?php echo get_phrase('amount'); ?>" >
</div>
<div class="col-sm-2">
<button type="button" class="btn btn-default" onclick="deleteParentElement(this)">
<i class="entypo-trash"></i>
</button>
</div>
</div>
</div>
<!-- FORM ENTRY ENDS HERE-->
<div class="form-group">
<div class="col-sm-offset-3 col-sm-8">
<button type="button" class="btn btn-default btn-sm btn-icon icon-left"
onClick="add_entry()">
<?php echo get_phrase('add_invoice_entry'); ?>
<i class="entypo-plus"></i>
</button>
</div>
</div>
<hr>
<div class="form-group">
<div class="col-sm-offset-3 col-sm-8">
<button type="submit" name="submit" class="btn btn-info" id="submit-button">
<?php echo get_phrase('create_new_invoice'); ?></button>
<span id="preloader-form"></span>
</div>
</div>
<?php echo form_close(); ?>
</div>
</div>
</div>
</div>
<script>
// CREATING BLANK INVOICE ENTRY
var blank_invoice_entry = '';
$(document).ready(function () {
blank_invoice_entry = $('#invoice_entry').html();
});
function add_entry()
{
$("#invoice_entry").append(blank_invoice_entry);
}
// REMOVING INVOICE ENTRY
function deleteParentElement(n) {
n.parentNode.parentNode.parentNode.removeChild(n.parentNode.parentNode);
}
</script>
<div id="invoice_entry">
<div class="form-group">
<div id="form_element"></div>
<div class="col-sm-2">
<button type="button" class="btn btn-default" onclick="deleteParentElement(this)">
<i class="entypo-trash"></i>
</button>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<?php echo form_open('index.php?accountant/invoice_add/create', array('class' => 'form-horizontal form-groups validate invoice-add', 'enctype' => 'multipart/form-data')); ?>
<div class="form-group">
<label for="field-1" class="col-sm-3 control-label"><?php echo get_phrase('type'); ?></label>
<div class="col-sm-3">
<select name="type" class="form-control" id="element_type">
<option value="text"><?php echo get_phrase('text'); ?></option>
<option value="textarea"><?php echo get_phrase('textarea'); ?></option>
</select>
</div>
<div class="col-sm-3">
<button type="button" class="btn btn-info"
onClick="add_entry()">
<?php echo get_phrase('add_form_element'); ?>
<i class="entypo-plus"></i>
</button>
</div>
</div>
<?php echo form_close(); ?>
</div>
</div>
<script>
// CREATING BLANK INVOICE ENTRY
var blank_invoice_entry = '';
$(document).ready(function () {
blank_invoice_entry = $('#invoice_entry').html();
$('#invoice_entry').remove();
});
function add_entry()
{
var element_type = document.getElementById("element_type").value;
$.ajax({
url: '<?php echo base_url(); ?>index.php?accountant/get_form_element/' + element_type,
success: function (response)
{
//jQuery('.main_data').html(response);
//document.write(response);
$("#form_element").append(response);
}
});
}
// REMOVING INVOICE ENTRY
function deleteParentElement(n) {
n.parentNode.parentNode.parentNode.removeChild(n.parentNode.parentNode);
}
</script>
form_create.php
<span class="main_data">
<?php include 'add_invoice.php'; ?>
</span>
Attached Files
CodeIgniter.php (Size: 15.24 KB / Downloads: 185)