Guest User

Untitled

a guest
Jul 17th, 2018
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | None | 0 0
  1. <?php
  2.  
  3. class model_agent extends model
  4. {
  5. public function __construct( $db )
  6. {
  7. $this->db = $db;
  8. $this->define();
  9. }
  10.  
  11. protected function define()
  12. {
  13. $t = $this;
  14.  
  15. $t->name = "agent";
  16. $t->nice_name = "Agent";
  17.  
  18. $t->primary_table = "agents";
  19. $t->primary_key = "agents.id";
  20.  
  21. $t->table( "agents", array(
  22. "id" => $t->primary_key (),
  23. "name" => $t->char_field ( "Name" ),
  24. "alias" => $t->char_field ( "Alias" ),
  25. "email" => $t->char_field ( "E-Mail", array( "validation" => "email" )),
  26. "phone" => $t->char_field ( "Phone Number" ),
  27. "address" => $t->text_field ( "Address" ),
  28. "course" => $t->char_field ( "Degree" ),
  29. "societies" => $t->text_field ( "Societies" ),
  30. "clubs" => $t->text_field ( "Bars, Clubs & Pubs" ),
  31. "timetable" => $t->text_field ( "Timetable (+Times and Locations)" ),
  32. "kill_count" => $t->integer_field ( "Frags" ),
  33. "death_count" => $t->integer_field ( "Deaths" ),
  34. ));
  35. }
  36.  
  37. public function default_form()
  38. {
  39. return array(
  40. "Contact Information" => array(
  41. "name",
  42. "alias",
  43. "email",
  44. "phone",
  45. "address"
  46. ),
  47. "Profile" => array(
  48. "course",
  49. "societies",
  50. "clubs",
  51. "timetable"
  52. )
  53. );
  54. }
  55. }
  56.  
  57. ?>
Add Comment
Please, Sign In to add comment