PageRenderTime 42ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/public_html/func/prdcr_contact_info_admin.php

https://gitlab.com/Henaway/CLFC
PHP | 110 lines | 108 code | 1 blank | 1 comment | 10 complexity | 5bff703e2d9349203963abbf469eb37d MD5 | raw file
  1. <?php
  2. function prdcr_contact_info($start, $half)
  3. {
  4. global $connection;
  5. $sqlp = '
  6. SELECT
  7. '.TABLE_PRODUCER.'.producer_id,
  8. '.TABLE_PRODUCER.'.member_id,
  9. '.TABLE_PRODUCER.'.business_name,
  10. '.TABLE_MEMBER.'.first_name,
  11. '.TABLE_MEMBER.'.first_name,
  12. '.TABLE_MEMBER.'.last_name,
  13. '.TABLE_MEMBER.'.address_line1,
  14. '.TABLE_MEMBER.'.address_line2,
  15. '.TABLE_MEMBER.'.city,
  16. '.TABLE_MEMBER.'.state,
  17. '.TABLE_MEMBER.'.zip,
  18. '.TABLE_MEMBER.'.email_address,
  19. '.TABLE_MEMBER.'.email_address_2,
  20. '.TABLE_MEMBER.'.home_phone,
  21. '.TABLE_MEMBER.'.work_phone,
  22. '.TABLE_MEMBER.'.mobile_phone,
  23. '.TABLE_MEMBER.'.fax,
  24. '.TABLE_MEMBER.'.toll_free,
  25. '.TABLE_MEMBER.'.home_page,
  26. '.TABLE_MEMBER.'.membership_date,
  27. '.TABLE_PRODUCER.'.unlisted_producer
  28. FROM
  29. '.TABLE_PRODUCER.'
  30. LEFT JOIN
  31. '.TABLE_MEMBER.' ON '.TABLE_MEMBER.'.member_id = '.TABLE_PRODUCER.'.member_id
  32. WHERE
  33. '.TABLE_PRODUCER.'.unlisted_producer != 2
  34. AND '.TABLE_MEMBER.'.membership_discontinued != 1
  35. ORDER BY
  36. '.TABLE_PRODUCER.'.business_name ASC
  37. LIMIT '.mysql_real_escape_string ($start).', '.mysql_real_escape_string ($half).'';
  38. $resultp = @mysql_query($sqlp, $connection) or die(debug_print ("ERROR: 572929 ", array ($query,mysql_error()), basename(__FILE__).' LINE '.__LINE__));
  39. while ( $row = mysql_fetch_array($resultp) )
  40. {
  41. $producer_id = $row['producer_id'];
  42. $business_name = $row['business_name'];
  43. $first_name = $row['first_name'];
  44. $last_name = $row['last_name'];
  45. $business_name = $row['business_name'];
  46. $address_line1 = $row['address_line1'];
  47. $address_line2 = $row['address_line2'];
  48. $city = $row['city'];
  49. $state = $row['state'];
  50. $zip = $row['zip'];
  51. $email_address = $row['email_address'];
  52. $email_address_2 = $row['email_address_2'];
  53. $home_phone = $row['home_phone'];
  54. $work_phone = $row['work_phone'];
  55. $mobile_phone = $row['mobile_phone'];
  56. $fax = $row['fax'];
  57. $toll_free = $row['toll_free'];
  58. $home_page = $row['home_page'];
  59. $membership_date = $row['membership_date'];
  60. // include("../func/show_name.php");
  61. $display .= $business_name.'<br>';
  62. $display .= $first_name.' '.$last_name.'<br>';
  63. $display .= $address_line1.'<br>';
  64. if( $address_line2 )
  65. {
  66. $display .= $address_line2.'<br>';
  67. }
  68. $display .= $city.', '.$state.' '.$zip.'<br>';
  69. if ( $email_address )
  70. {
  71. $display .= '<a href="mailto:'.$email_address.'">'.$email_address.'</a><br>';
  72. }
  73. if ( $email_address_2 )
  74. {
  75. $display .= '<a href="mailto:'.$email_address_2.'">'.$email_address_2.'</a><br>';
  76. }
  77. if ( $home_phone )
  78. {
  79. $display .= $home_phone.' (home)<br>';
  80. }
  81. if ( $work_phone )
  82. {
  83. $display .= $work_phone.' (work)<br>';
  84. }
  85. if ( $mobile_phone )
  86. {
  87. $display .= $mobile_phone.' (cell)<br>';
  88. }
  89. if ( $fax )
  90. {
  91. $display .= $fax.' (fax)<br>';
  92. }
  93. if ( $toll_free )
  94. {
  95. $display .= $toll_free.' (toll free)<br>';
  96. }
  97. if ( $home_page )
  98. {
  99. $display .= $home_page.'<br>';
  100. }
  101. $year = substr ($membership_date, 0, 4);
  102. $month = substr ($membership_date, 5, 2);
  103. $day = substr ($membership_date, 8);
  104. $member_since = date('F j, Y',mktime(0, 0, 0, $month, $day, $year));
  105. $display .= 'Member since '.$member_since.'<br>';
  106. $display .= '<br>';
  107. }
  108. return $display;
  109. }