<?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>Facture</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>Effectue avec succes! </strong><?php echo $message; ?>
</div>
<?php } ?>
<!--Start Panel-->
<div class="panel panel-default invoice-panel">
    <!-- Default panel contents -->
    <div class="panel-heading">Facture<div class="add-button">
    <button class="print-btn btn-primary" id="print-invoice" type="button">Imprimer</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>No de la facture : <span class="invoice-value"><?php echo $invoice->id+1000; ?></span></p>
		<p>Code d'envoi : <span class="invoice-value"><?php echo $invoice->sending_code; ?></span></p>
		<p>Date de paiment : <span class="invoice-value"><?php echo $invoice->paying_date; ?></span></p>
		<p>Emetteur : <span class="invoice-value"><?php echo $invoice->sender_fullname; ?></span></p>
		<p>Telephone de l'emetteur : <span class="invoice-value"><?php echo $invoice->sender_phone; ?></span></p>
	
		<div class="border-bottom-dashed"></div>
		
		<p>Beneficiaire : <span class="invoice-value"><?php echo $invoice->recipent_fullname; ?></span></p>
		<p>Telephone du beneficiaire : <span class="invoice-value"><?php echo $invoice->Recipient_Phone; ?></span></p>
		<p>CNI du beneficiaire : <span class="invoice-value"><?php echo $invoice->Recipient_CNI; ?></span></p>
		
		<div class="border-bottom-dashed"></div>
		<p>MONTANT A PAYER : <span class="invoice-value"><?php echo decimalplace($invoice->payable_amount); ?></span></p>
		<p>EN LETTRE : <span class="invoice-value"><?php echo ucwords(convert_number_to_words($invoice->payable_amount))." OUGUIYA"; ?></span></p>
		
		<div class="left-signature">Signature du beneficiaire</div>
		<div class="right-signature">Signature de l'operateur</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>
