Skip to content

Commit

Permalink
pagos
Browse files Browse the repository at this point in the history
  • Loading branch information
JesusHT committed Nov 27, 2022
1 parent dbbc388 commit 2a8d06a
Show file tree
Hide file tree
Showing 13 changed files with 155 additions and 345 deletions.
25 changes: 20 additions & 5 deletions controllers/consulta.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

class Consulta extends Controller {

private $loan;
private $customer;

function __construct(){
Expand All @@ -13,6 +14,7 @@ function __construct(){

$this -> customer = new UserModel();
$this -> customer -> getUsers($_SESSION['user']);
$this -> loan = new LoanModel();

$this -> view -> render('consulta/index',[
'tabla' => $tabla,
Expand All @@ -33,20 +35,33 @@ public function setPages(){
public function desglose(){
if ($this -> existGET(['v'])) {
if ($this -> validateData(['v'])){
$Loan = new LoanModel();
$Loan -> ExistLoan($_GET['v']);
$data = $Loan -> calDatePayments($_GET['v']);
$this -> loan -> ExistLoan($_GET['v']);
$data = $this -> loan -> calDatePayments($_GET['v']);

$this -> loan($data);
}
}
}

public function pagar(){

}

public function pagos(){
$data = $this -> loan -> calPayment($_POST['num_prestamo']);

$this -> payment($data,$_POST['num_prestamo']);
}

function loan($data){
$this -> view -> render("templates/desglose",["loan" => $data]);
}

function payment($data){
$this -> view -> render("templates/pagos",["payment" =>$data]);
function payment($data, $num_prestamo){
$this -> view -> render("templates/pagos",[
"payment" =>$data,
"num_prestamo" => $num_prestamo
]);
}

function decimales($value){return number_format($value, 2, '.', '');}
Expand Down
290 changes: 0 additions & 290 deletions models/.tex

This file was deleted.

3 changes: 3 additions & 0 deletions models/customermodel.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php

?>
Loading

0 comments on commit 2a8d06a

Please sign in to comment.