Deal.class.php 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. <?php
  2. class AC_Deal extends ActiveCampaign {
  3. public $version;
  4. public $url_base;
  5. public $url;
  6. public $api_key;
  7. function __construct($version, $url_base, $url, $api_key) {
  8. $this->version = $version;
  9. $this->url_base = $url_base;
  10. $this->url = $url;
  11. $this->api_key = $api_key;
  12. }
  13. function add($params, $post_data) {
  14. $request_url = "{$this->url}&api_action=deal_add&api_output={$this->output}";
  15. $response = $this->curl($request_url, $post_data);
  16. return $response;
  17. }
  18. function edit($params, $post_data) {
  19. $request_url = "{$this->url}&api_action=deal_edit&api_output={$this->output}";
  20. $response = $this->curl($request_url, $post_data);
  21. return $response;
  22. }
  23. function delete($params, $post_data) {
  24. $request_url = "{$this->url}&api_action=deal_delete&api_output={$this->output}";
  25. $response = $this->curl($request_url, $post_data);
  26. return $response;
  27. }
  28. function get($params) {
  29. $request_url = "{$this->url}&api_action=deal_get&api_output={$this->output}&{$params}";
  30. $response = $this->curl($request_url);
  31. return $response;
  32. }
  33. function list_($params) {
  34. $request_url = "{$this->url}&api_action=deal_list&api_output={$this->output}&{$params}";
  35. $response = $this->curl($request_url);
  36. return $response;
  37. }
  38. function note_add($params, $post_data) {
  39. $request_url = "{$this->url}&api_action=deal_note_add&api_output={$this->output}";
  40. $response = $this->curl($request_url, $post_data);
  41. return $response;
  42. }
  43. function note_edit($params, $post_data) {
  44. $request_url = "{$this->url}&api_action=deal_note_edit&api_output={$this->output}";
  45. $response = $this->curl($request_url, $post_data);
  46. return $response;
  47. }
  48. function pipeline_add($params, $post_data) {
  49. $request_url = "{$this->url}&api_action=deal_pipeline_add&api_output={$this->output}";
  50. $response = $this->curl($request_url, $post_data);
  51. return $response;
  52. }
  53. function pipeline_edit($params, $post_data) {
  54. $request_url = "{$this->url}&api_action=deal_pipeline_edit&api_output={$this->output}";
  55. $response = $this->curl($request_url, $post_data);
  56. return $response;
  57. }
  58. function pipeline_delete($params, $post_data) {
  59. $request_url = "{$this->url}&api_action=deal_pipeline_delete&api_output={$this->output}";
  60. $response = $this->curl($request_url, $post_data);
  61. return $response;
  62. }
  63. function pipeline_list($params) {
  64. $request_url = "{$this->url}&api_action=deal_pipeline_list&api_output={$this->output}&{$params}";
  65. $response = $this->curl($request_url);
  66. return $response;
  67. }
  68. function stage_add($params, $post_data) {
  69. $request_url = "{$this->url}&api_action=deal_stage_add&api_output={$this->output}";
  70. $response = $this->curl($request_url, $post_data);
  71. return $response;
  72. }
  73. function stage_edit($params, $post_data) {
  74. $request_url = "{$this->url}&api_action=deal_stage_edit&api_output={$this->output}";
  75. $response = $this->curl($request_url, $post_data);
  76. return $response;
  77. }
  78. function stage_delete($params, $post_data) {
  79. $request_url = "{$this->url}&api_action=deal_stage_delete&api_output={$this->output}";
  80. $response = $this->curl($request_url, $post_data);
  81. return $response;
  82. }
  83. function stage_list($params) {
  84. $request_url = "{$this->url}&api_action=deal_stage_list&api_output={$this->output}&{$params}";
  85. $response = $this->curl($request_url);
  86. return $response;
  87. }
  88. function task_add($params, $post_data) {
  89. $request_url = "{$this->url}&api_action=deal_task_add&api_output={$this->output}";
  90. $response = $this->curl($request_url, $post_data);
  91. return $response;
  92. }
  93. function task_edit($params, $post_data) {
  94. $request_url = "{$this->url}&api_action=deal_task_edit&api_output={$this->output}";
  95. $response = $this->curl($request_url, $post_data);
  96. return $response;
  97. }
  98. function tasktype_add($params, $post_data) {
  99. $request_url = "{$this->url}&api_action=deal_tasktype_add&api_output={$this->output}";
  100. $response = $this->curl($request_url, $post_data);
  101. return $response;
  102. }
  103. function tasktype_edit($params, $post_data) {
  104. $request_url = "{$this->url}&api_action=deal_tasktype_edit&api_output={$this->output}";
  105. $response = $this->curl($request_url, $post_data);
  106. return $response;
  107. }
  108. function tasktype_delete($params, $post_data) {
  109. $request_url = "{$this->url}&api_action=deal_tasktype_delete&api_output={$this->output}";
  110. $response = $this->curl($request_url, $post_data);
  111. return $response;
  112. }
  113. }
  114. ?>