Advertisement
Guest User

Untitled

a guest
Aug 3rd, 2016
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.40 KB | None | 0 0
  1. <?php
  2.  
  3. class LoginController extends CI_Controller
  4. {
  5. public function process()
  6. {
  7. $this->load->model("LoginModel");
  8. $this->load->model('AccountModel');
  9. //$this->load->library('javascript');
  10. $username = $this->input->post("username");
  11. $password = $this->input->post("password");
  12.  
  13. if ($this->LoginModel->Login($username, $password))
  14. {
  15. $data["Cuentas"] = $this->AccountModel->getAllAccountInfo();
  16. $this->load->view('admin/index', $data);
  17. }
  18. }
  19. }
  20.  
  21. <?php
  22.  
  23. class AccountModel extends CI_Model
  24. {
  25. public function getAllAccountInfo()
  26. {
  27. $query = $this->db->query('SELECT cuenta, nombre, buscar, pago, monto, fecha, banco, interes, concepto, cuota, credito, debito FROM accounts');
  28. return $query->result_array();
  29. }
  30.  
  31. public function saveData()
  32. {
  33.  
  34. }
  35. }
  36.  
  37. <?php
  38. class LoginModel extends CI_Model
  39. {
  40. public function Login($user, $pass)
  41. {
  42. $this->db->where('username', $user);
  43. $this->db->where('password', $pass);
  44. $query = $this->db->get('usuarios');
  45. if ($query->num_rows() == 1)
  46. return true;
  47. return false;
  48. }
  49. }
  50.  
  51. <?php
  52.  
  53. class SaveController extends CI_Controller
  54. {
  55. public function process()
  56. {
  57.  
  58. }
  59. }
  60.  
  61. <form class="well form-horizontal" action="<?php echo site_url('SaveController/process');?>" method="POST" id="contact_form">
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement