characters.php 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  1. <?php
  2. require_once($_SERVER['DOCUMENT_ROOT'] . "/modules/core/header.php");
  3. if(!isset($link))
  4. {
  5. $link = mysqli_connect(DB_SERVER, DB_USERNAME, DB_PASSWORD, DB_NAME);
  6. if($link === false)
  7. {
  8. die("ERROR: Could not connect.");
  9. }
  10. }
  11. $user_check_query = "SELECT `ID`, `Model`, `char_name` FROM `characters` WHERE `master` = '$playersqlid' LIMIT 6";
  12. $result = mysqli_query($link, $user_check_query);
  13. $char_count = $result->num_rows;
  14. if($char_count > 0)
  15. {
  16. $i = 0;
  17. while($result2 = mysqli_fetch_array($result, MYSQLI_ASSOC))
  18. {
  19. $chardata[$i] = $result2;
  20. $i++;
  21. }
  22. mysqli_free_result($result);
  23. }
  24. if($char_count != playerVariableCharacters())
  25. {
  26. $chars = array
  27. (
  28. array("N/A", -1, 0),
  29. array("N/A", -1, 0),
  30. array("N/A", -1, 0),
  31. array("N/A", -1, 0),
  32. array("N/A", -1, 0),
  33. array("N/A", -1, 0)
  34. );
  35. for($i = 0; $i < $char_count; ++$i)
  36. {
  37. $chars[$i][0] = $chardata[$i]['char_name'];
  38. $chars[$i][1] = $chardata[$i]['ID'];
  39. $chars[$i][2] = $chardata[$i]['Model'];
  40. $_SESSION['characters'] = $chars;
  41. }
  42. }
  43. $user_check_query = "SELECT `ID`, `char_name`, `skin` FROM `application` WHERE `master` = '$playersqlid' AND `status` < 2 LIMIT 1";
  44. $result = mysqli_query($link, $user_check_query);
  45. $app_count = $result->num_rows;
  46. if($app_count > 0)
  47. {
  48. $i = 0;
  49. while($result2 = mysqli_fetch_array($result, MYSQLI_ASSOC))
  50. {
  51. $appdata[$i] = $result2;
  52. $i++;
  53. }
  54. mysqli_free_result($result);
  55. }
  56. ?>
  57. <router-outlet _ngcontent-tnh-c136="" class="router-outlet"></router-outlet>
  58. <app-character-list _nghost-tnh-c142="">
  59. <div _ngcontent-tnh-c142="" class="content-header">
  60. <h3 _ngcontent-tnh-c142="" translate="">My Characters</h3>
  61. <app-button _ngcontent-tnh-c145="" caption="Freeze" icon="fa-file-contract" class="fl-ri blue margin-left-10" _nghost-tnh-c216="" onClick="changeCurrentPage('applications', '/panel/applications')">
  62. <div _ngcontent-tnh-c216="" class="btn-wrapper">
  63. <div _ngcontent-tnh-c216="" class="button">
  64. <div _ngcontent-tnh-c216="" class="icon"><i _ngcontent-tnh-c216="" class="fa fa-file-contract"></i></div>
  65. <!---->
  66. <div _ngcontent-tnh-c216="" class="caption">Application History</div>
  67. <!---->
  68. </div>
  69. <!---->
  70. </div>
  71. </app-button>
  72. <?php
  73. if(!$app_count && $char_count != 6)
  74. {
  75. ?>
  76. <app-button _ngcontent-tnh-c145="" caption="Freeze" icon="fa-user-plus" class="fl-ri green" _nghost-tnh-c216="" onClick="changeCurrentPage('create-character', '/panel/create-character')">
  77. <div _ngcontent-tnh-c216="" class="btn-wrapper">
  78. <div _ngcontent-tnh-c216="" class="button">
  79. <div _ngcontent-tnh-c216="" class="icon"><i _ngcontent-tnh-c216="" class="fa fa-user-plus"></i></div>
  80. <!---->
  81. <div _ngcontent-tnh-c216="" class="caption">New</div>
  82. <!---->
  83. </div>
  84. <!---->
  85. </div>
  86. </app-button>
  87. <?php
  88. }
  89. ?>
  90. </div>
  91. <div _ngcontent-tnh-c142="" class="content">
  92. <!---->
  93. <!---->
  94. <?php
  95. if($app_count > 0)
  96. {
  97. for($i = 0; $i < $app_count; ++$i)
  98. {
  99. for($x = 0; $x < sizeof($serverSkins); ++$x)
  100. {
  101. if($serverSkins[$x]["id"] == $appdata[$i]['skin'])
  102. {
  103. $appdata[$i]['skin'] = $serverSkins[$x]["name"];
  104. break;
  105. }
  106. }
  107. ?>
  108. <section _ngcontent-tnh-c142="" class="character_preview nopadding transparent csquarterthird frozen" onClick="changeCurrentPage('applications', '<?php echo $appdata[$i]['ID']; ?>', 4)" style="background-image: url(&quot;/assets/skins/<?php echo $appdata[$i]['skin']; ?>-380-600.png&quot;);">
  109. <h3 _ngcontent-tnh-c142="" class="section-header"> <?php echo $appdata[$i]['char_name']; ?> <i _ngcontent-tnh-c142="" class="fl-ri fa fa-fw fa-spinner fa-spin" style="margin-top: 5px;"></i> </h3>
  110. <div _ngcontent-tnh-c142="" class="character_ic_info">
  111. <span _ngcontent-tnh-c142="" class="app-info"> Your application for this character is being processed. <!--Your current position in the queue is {{ pending.queue }}.--> </span>
  112. </div>
  113. </section>
  114. <!---->
  115. <?php
  116. }
  117. }
  118. if($char_count > 0)
  119. {
  120. for($i = 0; $i < $char_count; ++$i)
  121. {
  122. $playerid = $chardata[$i]['ID'];
  123. $Model = $chardata[$i]['Model'];
  124. $userii = $chardata[$i]['char_name'];
  125. $charname = explode("_", $userii);
  126. for($x = 0; $x < sizeof($serverSkins); ++$x)
  127. {
  128. if($serverSkins[$x]["id"] == $Model)
  129. {
  130. $Model = $serverSkins[$x]["name"];
  131. break;
  132. }
  133. }
  134. ?>
  135. <section _ngcontent-tnh-c142="" class="character_preview csquarterthird" tabindex="0" onClick="changeCurrentPage('characters', '<?php echo $userii; ?>', 1)" style="background-image: url(&quot;/assets/skins/<?php echo $Model; ?>-380-600.png&quot;);">
  136. <div _ngcontent-tnh-c142="" class="card-title flexy"><span _ngcontent-tnh-c142="" class="color-grey margin-right-10"><?php echo $playerid; ?></span><span _ngcontent-tnh-c142="" style="flex-grow: 1;"><?php echo $charname[0]; ?></span>
  137. <!--<app-activity-indicator _ngcontent-tnh-c142="" class="fl-ri" _nghost-tnh-c218=""><i _ngcontent-tnh-c218="" class="<?php echo returnActivityIcon($averagehours); ?>" title="<?php echo $averagehours; ?> h/d"></i></app-activity-indicator>-->
  138. <!---->
  139. <!---->
  140. </div>
  141. <div _ngcontent-tnh-c142="" class="character_ic_info">
  142. <?php
  143. $user_check_query = "SELECT `id`, `posx`, `posy` FROM `houses` WHERE `owner` = '$userii' ORDER BY ID ASC LIMIT 1";
  144. $result2 = mysqli_query($link, $user_check_query);
  145. $house_count = $result2->num_rows;
  146. if($house_count > 0)
  147. {
  148. $house_data = mysqli_fetch_array($result2, MYSQLI_ASSOC);
  149. $houseid = $house_data['id'];
  150. $str = returnStreet($house_data['posx'], $house_data['posy'], $streets);
  151. $area = qomaLokacionin($house_data['posx'], $house_data['posy'], $zonat);
  152. $area_code = ReturnAreaCodeByName($area);
  153. $city = GetCity($house_data['posx'], $house_data['posy'], $cities);
  154. ?>
  155. <span _ngcontent-tnh-c142="" class="fl-ri" *ngIf="character.address"> <span _ngcontent-tnh-c142="" class="key" translate>ADDRESS</span> <span _ngcontent-tnh-c142="" class="value"><?php echo $houseid; ?> <?php echo $str; ?><br><?php echo $area; ?> <?php echo $area_code; ?><br><?php echo $city; ?><br> <ng-container *ngIf="character.address.apartment"> <br> </ng-container> <br> </span> </span>
  156. <?php
  157. }
  158. mysqli_free_result($result2);
  159. ?>
  160. <!--<span _ngcontent-tnh-c142="" class="fl-ri" *ngIf="character.address"> <span _ngcontent-tnh-c142="" class="key" translate>1</span> <span _ngcontent-tnh-c142="" class="value">1<br> <ng-container *ngIf="character.address.apartment"> APT. 1 <br> </ng-container> 2<br> 3</span> </span>-->
  161. <!----><span _ngcontent-tnh-c142="" class="fl-le"><span _ngcontent-tnh-c142="" translate="" class="key">id n.o.</span><span _ngcontent-tnh-c142="" class="value"><?php echo $playerid; ?></span><span _ngcontent-tnh-c142="" translate="" class="key">Last Name</span><span _ngcontent-tnh-c142="" class="value"><?php echo $charname[1]; ?></span><span _ngcontent-tnh-c142="" translate="" class="key">First Name</span><span _ngcontent-tnh-c142="" class="value"><?php echo $charname[0]; ?></span></span>
  162. </div>
  163. </section>
  164. <!---->
  165. <?php
  166. }
  167. }
  168. if($char_count + $app_count == 0)
  169. {
  170. ?>
  171. <section _ngcontent-tnh-c142="" class="cs-1 section-border-gradient transparent"> It looks like you don't have a character yet! Character is a factional person in the Los Santos universe, with its own story, memory and possessions. You can create one by submitting an application and writing out a short background story about how your character came to be and what's their role in Los Santos. <br _ngcontent-tnh-c142="">
  172. <app-button _ngcontent-tnh-c142="" icon="fa-plus-circle" caption="Create my first character" routerlink="/panel/characters/new" onClick="changeCurrentPage('create-character', '/panel/create-character')" class="green margin-top-20" _nghost-tnh-c216="" tabindex="0">
  173. <div _ngcontent-tnh-c216="" class="btn-wrapper">
  174. <div _ngcontent-tnh-c216="" class="button">
  175. <div _ngcontent-tnh-c216="" class="icon"><i _ngcontent-tnh-c216="" class="fa fa-plus-circle"></i></div>
  176. <!---->
  177. <div _ngcontent-tnh-c216="" class="caption">Create my first character</div>
  178. <!---->
  179. </div>
  180. <!---->
  181. </div>
  182. </app-button>
  183. </section>
  184. <?php
  185. }
  186. ?>
  187. </div>
  188. </app-character-list>
  189. <?php mysqli_close($link); ?>