Add profile image to beneficiary images

This commit is contained in:
Djery-Tom 2022-05-05 10:01:27 +01:00
parent 06d52089f1
commit 71f4bb2b19
7 changed files with 115 additions and 240 deletions

View File

@ -408,8 +408,8 @@ class Hyperviseur_dash extends CI_Controller
$data['user'] = $this->db->get_where('user_infos',['user_id' => $data['insurance']->user_id ?? null])->first_row();
$data['payments'] = $this->nano_health_model->getInsurancePaymentTransactions($data['insurance']->id ?? null);
// Le montant payé de toutes les factures de l'assurance
$data['insurance_invoices_total_paid_amount'] = $this->nano_health_model->getInsuranceInvoiceTotalPaidAmount($data['insurance']->id ?? null) ?? 0;
$data['insurance_invoices_total_amount'] = $this->nano_health_model->getInsuranceInvoiceTotalAmount($data['insurance']->id ?? null) ?? 0;
$data['insurance_invoices_total_paid_amount'] = $this->nano_health_model->getInsuranceInvoiceTotalPaidAmount($data['insurance']->id ?? null);
$data['insurance_invoices_total_amount'] = $this->nano_health_model->getInsuranceInvoiceTotalAmount($data['insurance']->id ?? null);
$data['invoices'] = $this->nano_health_model->getInsuranceInvoices($this->input->get('id'));
$data['deletion_of_beneficiaries'] = $this->nano_health_model->getBeneficiariesDeletionHistory($data['insurance']->id ?? null);

View File

@ -942,4 +942,7 @@ $lang['billed_quantity'] = "Billed quantity";
$lang['ceiling'] = "Ceiling";
$lang['note_config_wallet_agent_remove_cash'] = "The hypervisor's commission is the amount remaining in the client's commission once the agent's and supervisor's commissions are removed";
$lang['UNPAID'] = "Unpaid";
$lang['UNDER_RENEW'] = "Under renew";
$lang['STOPPED'] = "Stopped";
$lang['profile_image'] = "Profile image";
?>

View File

@ -951,4 +951,7 @@ $lang['billed_quantity'] = "Quantité facturée";
$lang['ceiling'] = "Plafond";
$lang['note_config_wallet_agent_remove_cash'] = "La commission de l'hyperviseur est le montant restant de la commission client une fois qu'on a retiré les commissions de l'agent et du superviseur";
$lang['UNPAID'] = "Non Payée";
$lang['UNDER_RENEW'] = "En cours de renouvellement";
$lang['STOPPED'] = "Arretée";
$lang['profile_image'] = "Photo de profil";
?>

View File

@ -84,16 +84,19 @@ class Nano_health_model extends CI_Model
}
public function getInsuranceInvoiceTotalPaidAmount($insuredId){
return $this->db->select('SUM(p.amount) as total_paid_amount')
$amount = $this->db->select('SUM(p.amount) as total_paid_amount')
->from('nh_insurances_invoices i')->join('nh_insurances in', 'in.id = i.insurance_id')
->join('nh_insurances_payments p', 'i.id = p.invoice_id')
->where('i.insurance_id',$insuredId)->group_by('i.id')->get()->row_array()['total_paid_amount'];
->where('i.insurance_id',$insuredId)->group_by('i.id')->get()->row_array();
return isset($amount) ? $amount['total_paid_amount'] : 0;
}
public function getInsuranceInvoiceTotalAmount($insuredId){
return $this->db->select('SUM(i.amount) as total_amount')
$amount = $this->db->select('SUM(i.amount) as total_amount')
->from('nh_insurances_invoices i')->join('nh_insurances in', 'in.id = i.insurance_id')
->where('i.insurance_id',$insuredId)->group_by('i.id')->get()->row_array()['total_amount'];
->where('i.insurance_id',$insuredId)->group_by('i.id')->get()->row_array();
return isset($amount) ? $amount['total_amount'] : 0;
}
public function getSubscriptionBeneficiaries($subscriptionId){

View File

@ -244,84 +244,7 @@
</button>
</td>
</tr>
<div class="modal fade" id="<?= 'images-modal'.$i ?>">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<h3 class="modal-title">Images des documents</h3>
</div>
<div class="modal-body">
<?php if($row->affiliation == 'CHILD') {
$birthdate_proof_doc = NANO_SANTE_SERVICE_URL . '/insurances-subscriptions-docs/'.$row->birthdate_proof_doc;
$birthdate_proof_doc_file = @fopen($birthdate_proof_doc ,'r');
$justice_doc = NANO_SANTE_SERVICE_URL . '/insurances-subscriptions-docs/'.$row->justice_doc;
$justice_doc_file = @fopen($justice_doc ,'r');
?>
<div class="row" style="margin-top: 10px">
<div class="col-sm-6 text-center">
<label><?= $this->lang->line('birthdate_proof_doc') ?></label>
<img src="<?= $birthdate_proof_doc_file ? $birthdate_proof_doc : base_url('images/broken.png') ?>"
alt="document_front" style="width: 100%;"/>
</div>
<div class="col-sm-6 text-center">
<label><?= $this->lang->line('justice_doc') ?></label>
<img src="<?= $justice_doc_file ? $justice_doc : base_url('images/broken.png')?>"
alt="document_back" style="width: 100%;"/>
</div>
</div>
<?php } else {
$marriage_certificate_doc = NANO_SANTE_SERVICE_URL . '/insurances-subscriptions-docs/'.$row->marriage_certificate_doc;
$marriage_certificate_doc_file = @fopen($marriage_certificate_doc,'r');
$id_document_front = NANO_SANTE_SERVICE_URL . '/insurances-subscriptions-docs/'.$row->id_document_front;
$id_document_front_file = @fopen($id_document_front ,'r');
$id_document_back = NANO_SANTE_SERVICE_URL . '/insurances-subscriptions-docs/'.$row->id_document_back;
$id_document_back_file = @fopen($id_document_front ,'r');
?>
<div class="row text-center" style="justify-content: center; display: flex;">
<div class="col-sm-6">
<label><?= $this->lang->line('marriage_certificate_doc') ?></label>
<div>
<img src="<?= $marriage_certificate_doc_file ? $marriage_certificate_doc : base_url('images/broken.png') ?>"
alt="user_image" width="100%"/>
</div>
</div>
</div>
<div class="row" style="margin-top: 10px">
<div class="col-sm-6 text-center">
<label><?= $this->lang->line('id_document_image_front') ?></label>
<img src="<?= $id_document_front_file ? $id_document_front : base_url('images/broken.png') ?>"
alt="document_front" style="width: 100%;"/>
</div>
<div class="col-sm-6 text-center">
<label><?= $this->lang->line('id_document_image_back') ?></label>
<img src="<?= $id_document_back_file ? $id_document_back : base_url('images/broken.png')?>"
alt="document_back" style="width: 100%;"/>
</div>
</div>
<?php } ?>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal"><?= $this->lang->line('Fermer'); ?></button>
</div>
</div>
</div>
</div>
<?php $this->load->view('nano_health/modals/beneficiary_images_modal',['i' => $i, 'row' => $row]) ?>
<?php
}
}
@ -451,84 +374,7 @@
</button>
</td>
</tr>
<div class="modal fade" id="<?= 'images-modal'.$i ?>">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<h3 class="modal-title">Images des documents</h3>
</div>
<div class="modal-body">
<?php if($row->affiliation == 'CHILD') {
$birthdate_proof_doc = NANO_SANTE_SERVICE_URL . '/insurances-subscriptions-docs/'.$row->birthdate_proof_doc;
$birthdate_proof_doc_file = @fopen($birthdate_proof_doc ,'r');
$justice_doc = NANO_SANTE_SERVICE_URL . '/insurances-subscriptions-docs/'.$row->justice_doc;
$justice_doc_file = @fopen($justice_doc ,'r');
?>
<div class="row" style="margin-top: 10px">
<div class="col-sm-6 text-center">
<label><?= $this->lang->line('birthdate_proof_doc') ?></label>
<img src="<?= $birthdate_proof_doc_file ? $birthdate_proof_doc : base_url('images/broken.png') ?>"
alt="document_front" style="width: 100%;"/>
</div>
<div class="col-sm-6 text-center">
<label><?= $this->lang->line('justice_doc') ?></label>
<img src="<?= $justice_doc_file ? $justice_doc : base_url('images/broken.png')?>"
alt="document_back" style="width: 100%;"/>
</div>
</div>
<?php } else {
$marriage_certificate_doc = NANO_SANTE_SERVICE_URL . '/insurances-subscriptions-docs/'.$row->marriage_certificate_doc;
$marriage_certificate_doc_file = @fopen($marriage_certificate_doc,'r');
$id_document_front = NANO_SANTE_SERVICE_URL . '/insurances-subscriptions-docs/'.$row->id_document_front;
$id_document_front_file = @fopen($id_document_front ,'r');
$id_document_back = NANO_SANTE_SERVICE_URL . '/insurances-subscriptions-docs/'.$row->id_document_back;
$id_document_back_file = @fopen($id_document_front ,'r');
?>
<div class="row text-center" style="justify-content: center; display: flex;">
<div class="col-sm-6">
<label><?= $this->lang->line('marriage_certificate_doc') ?></label>
<div>
<img src="<?= $marriage_certificate_doc_file ? $marriage_certificate_doc : base_url('images/broken.png') ?>"
alt="user_image" width="100%"/>
</div>
</div>
</div>
<div class="row" style="margin-top: 10px">
<div class="col-sm-6 text-center">
<label><?= $this->lang->line('id_document_image_front') ?></label>
<img src="<?= $id_document_front_file ? $id_document_front : base_url('images/broken.png') ?>"
alt="document_front" style="width: 100%;"/>
</div>
<div class="col-sm-6 text-center">
<label><?= $this->lang->line('id_document_image_back') ?></label>
<img src="<?= $id_document_back_file ? $id_document_back : base_url('images/broken.png')?>"
alt="document_back" style="width: 100%;"/>
</div>
</div>
<?php } ?>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal"><?= $this->lang->line('Fermer'); ?></button>
</div>
</div>
</div>
</div>
<?php $this->load->view('nano_health/modals/beneficiary_images_modal',['i' => $i, 'row' => $row]) ?>
<?php
}
}

View File

@ -252,84 +252,7 @@
</button>
</td>
</tr>
<div class="modal fade" id="<?= 'images-modal'.$i ?>">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<h3 class="modal-title">Images des documents</h3>
</div>
<div class="modal-body">
<?php if($row->affiliation == 'CHILD') {
$birthdate_proof_doc = NANO_SANTE_SERVICE_URL . '/insurances-subscriptions-docs/'.$row->birthdate_proof_doc;
$birthdate_proof_doc_file = @fopen($birthdate_proof_doc ,'r');
$justice_doc = NANO_SANTE_SERVICE_URL . '/insurances-subscriptions-docs/'.$row->justice_doc;
$justice_doc_file = @fopen($justice_doc ,'r');
?>
<div class="row" style="margin-top: 10px">
<div class="col-sm-6 text-center">
<label><?= $this->lang->line('birthdate_proof_doc') ?></label>
<img src="<?= $birthdate_proof_doc_file ? $birthdate_proof_doc : base_url('images/broken.png') ?>"
alt="document_front" style="width: 100%;"/>
</div>
<div class="col-sm-6 text-center">
<label><?= $this->lang->line('justice_doc') ?></label>
<img src="<?= $justice_doc_file ? $justice_doc : base_url('images/broken.png')?>"
alt="document_back" style="width: 100%;"/>
</div>
</div>
<?php } else {
$marriage_certificate_doc = NANO_SANTE_SERVICE_URL . '/insurances-subscriptions-docs/'.$row->marriage_certificate_doc;
$marriage_certificate_doc_file = @fopen($marriage_certificate_doc,'r');
$id_document_front = NANO_SANTE_SERVICE_URL . '/insurances-subscriptions-docs/'.$row->id_document_front;
$id_document_front_file = @fopen($id_document_front ,'r');
$id_document_back = NANO_SANTE_SERVICE_URL . '/insurances-subscriptions-docs/'.$row->id_document_back;
$id_document_back_file = @fopen($id_document_front ,'r');
?>
<div class="row text-center" style="justify-content: center; display: flex;">
<div class="col-sm-6">
<label><?= $this->lang->line('marriage_certificate_doc') ?></label>
<div>
<img src="<?= $marriage_certificate_doc_file ? $marriage_certificate_doc : base_url('images/broken.png') ?>"
alt="user_image" width="100%"/>
</div>
</div>
</div>
<div class="row" style="margin-top: 10px">
<div class="col-sm-6 text-center">
<label><?= $this->lang->line('id_document_image_front') ?></label>
<img src="<?= $id_document_front_file ? $id_document_front : base_url('images/broken.png') ?>"
alt="document_front" style="width: 100%;"/>
</div>
<div class="col-sm-6 text-center">
<label><?= $this->lang->line('id_document_image_back') ?></label>
<img src="<?= $id_document_back_file ? $id_document_back : base_url('images/broken.png')?>"
alt="document_back" style="width: 100%;"/>
</div>
</div>
<?php } ?>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal"><?= $this->lang->line('Fermer'); ?></button>
</div>
</div>
</div>
</div>
<?php $this->load->view('nano_health/modals/beneficiary_images_modal',['i' => $i, 'row' => $row]) ?>
<?php
}
}

View File

@ -0,0 +1,97 @@
<div class="modal fade" id="<?= 'images-modal'.$i ?>">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<h3 class="modal-title">Images des documents</h3>
</div>
<div class="modal-body">
<?php
$profile_image = NANO_SANTE_SERVICE_URL . '/insurances-subscriptions-docs/'.$row->profile_image;
$profile_image_file = @fopen($profile_image,'r');
if($row->affiliation == 'CHILD') {
$birthdate_proof_doc = NANO_SANTE_SERVICE_URL . '/insurances-subscriptions-docs/'.$row->birthdate_proof_doc;
$birthdate_proof_doc_file = @fopen($birthdate_proof_doc ,'r');
$justice_doc = NANO_SANTE_SERVICE_URL . '/insurances-subscriptions-docs/'.$row->justice_doc;
$justice_doc_file = @fopen($justice_doc ,'r');
?>
<div class="row text-center" style="justify-content: center; display: flex;">
<div class="col-sm-6">
<label><?= $this->lang->line('profile_image') ?></label>
<div>
<img src="<?= $profile_image_file ? $profile_image : base_url('images/broken.png') ?>"
alt="user_image" width="100%"/>
</div>
</div>
</div>
<div class="row" style="margin-top: 10px">
<div class="col-sm-6 text-center">
<label><?= $this->lang->line('birthdate_proof_doc') ?></label>
<img src="<?= $birthdate_proof_doc_file ? $birthdate_proof_doc : base_url('images/broken.png') ?>"
alt="document_front" style="width: 100%;"/>
</div>
<div class="col-sm-6 text-center">
<label><?= $this->lang->line('justice_doc') ?></label>
<img src="<?= $justice_doc_file ? $justice_doc : base_url('images/broken.png')?>"
alt="document_back" style="width: 100%;"/>
</div>
</div>
<?php } else {
$marriage_certificate_doc = NANO_SANTE_SERVICE_URL . '/insurances-subscriptions-docs/'.$row->marriage_certificate_doc;
$marriage_certificate_doc_file = @fopen($marriage_certificate_doc,'r');
$id_document_front = NANO_SANTE_SERVICE_URL . '/insurances-subscriptions-docs/'.$row->id_document_front;
$id_document_front_file = @fopen($id_document_front ,'r');
$id_document_back = NANO_SANTE_SERVICE_URL . '/insurances-subscriptions-docs/'.$row->id_document_back;
$id_document_back_file = @fopen($id_document_front ,'r');
?>
<div class="row text-center" style="justify-content: center; display: flex;">
<div class="col-sm-6">
<label><?= $this->lang->line('profile_image') ?></label>
<div>
<img src="<?= $profile_image_file ? $profile_image : base_url('images/broken.png') ?>"
alt="user_image" width="100%"/>
</div>
</div>
<div class="col-sm-6">
<label><?= $this->lang->line('marriage_certificate_doc') ?></label>
<div>
<img src="<?= $marriage_certificate_doc_file ? $marriage_certificate_doc : base_url('images/broken.png') ?>"
alt="user_image" width="100%"/>
</div>
</div>
</div>
<div class="row" style="margin-top: 10px">
<div class="col-sm-6 text-center">
<label><?= $this->lang->line('id_document_image_front') ?></label>
<img src="<?= $id_document_front_file ? $id_document_front : base_url('images/broken.png') ?>"
alt="document_front" style="width: 100%;"/>
</div>
<div class="col-sm-6 text-center">
<label><?= $this->lang->line('id_document_image_back') ?></label>
<img src="<?= $id_document_back_file ? $id_document_back : base_url('images/broken.png')?>"
alt="document_back" style="width: 100%;"/>
</div>
</div>
<?php } ?>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal"><?= $this->lang->line('Fermer'); ?></button>
</div>
</div>
</div>
</div>