<?php 

function create_invoice_cb() {
	$exclude = $temp = ["software_engineer", "admin", "super_admin", "admin_tech", "super_admin_tech", "unverified"];
	foreach ($temp as $key => $value) {
		$exclude[] = "All ".get_role_name($value)."(s)";
	}
	?>
	<div class="row">
		<div class="col-md-8 col-md-offset-2">
			<div class="card">
			    <div class="card-header">
			        <strong class="card-title">Enter Details of Invoice</strong>
			    </div>
			    <div class="card-body pt-4">
			      	<form id="create-invoice-form" method="post" action="contents/plugins/payment_module/ajax.php" data-clearform="true" data-callback="empty_tbody" data-callbackid="#items-table tbody">
			      			<div class="row">
			      				<div class="col-md-6">
			      					<?php 
			      						do_action("add_sms_list_to_form", ["id" => "receivers", "exclude" => $exclude]); 
			      					?>
			      				</div>
			      				<div class="col-md-6"><?php input(['label' => 'Due Date', 'id' => 'due_date', 'type' => 'date', 'required' => 'required']); ?></div>
			      			</div>
			      			<div class="row">
			      				<div class="col-md-12">
			      					<div class="table-responsive">
					      				<table class="table" id="items-table">
						      				<thead>
						      					<tr>
						      						<th style="max-width: 20px;">QTY</th>
						      						<th>DESCRIPTION</th>
						      						<th>UNIT PRICE</th>
						      						<th>QTY PRICE</th>
						      						<th>ACTION</th>
						      					</tr>
						      				</thead>
						      				<tbody></tbody>
						      				<tfoot>
						      					<tr>
						      						<td><input id="new-qty" style="max-width: 50px;" type="text" name="new[qty]" class="form-control numbers-only"></td>
						      						<td><textarea id="new-description" name="new[description]" class="form-control"></textarea></td>
						      						<td><input id="new-unit_price" type="text" name="new[unit_price]" class="form-control numbers-only"></td>
						      						<td id="new-qty_price"></td>
						      						<td><button class="btn btn-primary" id="add-btn" disabled>Add</button></td>
						      					</tr>
						      				</tfoot>
						      			</table>
					      			</div>
					      			<?php
					      			alert(); submit_btn("create_invoice", "Submit"); 
					      		?>
			      				</div>
			      			</div>
			      			
			      	</form>
			    </div>
			</div>
		</div>
	</div>
	<?php
	global $post_meta;
	add_page_javascript('app/elements/form.js');
	add_page_javascript('app/assets/js/page-scripts/submit.js');
	add_page_javascript('app/assets/js/page-scripts/koweb.js');
	add_page_javascript('contents/plugins/payment_module/js/create-invoice.js');
	do_action("pm_quick_menu");
}