Guest User

Untitled

a guest
Jun 22nd, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.37 KB | None | 0 0
  1. <?php
  2.  
  3. public function __construct($the_o_database, $the_sz_AccountID)
  4. {
  5. $this->my_o_database = $the_o_database;
  6.  
  7. static $children_cache = NULL;
  8. static $params_cache = array();
  9.  
  10. $a_sz_query = "SELECT \"AC_AccountID\", \"AC_AC_AccountParentID\", \"AC_Code\", ";
  11. $a_sz_query .= "\"AC_Name\", \"AC_IsActive\", \"AC_IsRetired\", \"AC_RetiredDate\", ";
  12. $a_sz_query .= "\"AC_CreateDate\", \"AC_DeactivateOnDate\", \"AC_CompleteName\", ";
  13. $a_sz_query .= "\"AC_PINCode\", \"AC_AccountInfo\" FROM \"Accounts\" ";
  14. $a_sz_query .= "WHERE \"AC_AccountID\" = '".$the_sz_AccountID."';";
  15. $a_o_result = db_query($the_o_database, $a_sz_query);
  16.  
  17. while ($a_o_row = db_fetch_row($a_o_result))
  18. {
  19. $the_ar_IDParentName = Account::GetParentAccountList($the_o_database);
  20.  
  21. $this->my_sz_ID = $the_sz_AccountID;
  22. $this->my_sz_ParentID = $a_o_row[1];
  23. $this->my_sz_Code = $a_o_row[2];
  24. $this->my_sz_Name = $a_o_row[3];
  25. $this->my_b_IsActive = $a_o_row[4];
  26. $this->my_b_IsRetired = $a_o_row[5];
  27. $this->my_dt_RetiredDate = $a_o_row[6];
  28. $this->my_dt_CreateDate = $a_o_row[7];
  29. $this->my_dt_DeactivateOnDate = $a_o_row[8];
  30. $this->my_sz_Info = $a_o_row[11];
  31.  
  32. if ($a_o_row[9] == "")
  33. {
  34. $this->my_sz_FullName = $this->ConstructFullName($the_ar_IDParentName, $the_sz_AccountID, "");
  35. $this->SetCompleteName($the_o_database, $this->my_sz_FullName, $this->my_sz_ID);
  36. }
  37. else
  38. {
  39. $this->my_sz_FullName = $a_o_row[9];
  40. }
  41.  
  42. $this->my_sz_PinCode = $a_o_row[10];
  43. $this->my_sz_Ascent = Account::ConstructListOfParents($the_ar_IDParentName, $the_sz_AccountID, "");
  44.  
  45. // Memoize list of children
  46. $params_array = array($the_ar_IDParentName, $the_sz_AccountID, "");
  47. if ($children_cache !== NULL and ($params_array == $params_cache))
  48. {
  49. // Create cache
  50. $this->my_sz_Descent = $children_cache;
  51. }
  52. else
  53. {
  54. // Cache hit
  55. $this->my_sz_Descent = $children_cache = Account::ConstructListOfChildren($the_ar_IDParentName, $the_sz_AccountID, "");
  56. $params_cache = $params_array;
  57. }
  58.  
  59. $this->my_sz_Children = Account::GetChildren($the_o_database);
  60.  
  61. $this->my_b_HasChild = (bool) ($this->my_sz_Children != "");
  62. }
  63. }
Add Comment
Please, Sign In to add comment