<?php $this->load->view('theme/include/header'); ?>

<!--Start Main Content-->
<section>
<div class="main-content">
<div class="row">
<div class="inner-contatier">    
<div class="col-md-12 col-lg-12 col-sm-12 content-title"><h4>Invoice</h4></div>
<div class="col-sm-12">
<?php
$message = $this->session->userdata('success');
if ($message) {
?>
<!-- Alert Box -->
<div class="alert my-alert alert-success">
    <a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
    <strong>Success! </strong><?php echo $message; ?>
</div>
<?php } ?>
<!--Start Panel-->
<div class="panel panel-default invoice-panel">
    <!-- Default panel contents -->
    <div class="panel-heading">Invoice<div class="add-button">
    <button class="print-btn btn-primary" id="print-invoice" type="button">Print</button>
    </div></div>
    <div class="panel-body">
	<div id="invoice">
		<h4><?php echo get_current_setting('company_name'); ?></h4>
		<p class="heading"><?php echo get_current_setting('company_description'); ?></p>
		<p class="heading"><?php echo get_current_setting('company_address'); ?></p>
		<p class="heading">Tel: <?php echo get_current_setting('company_phone'); ?></p>
		<img style="float:right; margin-top:-115px" 
		src="<?php echo base_url() ?>assets/images/logo.png">
		
		<h3 align="center"><?php echo get_current_setting('office_name'); ?></h3>
		
		<div class="invoice-body">
		<p>Invoice No : <span class="invoice-value"><?php echo $invoice->id+1000; ?></span></p>
		<p>Sending Code : <span class="invoice-value"><?php echo $invoice->sending_code; ?></span></p>
		<p>Sending Date : <span class="invoice-value"><?php echo $invoice->sending_date; ?></span></p>
		<p>Sender's name : <span class="invoice-value"><?php echo $invoice->sender_fullname; ?></span></p>
		<p>Sender's Telephone : <span class="invoice-value"><?php echo $invoice->telephone; ?></span></p>
		<p>Sender's CNI : <span class="invoice-value"><?php echo $invoice->sender_passport; ?></span></p>
		
		<div class="border-bottom-dashed"></div>
		
		<p>Recipient's name : <span class="invoice-value"><?php echo $invoice->recipent_fullname; ?></span></p>
		<p>Recipient's Telephone : <span class="invoice-value"><?php echo $invoice->recipent_phone; ?></span></p>
		<p>Recipient's CNI : <span class="invoice-value"><?php echo $invoice->recipent_CNI; ?></span></p>
		
		<div class="border-bottom-dashed"></div>
		<p>Send Amount : <span class="invoice-value"><?php echo decimalplace($invoice->sending_amount); ?></span></p>
		<p>In letters : <span class="invoice-value"><?php echo ucwords(convert_number_to_words($invoice->sending_amount))." OUGUIYA"; ?></span></p>
		
		<div class="left-signature">Sender Signature</div>
		<div class="right-signature">Operator Signature</div>
		
		</div><!--End Invoice Body Div-->
		
    </div><!--End Invoice Div-->
	</div><!--End Panel Body-->
    
</div>
<!--End Panel-->       
</div>
    

    

</div><!--End Inner container--->
</div><!--End Row-->
</div><!--End Main-content DIV-->
</section><!--End Main-content Section-->

<?php $this->load->view('theme/include/footer'); ?>

<script type="text/javascript">
$(document).ready(function() {
 

$(document).on('click','#print-invoice',function(){
$.print("#invoice");
});


});

</script>
</body>

</html>
