Advertisement
TheCobyLot

Untitled

Feb 10th, 2018
591
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.11 KB | None | 0 0
  1. <?php
  2. require '../theme/sub.head.php';
  3.  
  4. # get last word of url
  5. $profilewho = $_SERVER['REQUEST_URI'];
  6. preg_match("/[^\@]+$/", $profilewho, $matches);
  7. $usernameurl = $matches[0];
  8. $Origin->profileDetails($usernameurl);
  9.  
  10.  
  11. $sql = mysqli_connect("localhost", "root", "", "new");
  12. $data = mysqli_query($sql, "SELECT * FROM `user_post` WHERE userID =".$_SESSION['id']." ORDER BY postDateTime DESC LIMIT 1 ");
  13. $data5 = mysqli_query($sql, "SELECT hireworker_application.*, worker.firstname as wf, worker.lastname as wl, worker.workerAddress as wa, user.* FROM hireworker_application INNER JOIN user ON hireworker_application.userID = user.id INNER JOIN worker ON hireworker_application.workerID = worker.id WHERE hireworker_application.userID = ".$_SESSION['id']."");
  14. // $data2 = mysqli_query($sql, "SELECT user.*, worker.*, user_comment.* FROM `user_comment` INNER JOIN user ON user_comment.userID = ".$_SESSION['id']." INNER JOIN worker ON user_comment.workerID=worker.id WHERE user_comment.userID=".$_SESSION['id']." ");
  15. $data2 = mysqli_query($sql, "SELECT * FROM user_comment WHERE userID = ".$_SESSION['id']." AND commentPerson = 'Client' ORDER BY commentDate DESC LIMIT 2");
  16. $data4 = mysqli_query($sql,
  17. "SELECT application.* , worker.*, user_post.* FROM application
  18. INNER JOIN worker ON application.worker_id = worker.id
  19. INNER JOIN user_post ON application.post_id = user_post.postID
  20. WHERE application.user_id = ".$_SESSION['id']." AND application.applicationStatus = 'finished' ORDER BY applicationID DESC
  21. LIMIT 1
  22. ");
  23. ?>
  24.  
  25.  
  26. <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
  27. <body>
  28. <?php
  29. require '../theme/navigation.client.php';
  30. ?>
  31. <?php
  32. if($usernameurl==$Origin->username){ ?>
  33. <div class="gtco-client" style="margin-top: -8%;">
  34.  
  35. <div class="gtco-services gtco-section">
  36. <div class="col-md-12 col-sm-4 service-wrap">
  37. <div class="service" style="height: auto;">
  38. <div style="height: 100%;"><a class="btn" name="profname"><p style="color:#17B794"><b><?php echo ucwords($Origin->profileFNAME); echo " "; echo ucwords($Origin->profileMNAME); echo " "; echo ucwords($Origin->profileLNAME); ?></b></p></a></div><br>
  39. <div><b><i class="ti-star"></i> 4/5</b></div><br>
  40. <div><img src="../theme/images/<?php echo $Origin->profilePIC; ?>" alt="Avatar" style="width:200px; height: 200px; border-radius:50%; border: 6px solid #17B794;"></div>
  41. <div><b style="color: #17B794;">@<?php echo $Origin->profileUNAME;?></b></div>
  42. <div style="font-size: 12px;"><b><i class="ti-location-pin"></i> Basak Mandaue Cebu City</b></div>
  43. <div style="font-size: 12px;"><b><i class="ti-mobile"></i><?php echo $Origin->profileCONTACT; ?></b></div><br>
  44. <?php
  45. echo '<a target="_blank" class="btn btn-primary" data-toggle="modal" data-target="#myModal">EDIT</a>';
  46. }else{
  47. echo '<script>window.location= "../c/@'.$Origin->username.'"</script>';
  48. }
  49. ?>
  50. </div>
  51.  
  52. </div>
  53. <?php if($usernameurl == $Origin->username){ ?>
  54. <div class="col-md-4 col-sm-4 service-wrap">
  55. <div class="service" style="height: 100%">
  56. <div><a href="activities?@<?php echo $Origin->profileUNAME;?>" class="btn"><i class="ti-check-box"></i> ACTIVITIES </a></div><br>
  57.  
  58. <?php while($row2 = mysqli_fetch_array($data)){ ?>
  59. <div class="service" >
  60. <p >STATUS: <?php echo $row2['status']; ?>
  61. <span style="float: right;">Date: <?php echo $row2['postDateTime'];?></span>
  62. <br/>
  63. <span><b class="" style="float: left;">Posted By: <a href="#profname"><?php echo ucfirst($Origin->profileFNAME); ?> <?php echo ucfirst($Origin->profileMNAME); ?></a></b></span><br/>
  64. <span><b class="">Looking for:</b> <?php echo ucfirst($row2['postTitle']); ?></span><br/>
  65. <span><b class="">In need of:</b> <?php echo ucfirst($row2['postCategory']); ?></span><br/>
  66. <div style="max-width: 100%; word-break: break-all;"><b class="" style="float: left;">Description:</b><br/><?php echo ucfirst($row2['postDesc']); ?></div><br/><p>
  67. <iframe
  68. width="100%"
  69. height="250"
  70. frameborder="0"
  71. scrolling="no"
  72. marginheight="0"
  73. marginwidth="0"
  74. src="https://maps.google.com/maps?q=+<?php echo $row2["postLong"];?>+,+<?php echo $row2["postLat"];?>+&hl=es;z=14&amp;output=embed"
  75. ></iframe>
  76.  
  77. <!-- <a target="_blank" class="btn btn-block btn-primary">FINISH</a> -->
  78. </div>
  79. <?php }?>
  80.  
  81. </div>
  82. </div>
  83.  
  84.  
  85. <div class="col-md-4 col-sm-4 service-wrap">
  86. <div class="service" style="height: 100%">
  87. <div><a class="btn" href="comments"><i class="ti-comments"></i> COMMENTS </a></div><br>
  88. <?php while($row3= mysqli_fetch_array($data2)){
  89. $data3 = mysqli_query($sql, "SELECT * FROM worker WHERE id = ".$row3['workerID']." ");
  90. $row4 = mysqli_fetch_array($data3);
  91.  
  92. ?>
  93. <div class="service" >
  94.  
  95. <center><a href="workerprofile?id=<?php echo $row4['id'];?>"><img src="../theme/images/1.jpg" style="width:50px; height: 50px; border-radius:50%; border: 6px solid #17B794;"></a></center>
  96. <span style="font-size: 15px; color: #17B794;"><?php echo ucfirst($row4['firstname']);?> <?php echo ucfirst($row4['lastname']);?></span><br>
  97. <span style="font-size: 10px; color: #17B794;"><?php echo ucfirst($row3['commentDate']);?></span>
  98. <center><div ><?php echo $row3['commentPost']; ?></div></center>
  99. </div>
  100. <?php }?>
  101. </div>
  102. </div>
  103.  
  104. <div class="col-md-4 col-sm-4 service-wrap">
  105. <div class="service" style="height: 100%">
  106. <div><a class="btn" href="history"><i class="ti-harddrives"></i> HISTORY </a></div><br>
  107. <?php while($row5 = mysqli_fetch_array($data4)){ ?>
  108. <div class="service" >
  109. <br/>
  110. <p><i class="ti-announcement"></i> Successful transaction (NORMAL) </p>
  111. <a href="workerprofile?id=<?php echo $row5['id'];?>"><img src="../theme/images/1.jpg" style="width:50px; height: 50px; border-radius:50%; border: 6px solid #17B794;"></a><br/>
  112. <span style="font-size: 15px; color: #17B794;">
  113. <i class="ti-user"></i> <?php echo $row5['firstname']." ". $row5['lastname'];?></span><br>
  114. <i class="ti-check"></i> Post ID: <?php echo $row5['post_id'];?><br/>
  115. <i class="ti-check"></i> Application ID: <?php echo $row5['applicationID'];?><br/>
  116. <iframe src="https://www.google.com/maps/embed/v1/directions?origin=<?php echo $row5 ['postLocation'];?>&destination=<?php echo $row5['workerAddress']; ?>&key=AIzaSyBSMUrTfFC8nrU3dXgN_TvD3YfsuD-1bu4" width="100%" height="250" frameborder="0" style="border: 0;" allowfullscreen></iframe>
  117. </div>
  118. <?php }?>
  119. <?php while($row6 = mysqli_fetch_array($data5)){
  120. if($row6['dateFinished']=='Yes'){
  121. ?>
  122. <div class="service" >
  123. <br/>
  124. <p><i class="ti-announcement"></i> Successful transaction (URGENT) </p>
  125. <a href="workerprofile?id=<?php echo $row5['id'];?>"><img src="../theme/images/1.jpg" style="width:50px; height: 50px; border-radius:50%; border: 6px solid #17B794;"></a><br/>
  126. <span style="font-size: 15px; color: #17B794;">
  127. <i class="ti-user"></i> <?php echo $row6['wf']." ". $row6['wl'];?></span><br>
  128. <i class="ti-check"></i> WORKER ID: <?php echo $row6['workerID'];?><br/>
  129. <i class="ti-check"></i> HIRE ID: <?php echo $row6['hireID'];?><br/>
  130. <iframe src="https://www.google.com/maps/embed/v1/directions?origin=<?php echo $row6['user_address'];?>&destination=<?php echo $row6['wa']; ?>&key=AIzaSyBSMUrTfFC8nrU3dXgN_TvD3YfsuD-1bu4" width="100%" height="250" frameborder="0" style="border: 0;" allowfullscreen></iframe>
  131. </div>
  132.  
  133. <?php } }?>
  134.  
  135. </div>
  136. </div>
  137.  
  138. </div>
  139.  
  140. </div>
  141. </div>
  142. <?php }else{?>
  143.  
  144.  
  145.  
  146. </div>
  147.  
  148. </div>
  149. </div>
  150. <?php
  151. } require '../theme/footer.php';
  152. ?>
  153. <!-- MODAL HERE -->
  154. <div class="modal fade" id="myModal" role="dialog">
  155. <div class="modal-dialog">
  156.  
  157. <!-- Modal content-->
  158. <form class="form-horizontal" action="../functions/query.updateprofile.php" enctype="multipart/form-data" method="POST">
  159. <div class="modal-content">
  160. <div class="modal-header">
  161. <button type="button" class="close" data-dismiss="modal">&times;</button>
  162. <h4 class="modal-title">Edit Credentials</h4>
  163. </div>
  164. <div class="modal-body">
  165. <center><img src="../theme/images/<?php echo $Origin->profilePIC; ?>" alt="Avatar" style="width:200px; height: 200px; border-radius:50%; border: 6px solid #17B794;"><br/>
  166.  
  167. <label for="files" class="btn" name="imageU">Change Profile Picture</label>
  168. <input id="files" style="visibility:hidden;" type="file" accept="/*" name="imageU"></center>
  169. <div class="form-group">
  170. <label class="col-lg-3 control-label">First name:</label>
  171. <div class="col-lg-8">
  172. <input class="form-control" type="text" placeholder="Enter first name" name="firstname" value="<?php echo $Origin->profileFNAME; ?>">
  173. </div>
  174. </div>
  175. <div class="form-group">
  176. <label class="col-lg-3 control-label">Middle name:</label>
  177. <div class="col-lg-8">
  178. <input class="form-control" type="text" placeholder="Enter first name" name="middlename" value="<?php echo $Origin->profileMNAME; ?>">
  179. </div>
  180. </div>
  181. <div class="form-group">
  182. <label class="col-lg-3 control-label">Last name:</label>
  183. <div class="col-lg-8">
  184. <input class="form-control" type="text" placeholder="Enter last name" name="lastname" value="<?php echo $Origin->profileLNAME; ?>">
  185. </div>
  186. </div>
  187. <div class="form-group">
  188. <label class="col-lg-3 control-label">Email:</label>
  189. <div class="col-lg-8">
  190. <input class="form-control" type="text" placeholder="ex.abc@cde.com" name="email" value="<?php echo $Origin->email;?>">
  191. </div>
  192. </div>
  193. <div class="form-group">
  194. <label class="col-lg-3 control-label">Contact Number:</label>
  195. <div class="col-lg-8">
  196. <input class="form-control" type="text" placeholder="ex. 09xxxxxxxxx" name="contact" value="<?php echo $Origin->userContact;?>">
  197. </div>
  198. </div>
  199.  
  200. </div>
  201. <div class="modal-footer">
  202. <div class="form-group">
  203. <div class="col-md-8">
  204. <input type="submit" name="updateUserProf" value="Save changes" class="btn btn-primary">
  205. <span></span>
  206. <input type="button" class="btn btn-default" value="Cancel" data-dismiss="modal" id="myButton">
  207. </form>
  208. </div>
  209. </div>
  210. </div>
  211.  
  212. </div>
  213. </div>
  214. </div>
  215. <!-- END OF MODAL -->
  216.  
  217. <?php
  218. require '../theme/gototop.php';
  219. require '../theme/footscripts.php';
  220. ?>
  221. </body>
  222. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement