Advertisement
Guest User

Untitled

a guest
Feb 6th, 2016
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.58 KB | None | 0 0
  1. <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
  2.  
  3. class Main_page extends CI_Model{
  4.  
  5. /**
  6. * Constructor for discovery
  7. *
  8. */
  9. function __construct(){
  10. parent::__construct();
  11. }
  12.  
  13. /**
  14. * Function for storing the Loaners.club's invoice.
  15. *
  16. * @param $data array.
  17. *
  18. * @return true if successful, otherwise false.
  19. */
  20.  
  21. public function login_user($email , $password){
  22. $this->db->where('email', $email);
  23. $this->db->where('password', $password);
  24.  
  25. $result = $this->db->get('new_users');
  26. if($result ->num_rows() == 1){
  27. return $result->row(0)->id;
  28. }else{
  29. return false;
  30. }
  31.  
  32. }
  33.  
  34.  
  35.  
  36. public function storeRegisterInfo($data){
  37. // print_r($data);
  38. $insert = $this->db->insert('new_users',$data);
  39. // $lastid = $this->db->insert_id(); echo $lastid; exit;
  40. return $insert;
  41.  
  42. }
  43.  
  44. public function storeCardInfo($data){
  45. // print_r($data);
  46. $insert = $this->db->insert('user_money',$data);
  47. // $lastid = $this->db->insert_id(); echo $lastid; exit;
  48. return $insert;
  49.  
  50. }
  51.  
  52. public function getAllrequest(){
  53. $query ='SELECT * FROM user_money';
  54.  
  55. $query = $this->db->query($query);
  56. $result = $query->result();
  57. return $result;
  58. }
  59. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement