Advertisement
Guest User

Untitled

a guest
Sep 30th, 2011
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 43.41 KB | None | 0 0
  1. <?php
  2. /*
  3. +--------------------------------------------------------------------------------+
  4. | jbRoster - by Jesse Burns aka jburns131 aka Jakle (jburns131@jbwebware.com)
  5. |
  6. | Plugin Support Site: www.jbwebware.com
  7. |
  8. | A plugin designed for the e107 Website System
  9. | http://e107.org
  10. |
  11. | For more plugins visit:
  12. | http://plugins.e107.org
  13. | http://www.e107coders.org
  14. |
  15. | Released under the terms and conditions of the
  16. | GNU General Public License (http://gnu.org).
  17. |
  18. +--------------------------------------------------------------------------------+
  19. */
  20.  
  21. require_once("../../class2.php");
  22. require_once(HEADERF);
  23. if(file_exists(e_PLUGIN."jbroster_menu/languages/".e_LANGUAGE.".php")) {
  24. include_lan(e_PLUGIN."jbroster_menu/languages/".e_LANGUAGE.".php");
  25. }
  26.  
  27. require_once("includes/config.constants.php");
  28. require_once("includes/config.functions.php");
  29.  
  30. $sql->db_Select(DB_TABLE_ROSTER_PREFERENCES);
  31. while($row = $sql->db_Fetch()) {
  32. $organization_name = $row['organization_name'];
  33. $organization_type = $row['organization_type'];
  34. $organization_designation = $row['organization_designation'];
  35. $organization_unit_designation = $row['organization_unit_designation'];
  36. $organization_logo = $row['organization_logo'];
  37. $organization_logo_alignment = $row['organization_logo_alignment'];
  38. }
  39.  
  40. $sql->db_Select(DB_TABLE_ROSTER_ORG_DESIGNATIONS, "*", "designation_id = ".intval($organization_designation));
  41. while($row = $sql->db_Fetch()) {
  42. $organization_designation_name = $row['designation_name'];
  43. }
  44.  
  45. $sql->db_Select(DB_TABLE_ROSTER_ORG_UNIT_DESIGNATIONS, "*", "designation_id = ".intval($organization_unit_designation));
  46. while($row = $sql->db_Fetch()) {
  47. $organization_unit_designation_name = $row['designation_name'];
  48. }
  49.  
  50. $sql->db_Select(DB_TABLE_ROSTER_LEADER_STATUS, "*", "status_name != 'None'
  51. AND status_name != 'Organization Leader'
  52. AND status_name != 'Organization Captain'
  53. AND status_name != 'Web Admin'");
  54. while($row = $sql->db_Fetch()) {
  55. $customArgs .= " OR leader_status like '".$tp->toDB($row['status_name'])."%'";
  56. }
  57.  
  58. /************************************************************
  59. *
  60. * Display Organization Logo
  61. *
  62. ************************************************************/
  63.  
  64. if ($organization_logo == "") {
  65. // Don't display the logo
  66. } else {
  67. echo "
  68. <center>
  69. <p style='margin-top: 2em; margin-bottom: 2em'>
  70. <img align='$organization_logo_alignment' src='".e_PLUGIN."jbroster_menu/images/$organization_logo'>
  71. </p>
  72. </center>";
  73. }
  74.  
  75. $numRows = $sql->db_Count(DB_TABLE_ROSTER_MEMBERS);
  76. if ($numRows == 0) {
  77. $text_1 .= "
  78. <center>
  79. <p>
  80. <div style='width:80%; margin-top: 2em; margin-bottom: 2em'>
  81. <table style='width:100%' class='fborder' cellspacing='0' cellpadding='0'>
  82. <tr>
  83. <td class='forumheader3'>
  84. <center>
  85. <p style='margin-top: 2em; margin-bottom: 2em'>
  86. ".LAN_JBROSTER_GENERAL_NO_MEMBERS_IN_SYSTEM."
  87. </p>
  88. </center>
  89. </td>
  90. </tr>
  91. </table>
  92. </div>
  93. </p>
  94. </center>";
  95.  
  96. $title = "";
  97. $ns->tablerender($title, $text_1);
  98. }
  99.  
  100. /************************************************************
  101. *
  102. * Display Organization Leaders
  103. *
  104. ************************************************************/
  105.  
  106.  
  107. if (($sql->db_Count(DB_TABLE_ROSTER_MEMBERS, "(*)", "WHERE leader_status like 'Organization Leader%' OR leader_status like 'Organization Captain%' OR leader_status like 'Web Admin%'$customArgs") == 0) ||
  108. ($sql->db_Count(DB_TABLE_ROSTER_CUSTOM_ATTRIBUTE_ENTRIES, "(*)", "WHERE main_display= 2") == 0)) {
  109. // Don't display leader block
  110. } else {
  111. $text_1 .= "
  112. <center>
  113. <p>
  114. <div style='width:80%; margin-top: 2em; margin-bottom: 2em'>
  115. <table style='width:100%' class='fborder' cellspacing='0' cellpadding='0'>
  116. <tr>
  117. <td colspan='20' class='forumheader'>
  118. <span class='smalltext' style='color: white;'>";
  119.  
  120. if(file_exists(e_LANGUAGE == "English")) {
  121. $text_1 .= "
  122. <center><b>$organization_designation_name ".LAN_JBROSTER_MAIN_PAGE_LEADER_HEADER."s</center></b>";
  123. } else {
  124. $text_1 .= "
  125. <center><b>$organization_designation_name ".LAN_JBROSTER_MAIN_PAGE_LEADER_HEADER."</center></b>";
  126. }
  127.  
  128. $text_1 .= "
  129. </span>
  130. </td>
  131. </tr>
  132. <tr>
  133. <td class='forumheader3'>
  134. <span class='smalltext'>
  135. <b>".LAN_JBROSTER_GENERAL_LEADER_STATUS."</b>
  136. </span>
  137. </td>";
  138.  
  139. $sql1 = new db;
  140. $sql1->db_Select(DB_TABLE_ROSTER_CUSTOM_ATTRIBUTE_ENTRIES, "*", "main_display = 2 ORDER BY attribute_order");
  141. while ($row1 = $sql1->db_Fetch()) {
  142. if ($row1['attribute_id'] == 3) {
  143. // Don't display 'Team Status'
  144. } else {
  145. if ($row1['attribute_id'] == 34) {
  146. $text_1 .= "
  147. <td class='forumheader3'>
  148. <span class='smalltext'>
  149. <b>".$row1['attribute_name']." $organization_name</b>
  150. </span>
  151. </td>";
  152. } else {
  153. $text_1 .= "
  154. <td class='forumheader3'>
  155. <span class='smalltext'>
  156. <center><b>".$row1['attribute_name']."</b></center>
  157. </span>
  158. </td>";
  159. }
  160. }
  161. }
  162.  
  163. $text_1 .= "
  164. </tr>";
  165.  
  166. if($sql1->db_Count(DB_TABLE_ROSTER_MEMBERS, "(*)", "WHERE leader_status like 'Organization Leader%'
  167. OR leader_status like 'Organization Captain%'
  168. OR leader_status like 'Web Admin%'$customArgs") > 0) {
  169.  
  170. $sql2 = new db;
  171. $sql2->db_Select(DB_TABLE_ROSTER_MEMBERS, "*", "leader_status like 'Organization Leader%'
  172. OR leader_status like 'Organization Captain%'
  173. OR leader_status like 'Web Admin%'$customArgs
  174. ORDER BY leader_order");
  175. while($row2 = $sql2->db_Fetch()) {
  176.  
  177. $sql3 = new db;
  178. $sql3->db_Select(DB_TABLE_ROSTER_MEMBERS, "*", "member_id = ".intval($row2['member_id']));
  179. while ($row3 = $sql3->db_Fetch()) {
  180. $leaderStatusLeader = $row3['leader_status'];
  181.  
  182. $sql4 = new db;
  183. $sql4->db_Select(DB_TABLE_ROSTER_LEADER_STATUS, "*", "status_name = '".$tp->toDB($leaderStatusLeader)."'");
  184. while ($row4 = $sql4->db_Fetch()) {
  185. $textColorLeader = $row4['text_color'];
  186. }
  187. }
  188.  
  189. $text_1 .="
  190. <tr>
  191. <td class='forumheader3'>
  192. <span style='color: $textColorLeader' class='smalltext'>
  193. <b>$leaderStatusLeader</b>
  194. </span>
  195. </td>";
  196.  
  197. $sql3->db_Select(DB_TABLE_ROSTER_CUSTOM_ATTRIBUTE_ENTRIES, "*", "main_display = 2 ORDER BY attribute_order");
  198. while ($row3 = $sql3->db_Fetch()) {
  199.  
  200.  
  201. $sql4 = new db;
  202. $sql4->db_Select(DB_TABLE_ROSTER_CUSTOM_ATTRIBUTE_VALUES, "*", "member_id = ".intval($row2['member_id'])."
  203. AND attribute_id = ".intval($row3['attribute_id']));
  204. while ($row4 = $sql4->db_Fetch()) {
  205. $member_id = $row4['member_id'];
  206. $attributeValue = $row4['attribute_value'];
  207. }
  208.  
  209. if ($row3['attribute_id'] == 1) {
  210.  
  211. if ($attributeValue == '') {
  212. $text_1 .= "
  213. <td class='forumheader3'>
  214. <span class='smalltext'>
  215. &nbsp;
  216. </span>
  217. </td>";
  218. } else {
  219. $text_1 .= "
  220. <td class='forumheader3'>
  221. <span class='smalltext'>
  222. <a href='member_profile.php?member_id=$member_id&url=".$_SERVER['PHP_SELF']."'>$attributeValue</a>
  223. </span>
  224. </td>";
  225. }
  226.  
  227. } else if ($row3['attribute_id'] == 2) {
  228.  
  229. if ($attributeValue == '') {
  230. $text_1 .= "
  231. <td class='forumheader3'>
  232. <span class='smalltext'>
  233. &nbsp;
  234. </span>
  235. </td>";
  236. } else {
  237. $text_1 .= "
  238. <td class='forumheader3'>
  239. <span class='smalltext'>
  240. <a href='member_profile.php?member_id=$member_id'>$attributeValue</a>
  241. </span>
  242. </td>";
  243. }
  244.  
  245. } else if ($row3['attribute_id'] == 3) {
  246. // Don't display 'Team Status'
  247. } else if ($row3['attribute_id'] == 4) {
  248.  
  249. $sql4 = new db;
  250. $sql4->db_Select(DB_TABLE_ROSTER_MEMBER_STATUS, "*", "status_name = '".$tp->toDB($attributeValue)."'");
  251. while ($row4 = $sql4->db_Fetch()) {
  252. $textColor = $row4['text_color'];
  253. }
  254.  
  255. if ($attributeValue == '') {
  256. $text_1 .= "
  257. <td class='forumheader3'>
  258. <span class='smalltext'>
  259. &nbsp;
  260. </span>
  261. </td>";
  262. } else {
  263. $text_1 .= "
  264. <td class='forumheader3'>
  265. <span style='color: $textColor' class='smalltext'><center>
  266. $attributeValue
  267. </span></center>
  268. </td>";
  269. }
  270.  
  271. } else if ($row3['attribute_id'] == 5) {
  272.  
  273. $sql4 = new db;
  274. $sql4->db_Select(DB_TABLE_ROSTER_LEADER_STATUS, "*", "status_name = '".$tp->toDB($attributeValue)."'");
  275. while ($row4 = $sql4->db_Fetch()) {
  276. $textColor = $row4['text_color'];
  277. }
  278.  
  279. if ($attributeValue == '') {
  280. $text_1 .= "
  281. <td class='forumheader3'>
  282. <span class='smalltext'>
  283. &nbsp;
  284. </span>
  285. </td>";
  286. } else {
  287. $text_1 .= "
  288. <td class='forumheader3'>
  289. <span style='color: $textColor' class='smalltext'>
  290. <b>$attributeValue</b>
  291. </span>
  292. </td>";
  293. }
  294.  
  295. } else if ($row3['attribute_id'] == 8) {
  296.  
  297. if ($attributeValue == '') {
  298. $text_1 .= "
  299. <td class='forumheader3'>
  300. <span class='smalltext'>
  301. &nbsp;
  302. </span>
  303. </td>";
  304. } else {
  305. $text_1 .= "
  306. <td class='forumheader3'>
  307. <span class='smalltext'>
  308. <a href='mailto:$attributeValue'>".LAN_JBROSTER_GENERAL_EMAIL."</a>
  309. </span>
  310. </td>";
  311. }
  312.  
  313. } else if ($row3['attribute_id'] == 9) {
  314.  
  315. if ($attributeValue == '') {
  316. $text_1 .= "
  317. <td class='forumheader3'>
  318. <span class='smalltext'>
  319. &nbsp;
  320. </span>
  321. </td>";
  322. } else {
  323. $text_1 .= "
  324. <td class='forumheader3'>
  325. <span class='smalltext'>
  326. <a href='http://profile.xfire.com/$attributeValue' target='_blank'>$attributeValue</a>
  327. </span>
  328. </td>";
  329. }
  330.  
  331. } else if ($row3['attribute_id'] == 15) {
  332.  
  333. if ($attributeValue == '') {
  334. $text_1 .= "
  335. <td class='forumheader3'>
  336. <span class='smalltext'>
  337. &nbsp;
  338. </span>
  339. </td>";
  340. } else {
  341.  
  342. $calcAge = calc_age($attributeValue);
  343.  
  344. $text_1 .= "
  345. <td class='forumheader3'>
  346. <span class='smalltext'>
  347. <center>
  348. <b>$calcAge</b>
  349. </center>
  350. </span>
  351. </td>";
  352. }
  353.  
  354. } else if ($row3['attribute_id'] == 49) {
  355.  
  356. if ($attributeValue == '') {
  357. $text_1 .= "
  358. <td class='forumheader3'>
  359. <span class='smalltext'>
  360. &nbsp;
  361. </span>
  362. </td>";
  363. } else {
  364. $text_1 .= "
  365. <td class='forumheader3'>
  366. <span class='smalltext'>
  367. <b><P ALIGN='right'>";
  368. if($attributeValue == 0) {
  369. $text_1 .= "
  370. &nbsp;";
  371. } else {
  372. $text_1 .=
  373. date("m/d/Y", $attributeValue);
  374. }
  375. $text_1 .= "
  376. </p></b>
  377. </span>
  378. </td>";
  379. }
  380.  
  381. } else {
  382.  
  383. if ($attributeValue == '') {
  384.  
  385. $text_1 .= "
  386. <td class='forumheader3'>
  387. <span class='smalltext'>
  388. &nbsp;
  389. </span>
  390. </td>";
  391. } else {
  392.  
  393. $text_1 .= "
  394. <td class='forumheader3'>
  395. <span class='smalltext'>
  396. <b>$attributeValue</b>
  397. </span>
  398. </td>";
  399. }
  400. }
  401. }
  402.  
  403. $text_1 .= "</tr>";
  404. }
  405.  
  406. } else {
  407.  
  408. $text_1 .= "
  409. <tr>
  410. <td colspan=20 class='forumheader3'>
  411. <span class='smalltext'>
  412. <center>
  413. <p>
  414. ".LAN_JBROSTER_MAIN_PAGE_NO_LEADERS."
  415. </p>
  416. </center>
  417. </span>
  418. </td>
  419. </tr>";
  420. }
  421.  
  422. $text_1 .= "
  423. </tr>
  424. </table>
  425. </div>
  426. </p>
  427. </center>";
  428.  
  429. // Render the value of $text_1 in a table.
  430. $title = $organization_name." ".LAN_JBROSTER_MAIN_PAGE_LEADERSHIP_HEADER;
  431. $ns->tablerender($title, $text_1);
  432. }
  433.  
  434. /************************************************************
  435. *
  436. * Display Organization Teams
  437. *
  438. ************************************************************/
  439.  
  440. if (($sql->db_Count(DB_TABLE_ROSTER_TEAMS, "(*)", "WHERE display = 2") == 0) ||
  441. ($sql->db_Count(DB_TABLE_ROSTER_CUSTOM_ATTRIBUTE_ENTRIES, "(*)", "WHERE main_display = 2") == 0)) {
  442. // Don't display teams block
  443. } else {
  444. $sql1 = new db;
  445. $sql1->db_Select(DB_TABLE_ROSTER_TEAMS, "*", "display = 2 ORDER BY team_order");
  446. while($row1 = $sql1->db_Fetch()) {
  447.  
  448. $text_2 .= "
  449. <center>
  450. <p>
  451. <div style='width:80%; margin-top: 2em; margin-bottom: 2em'>
  452. <table style='width:100%' class='fborder' cellspacing='0' cellpadding='0'>
  453. <tr>
  454. <td colspan=20>
  455. <table width='100%' cellspacing='0' cellpadding='0'>
  456. <tr>";
  457. if ($row1['team_name'] == '') {
  458. $text_2 .= "
  459. <td colspan=2 style='border-right: 0px;' width='50%' class='forumheader3'>&nbsp;</td>";
  460. } else {
  461. $text_2 .= "
  462. <td colspan=2 style='border-right: 0px;' width='50%' class='forumheader' align=right width='50%'>
  463. <span style='color: ".$row1['text_color'].";' class='smalltext'>
  464. <b>".$row1['team_name']."</b>
  465. </span>
  466. </td>";
  467. }
  468. if ($row1['game_name'] == '') {
  469. $text_2 .= "
  470. <td colspan=2 style='border-left: 0px;' width='50%' class='forumheader3'>&nbsp;</td>";
  471. } else {
  472. $sql2 = new db;
  473. $sql2->db_Select(DB_TABLE_ROSTER_GAMES, "*", "game_name = '".$tp->toDB($row1['game_name'])."'");
  474. while ($row2 = $sql2->db_Fetch()) {
  475. $text_2 .= "
  476. <td colspan=2 style='border-left: 0px;' width='50%' class='forumheader' align=right>
  477. <span class='smalltext'>
  478. <b>".LAN_JBROSTER_GENERAL_GAME.": </b>
  479. <span style='color: ".$row2['text_color'].";'>
  480. <b>".$row1['game_name']."</b>
  481. </span>
  482. </span>
  483. </td>";
  484. }
  485. }
  486. $text_2 .= "
  487. </tr>
  488. </table>
  489. </td>
  490. </tr>";
  491.  
  492. $text_2 .= "<tr>";
  493.  
  494. $sql2 = new db;
  495. $sql2->db_Select(DB_TABLE_ROSTER_CUSTOM_ATTRIBUTE_ENTRIES, "*", "main_display = 2 ORDER BY attribute_order");
  496. while ($row2 = $sql2->db_Fetch()) {
  497.  
  498. if ($row2['attribute_id'] == 34) {
  499. $text_2 .= "
  500. <td class='forumheader3'>
  501. <span class='smalltext'>
  502. <center><b>".$row2['attribute_name']." $organization_name</b></center>
  503. </span>
  504. </td>";
  505. } else {
  506. $text_2 .= "
  507. <td class='forumheader3'>
  508. <span class='smalltext'>
  509. <center><b>".$row2['attribute_name']."</b></center>
  510. </span>
  511. </td>";
  512. }
  513. }
  514. $text_2 .= "</tr>";
  515.  
  516. if($sql2->db_Count(DB_TABLE_ROSTER_TEAM_MEMBERS, "(*)", "WHERE team_id = ".intval($row1['team_id'])) > 0) {
  517.  
  518. $sql3 = new db;
  519. $sql3->db_Select(DB_TABLE_ROSTER_TEAM_MEMBERS, "*", "team_id = ".intval($row1['team_id']).""); //removed ORDER BY member_team_order
  520. while($row3 = $sql3->db_Fetch()) {
  521.  
  522. $text_2 .="<tr>";
  523.  
  524. $sql4 = new db;
  525. $sql4->db_Select(DB_TABLE_ROSTER_CUSTOM_ATTRIBUTE_ENTRIES, "*", "main_display=2 ORDER BY attribute_order");
  526. while ($row4 = $sql4->db_Fetch()) {
  527.  
  528. $sql5 = new db;
  529. $sql5->db_Select(DB_TABLE_ROSTER_CUSTOM_ATTRIBUTE_VALUES, "*", "member_id = ".intval($row3['member_id'])."
  530. AND attribute_id = ".intval($row4['attribute_id']));
  531. while ($row5 = $sql5->db_Fetch()) {
  532. $member_id = $row5['member_id'];
  533. $attributeValue = $row5['attribute_value'];
  534. }
  535.  
  536. if ($row4['attribute_id'] == 1) {
  537.  
  538. if ($attributeValue == '') {
  539. $text_2 .= "
  540. <td class='forumheader3'>
  541. <span class='smalltext'>
  542. &nbsp;
  543. </span>
  544. </td>";
  545. } else {
  546. $text_2 .= "
  547. <td class='forumheader3'>
  548. <span class='smalltext'>
  549. <a href='member_profile.php?member_id=$member_id'>$attributeValue</a>
  550. </span>
  551. </td>";
  552. }
  553.  
  554. } else if ($row4['attribute_id'] == 2) {
  555.  
  556. if ($attributeValue == '') {
  557. $text_2 .= "
  558. <td class='forumheader3'>
  559. <span class='smalltext'>
  560. &nbsp;
  561. </span>
  562. </td>";
  563. } else {
  564. $text_2 .= "
  565. <td class='forumheader3'>
  566. <span class='smalltext'>
  567. <a href='member_profile.php?member_id=$member_id'>$attributeValue</a>
  568. </span>
  569. </td>";
  570. }
  571.  
  572. } else if ($row4['attribute_id'] == 4) {
  573.  
  574. $sql5 = new db;
  575. $sql5->db_Select(DB_TABLE_ROSTER_MEMBER_STATUS, "*", "status_name = '".$tp->toDB($attributeValue)."'");
  576. while ($row5 = $sql5->db_Fetch()) {
  577. $textColor = $row5['text_color'];
  578. }
  579.  
  580. if ($attributeValue == '') {
  581. $text_2 .= "
  582. <td class='forumheader3'>
  583. <span class='smalltext'>
  584. &nbsp;
  585. </span>
  586. </td>";
  587. } else {
  588. $text_2 .= "
  589. <td class='forumheader3'>
  590. <span style='color: $textColor' class='smalltext'>
  591. <center><b>$attributeValue</b></center>
  592. </span>
  593. </td>";
  594. }
  595.  
  596. } else if ($row4['attribute_id'] == 5) {
  597.  
  598. $sql5 = new db;
  599. $sql5->db_Select(DB_TABLE_ROSTER_LEADER_STATUS, "*", "status_name = '".$tp->toDB($attributeValue)."'");
  600. while ($row5 = $sql5->db_Fetch()) {
  601. $textColor = $row5['text_color'];
  602. }
  603.  
  604. if ($attributeValue == '') {
  605. $text_2 .= "
  606. <td class='forumheader3'>
  607. <span class='smalltext'>
  608. &nbsp;
  609. </span>
  610. </td>";
  611. } else {
  612. $text_2 .= "
  613. <td class='forumheader3'>
  614. <span style='color: $textColor' class='smalltext'>
  615. <b>$attributeValue</b>
  616. </span>
  617. </td>";
  618. }
  619.  
  620. } else if ($row4['attribute_id'] == 8) {
  621.  
  622. if ($attributeValue == '') {
  623. $text_2 .= "
  624. <td class='forumheader3'>
  625. <span class='smalltext'>
  626. &nbsp;
  627. </span>
  628. </td>";
  629. } else {
  630. $text_2 .= "
  631. <td class='forumheader3'>
  632. <span class='smalltext'>
  633. <a href='mailto:$attributeValue'>".LAN_JBROSTER_GENERAL_EMAIL."</a>
  634. </span>
  635. </td>";
  636. }
  637.  
  638. } else if ($row4['attribute_id'] == 9) {
  639.  
  640. if ($attributeValue == '') {
  641. $text_2 .= "
  642. <td class='forumheader3'>
  643. <span class='smalltext'>
  644. &nbsp;
  645. </span>
  646. </td>";
  647. } else {
  648. $text_2 .= "
  649. <td class='forumheader3'>
  650. <span class='smalltext'>
  651. <a href='http://profile.xfire.com/$attributeValue' target='_blank'>$attributeValue</a>
  652. </span>
  653. </td>";
  654. }
  655.  
  656. } else if ($row4['attribute_id'] == 15) {
  657.  
  658. if ($attributeValue == '') {
  659. $text_2 .= "
  660. <td class='forumheader3'>
  661. <span class='smalltext'>
  662. &nbsp;
  663. </span>
  664. </td>";
  665. } else {
  666.  
  667. $calcAge = calc_age($attributeValue);
  668.  
  669. $text_2 .= "
  670. <td class='forumheader3'>
  671. <span class='smalltext'>
  672. <center>
  673. <b>$calcAge</b>
  674. </center>
  675. </span>
  676. </td>";
  677. }
  678.  
  679. } else if ($row4['attribute_id'] == 49) {
  680.  
  681. if ($attributeValue == '') {
  682. $text_2 .= "
  683. <td class='forumheader3'>
  684. <span class='smalltext'>
  685. &nbsp;
  686. </span>
  687. </td>";
  688. } else {
  689.  
  690. $text_2 .= "
  691. <td class='forumheader3'>
  692. <span class='smalltext'>
  693. <b><P ALIGN='right'>";
  694. if($attributeValue == 0) {
  695. $text_2 .= "
  696. &nbsp;";
  697. } else {
  698. $text_2 .=
  699. date("m/d/Y", $attributeValue);
  700. }
  701. $text_2 .= "
  702. </p></b>
  703. </span>
  704. </td>";
  705. }
  706.  
  707. } else if ($row4['attribute_id'] == 3) {
  708.  
  709. $sql5 = new db;
  710. $sql5->db_Select(DB_TABLE_ROSTER_TEAM_STATUS, "*", "status_name = '".$tp->toDB($row3['member_team_status'])."'
  711. AND game_name = '".$tp->toDB($row3['game_name'])."'");
  712. while ($row5 = $sql5->db_Fetch()) {
  713. $text_color = $row5['text_color'];
  714. }
  715.  
  716. $text_2 .= "
  717. <td width='33%' class='forumheader3'>
  718. <span style='color: $text_color;' class='smalltext'>
  719. <center>
  720. <b>".$row3['member_team_status']."</b>
  721. </center>
  722. </span>
  723. </td>";
  724.  
  725. } else {
  726.  
  727. if ($attributeValue == '') {
  728.  
  729. $text_2 .= "
  730. <td class='forumheader3'>
  731. <span class='smalltext'>
  732. &nbsp;
  733. </span>
  734. </td>";
  735. } else {
  736.  
  737. $text_2 .= "
  738. <td class='forumheader3'>
  739. <span class='smalltext'>
  740. <b>$attributeValue</b>
  741. </span>
  742. </td>";
  743. }
  744. }
  745. }
  746. }
  747.  
  748. } else {
  749. $text_2 .= "<tr>
  750. <td colspan=20 class='forumheader3'>
  751. <span class='smalltext'>
  752. <center>
  753. <p>
  754. ".LAN_JBROSTER_MAIN_PAGE_NO_MEMBERS_UNIT." $organization_unit_designation_name
  755. </p>
  756. </center>
  757. </span>
  758. </td>";
  759. }
  760.  
  761. $text_2 .= "
  762. </tr>
  763. </table>
  764. </div>
  765. </p>
  766. <center>";
  767. }
  768.  
  769. if(file_exists(e_LANGUAGE == "English")) {
  770. $title = "$organization_name ".$organization_unit_designation_name."s";
  771. } else {
  772. $title = "$organization_name ".$organization_unit_designation_name."s";
  773. }
  774. $ns->tablerender($title, $text_2);
  775. }
  776.  
  777. /************************************************************
  778. *
  779. * Display Organization Members By Status
  780. *
  781. ************************************************************/
  782.  
  783. if (($sql->db_Count(DB_TABLE_ROSTER_MEMBER_STATUS, "(*)", "WHERE display = 2") == 0) ||
  784. ($sql->db_Count(DB_TABLE_ROSTER_CUSTOM_ATTRIBUTE_ENTRIES, "(*)", "WHERE main_display = 2") == 0)) {
  785. // Don't display teams block
  786. } else {
  787. $sql1 = new db;
  788. $sql1->db_Select(DB_TABLE_ROSTER_MEMBER_STATUS, "*", "display = 2 ORDER BY status_order");
  789. while($row1 = $sql1->db_Fetch()) {
  790.  
  791. $text_3 .= "
  792. <center>
  793. <p>
  794. <div style='width:80%; margin-top: 2em; margin-bottom: 2em'>
  795. <table style='width:100%' class='fborder' cellspacing='0' cellpadding='0'>
  796. <tr>
  797. <td colspan=20>
  798. <table width='100%' cellspacing='0' cellpadding='0'>
  799. <tr>
  800. <td colspan=20 width='100%' class='forumheader'>
  801. <span class='smalltext'>
  802. <center>";
  803.  
  804. if(file_exists(e_LANGUAGE == "English")) {
  805. $text_3 .= "
  806. <b>".$row1['status_name']."s</b>";
  807. } else {
  808. $text_3 .= "
  809. <b>".$row1['status_name']."s</b>";
  810. }
  811.  
  812. $text_3 .= "
  813. </center>
  814. </span>
  815. </td>
  816. </tr>
  817. <tr>";
  818.  
  819. $sql2 = new db;
  820. $sql2->db_Select(DB_TABLE_ROSTER_CUSTOM_ATTRIBUTE_ENTRIES, "*", "main_display = 2 ORDER BY attribute_order");
  821. while ($row2 = $sql2->db_Fetch()) {
  822.  
  823. if ($row2['attribute_id'] == 3) {
  824. // Don't display 'Team Status'
  825. } else {
  826.  
  827. if ($row2['attribute_id'] == 34) {
  828. $text_3 .= "
  829. <td class='forumheader3'>
  830. <span class='smalltext'>
  831. <center><b>".$row2['attribute_name']." $organization_name</b></center>
  832. </span>
  833. </td>";
  834. } else {
  835. $text_3 .= "
  836. <td class='forumheader3'>
  837. <span class='smalltext'>
  838. <center><b>".$row2['attribute_name']."</b></center>
  839. </span>
  840. </td>";
  841. }
  842. }
  843. }
  844.  
  845. $text_3 .= "</tr>";
  846.  
  847. if(($sql2->db_Count(DB_TABLE_ROSTER_MEMBERS, "(*)", "WHERE member_status = '".$tp->toDB($row1['status_name'])."'")) > 0) {
  848.  
  849. $sql3 = new db;
  850. $sql3->db_Select(DB_TABLE_ROSTER_MEMBERS, "*", "member_status = '".$tp->toDB($row1['status_name'])."' ORDER BY nickname");
  851. while($row3 = $sql3->db_Fetch()) {
  852.  
  853. $text_3 .="<tr>";
  854.  
  855. $sql4 = new db;
  856. $sql4->db_Select(DB_TABLE_ROSTER_CUSTOM_ATTRIBUTE_ENTRIES, "*", "main_display = 2 ORDER BY attribute_order");
  857. while ($row4 = $sql4->db_Fetch()) {
  858.  
  859.  
  860. $sql5 = new db;
  861. $sql5->db_Select(DB_TABLE_ROSTER_CUSTOM_ATTRIBUTE_VALUES, "*", "member_id = ".intval($row3['member_id'])."
  862. AND attribute_id = ".intval($row4['attribute_id']));
  863. while ($row5 = $sql5->db_Fetch()) {
  864. $member_id = $row5['member_id'];
  865. $attributeValue = $row5['attribute_value'];
  866. }
  867.  
  868. if ($row4['attribute_id'] == 1) {
  869.  
  870. if ($attributeValue == '') {
  871. $text_3 .= "
  872. <td class='forumheader3'>
  873. <span class='smalltext'>
  874. &nbsp;
  875. </span>
  876. </td>";
  877. } else {
  878. $text_3 .= "
  879. <td class='forumheader3'>
  880. <span class='smalltext'>
  881. <a href='member_profile.php?member_id=$member_id'>$attributeValue</a>
  882. </span>
  883. </td>";
  884. }
  885.  
  886. } else if ($row4['attribute_id'] == 2) {
  887.  
  888. if ($attributeValue == '') {
  889. $text_3 .= "
  890. <td class='forumheader3'>
  891. <span class='smalltext'>
  892. &nbsp;
  893. </span>
  894. </td>";
  895. } else {
  896. $text_3 .= "
  897. <td class='forumheader3'>
  898. <span class='smalltext'>
  899. <a href='member_profile.php?member_id=$member_id'>$attributeValue</a>
  900. </span>
  901. </td>";
  902. }
  903.  
  904. } else if ($row4['attribute_id'] == 3) {
  905. // Don't display 'Team Status'
  906. } else if ($row4['attribute_id'] == 4) {
  907.  
  908. $sql5 = new db;
  909. $sql5->db_Select(DB_TABLE_ROSTER_MEMBER_STATUS, "*", "status_name = '".$tp->toDB($attributeValue)."'");
  910. while ($row5 = $sql5->db_Fetch()) {
  911. $textColor = $row5['text_color'];
  912. }
  913.  
  914. if ($attributeValue == '') {
  915. $text_3 .= "
  916. <td class='forumheader3'>
  917. <span class='smalltext'>
  918. &nbsp;
  919. </span>
  920. </td>";
  921. } else {
  922. $text_3 .= "
  923. <td class='forumheader3'>
  924. <span style='color: $textColor' class='smalltext'>
  925. <b>$attributeValue</b>
  926. </span>
  927. </td>";
  928. }
  929.  
  930. } else if ($row4['attribute_id'] == 5) {
  931.  
  932. $sql5 = new db;
  933. $sql5->db_Select(DB_TABLE_ROSTER_LEADER_STATUS, "*", "status_name = '".$tp->toDB($attributeValue)."'");
  934. while ($row5 = $sql5->db_Fetch()) {
  935. $textColor = $row5['text_color'];
  936. }
  937.  
  938. if ($attributeValue == '') {
  939. $text_3 .= "
  940. <td class='forumheader3'>
  941. <span class='smalltext'>
  942. &nbsp;
  943. </span>
  944. </td>";
  945. } else {
  946. $text_3 .= "
  947. <td class='forumheader3'>
  948. <span style='color: $textColor' class='smalltext'>
  949. <b>$attributeValue</b>
  950. </span>
  951. </td>";
  952. }
  953.  
  954. } else if ($row4['attribute_id'] == 8) {
  955.  
  956. if ($attributeValue == '') {
  957. $text_3 .= "
  958. <td class='forumheader3'>
  959. <span class='smalltext'>
  960. &nbsp;
  961. </span>
  962. </td>";
  963. } else {
  964. $text_3 .= "
  965. <td class='forumheader3'>
  966. <span class='smalltext'>
  967. <a href='mailto:$attributeValue'>".LAN_JBROSTER_GENERAL_EMAIL."</a>
  968. </span>
  969. </td>";
  970. }
  971.  
  972. } else if ($row4['attribute_id'] == 9) {
  973.  
  974. if ($attributeValue == '') {
  975. $text_3 .= "
  976. <td class='forumheader3'>
  977. <span class='smalltext'>
  978. &nbsp;
  979. </span>
  980. </td>";
  981. } else {
  982. $text_3 .= "
  983. <td class='forumheader3'>
  984. <span class='smalltext'>
  985. <a href='http://profile.xfire.com/$attributeValue' target='_blank'>$attributeValue</a>
  986. </span>
  987. </td>";
  988. }
  989.  
  990. } else if ($row4['attribute_id'] == 15) {
  991.  
  992. if ($attributeValue == '') {
  993. $text_3 .= "
  994. <td class='forumheader3'>
  995. <span class='smalltext'>
  996. &nbsp;
  997. </span>
  998. </td>";
  999. } else {
  1000.  
  1001. $calcAge = calc_age($attributeValue);
  1002.  
  1003. $text_3 .= "
  1004. <td class='forumheader3'>
  1005. <span class='smalltext'>
  1006. <center>
  1007. <b>$calcAge</b>
  1008. </center>
  1009. </span>
  1010. </td>";
  1011. }
  1012.  
  1013. } else if ($row4['attribute_id'] == 49) {
  1014.  
  1015. if ($attributeValue == '') {
  1016. $text_3 .= "
  1017. <td class='forumheader3'>
  1018. <span class='smalltext'>
  1019. &nbsp;
  1020. </span>
  1021. </td>";
  1022. } else {
  1023. $text_3 .= "
  1024. <td class='forumheader3'>
  1025. <span class='smalltext'>
  1026. <b>";
  1027. if($attributeValue == 0) {
  1028. $text_3 .= "
  1029. &nbsp;";
  1030. } else {
  1031. $text_3 .=
  1032. date("m/d/Y", $attributeValue);
  1033. }
  1034. $text_3 .= "
  1035. </b>
  1036. </span>
  1037. </td>";
  1038. }
  1039.  
  1040. } else {
  1041.  
  1042. if ($attributeValue == '') {
  1043.  
  1044. $text_3 .= "
  1045. <td class='forumheader3'>
  1046. <span class='smalltext'>
  1047. &nbsp;
  1048. </span>
  1049. </td>";
  1050. } else {
  1051.  
  1052. $text_3 .= "
  1053. <td class='forumheader3'>
  1054. <span class='smalltext'>
  1055. <b>$attributeValue</b>
  1056. </span>
  1057. </td>";
  1058. }
  1059. }
  1060. }
  1061. }
  1062.  
  1063. } else {
  1064.  
  1065. $text_3 .= "
  1066. <tr>
  1067. <td colspan=20 class='forumheader3'>
  1068. <span class='smalltext'>
  1069. <center>
  1070. <p>
  1071. ".LAN_JBROSTER_MAIN_PAGE_NO_MEMBERS_STATUS."
  1072. </p>
  1073. </center>
  1074. </span>
  1075. </td>
  1076. </tr>";
  1077. }
  1078.  
  1079. $text_3 .= "
  1080. </tr>
  1081. </table>
  1082. </td>
  1083. </tr>
  1084. </table>
  1085. </div>
  1086. </p>
  1087. </center>";
  1088.  
  1089. $count++;
  1090. }
  1091.  
  1092. $title = "";
  1093. $ns->tablerender($title, $text_3);
  1094. }
  1095.  
  1096. require_once(FOOTERF);
  1097. ?>
  1098.  
  1099.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement