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

/detaillegal.php

https://bitbucket.org/Iowane_Tamani/feejeetrav
PHP | 400 lines | 142 code | 43 blank | 215 comment | 3 complexity | b20a1cea338de44c6b56a1c5a84da016 MD5 | raw file
  1. <?php
  2. session_start();
  3. include_once"config.php";
  4. if(!isset($_SESSION['username']) || !isset($_SESSION['password'])){
  5. header("Location: login.php");
  6. }else{
  7. //$fetch_users_data = mysql_fetch_object(mysql_query("SELECT * FROM `members` WHERE username='".$_SESSION['username']."'"));
  8. }
  9. ?>
  10. <?php
  11. header('Content-Type: text/html; charset=utf8_general_ci');
  12. $id = $_GET['id'];
  13. mysqli_set_charset($conn,"utf8");
  14. //$result = $conn->query("SELECT * FROM event WHERE eventmulti_id = '$id'");
  15. ?>
  16. <!doctype html>
  17. <html lang="en">
  18. <head>
  19. <meta charset="utf-8"/>
  20. <title>Detail Legal</title>
  21. <link rel="stylesheet" href="css/layout.css" type="text/css" media="screen" />
  22. <link rel="stylesheet" href="css/style.css">
  23. <!--[if lt IE 9]>
  24. <link rel="stylesheet" href="css/ie.css" type="text/css" media="screen" />
  25. <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
  26. <![endif]-->
  27. <script src="js/jquery-1.5.2.min.js" type="text/javascript"></script>
  28. <script src="js/hideshow.js" type="text/javascript"></script>
  29. <script src="js/jquery.tablesorter.min.js" type="text/javascript"></script>
  30. <script type="text/javascript" src="js/jquery.equalHeight.js"></script>
  31. <script type="text/javascript">
  32. $(document).ready(function()
  33. {
  34. $(".tablesorter").tablesorter();
  35. }
  36. );
  37. $(document).ready(function() {
  38. //When page loads...
  39. $(".tab_content").hide(); //Hide all content
  40. $("ul.tabs li:first").addClass("active").show(); //Activate first tab
  41. $(".tab_content:first").show(); //Show first tab content
  42. //On Click Event
  43. $("ul.tabs li").click(function() {
  44. $("ul.tabs li").removeClass("active"); //Remove any "active" class
  45. $(this).addClass("active"); //Add "active" class to selected tab
  46. $(".tab_content").hide(); //Hide all tab content
  47. var activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content
  48. $(activeTab).fadeIn(); //Fade in the active ID content
  49. return false;
  50. });
  51. $("ul.tabs li").click(function() {
  52. $("ul.tabs li").removeClass("active"); //Remove any "active" class
  53. $(this).addClass("active"); //Add "active" class to selected tab
  54. $(".tab_content").hide(); //Hide all tab content
  55. var activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content
  56. $(activeTab).fadeIn(); //Fade in the active ID content
  57. return false;
  58. });
  59. });
  60. </script>
  61. <script type="text/javascript">
  62. $(function(){
  63. $('.column').equalHeight();
  64. });
  65. </script>
  66. <!-- Function for Showing FileUpload option -->
  67. <script type="text/javascript">
  68. function ShowHideDiv(chkImage) {
  69. var dvPassport = document.getElementById("dvPassport");
  70. dvPassport.style.display = chkImage.checked ? "block" : "none";
  71. }
  72. function ShowHideDivChin(chkImage) {
  73. var dvChin = document.getElementById("dvChin");
  74. dvChin.style.display = chkImage.checked ? "block" : "none";
  75. }
  76. function ShowHideDivJap(chkImage) {
  77. var dvJap = document.getElementById("dvJap");
  78. dvJap.style.display = chkImage.checked ? "block" : "none";
  79. }
  80. </script>
  81. </head>
  82. <body>
  83. <header id="header">
  84. <hgroup>
  85. <h1 class="site_title"><a href="index.php">Feejee Traveller</a></h1>
  86. <h2 class="section_title">Detail Legal</h2>
  87. </hgroup>
  88. </header> <!-- end of header bar -->
  89. <section id="secondary_bar">
  90. <div class="user">
  91. <!-- <a class="logout_user" href="#" title="Logout">Logout</a> -->
  92. </div>
  93. <div class="breadcrumbs_container">
  94. <article class="breadcrumbs"><a href="index.php">Feejee Traveller</a> <div class="breadcrumb_divider"></div> <a class="current">Detail Legal</a></article>
  95. </div>
  96. </section><!-- end of secondary bar -->
  97. <?php include('navBar.php'); ?>
  98. <section id="main" class="column">
  99. <div class="clear"></div>
  100. <article class="module width_full">
  101. <header><h3 class="tabs_involved">Detail Legal</h3>
  102. <ul class="tabs">
  103. <li><a href="#tab1">English</a></li>
  104. <li><a href="#tab2">Chinese</a></li>
  105. <li><a href="#tab3">Japanese</a></li>
  106. </ul>
  107. </header>
  108. <div class="tab_container">
  109. <div id="tab1" class="tab_content">
  110. <header><h3>English</h3></header>
  111. <form action="editlegal.php?id=<?php echo $id;?>&lang=<?php echo "1";?>" method="post" enctype="multipart/form-data">
  112. <?php
  113. $varLang=1;
  114. $result = $conn->query("SELECT * FROM legal WHERE legalmulti_id = '$id' and language_lang_id='1' ");
  115. $row = $result->fetch_assoc();
  116. ?>
  117. <fieldset style="width:48%; float:left;"> <!-- to make two field float next to one another, adjust values accordingly -->
  118. <label>Legal Name</label>
  119. <input type="text" name="legal_name" value="<?php echo $row['legal_name']; ?>" style="width:92%;" >
  120. </fieldset>
  121. <fieldset style="width:48%; float:right; ">
  122. <label>Description</label>
  123. <textarea rows="5" name="legal_description" id="content" style="width:92%;"><?php echo $row['legal_description']; ?></textarea>
  124. </fieldset>
  125. <fieldset style="width:48%; float:left; "> <!-- to make two field float next to one another, adjust values accordingly -->
  126. <label>Lanuage Type</label>
  127. <select style="width:92%;" name="language" id="language" >
  128. <?php
  129. $resultq = $conn->query("SELECT * FROM `language`where lang_id='$varLang'");
  130. while($rowq = $resultq->fetch_assoc()){
  131. echo "<option value=\"" .$rowq['lang_id']. "\">" . $rowq['lang_name'] ."</option>" ;
  132. }
  133. ?>
  134. </select>
  135. </fieldset>
  136. <!-- Another Row -->
  137. <div class="clear"></div>
  138. <fieldset>
  139. </fieldset>
  140. <div id="dvPassport" style="display: none">
  141. <fieldset>
  142. <script class="jsbin" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
  143. <div class="file-upload">
  144. <button class="file-upload-btn" type="button" onclick="$('.file-upload-input').trigger( 'click' )">Update Image</button>
  145. <div class="image-upload-wrap">
  146. <input class="file-upload-input" type='file' name="UploadImage" id = "UploadImage" onchange="readURL(this);" accept="image/*" />
  147. <div class="drag-text">
  148. <h3>Drag and drop a file or select add Image to Update
  149. <img src="<?php echo $row['event_image'];?> " alt= "" style= "height:300px;width:300px">
  150. </h3>
  151. </div>
  152. </div>
  153. <div class="file-upload-content">
  154. <img class="file-upload-image" src="#" alt="your image" />
  155. <div class="image-title-wrap">
  156. <button type="button" onclick="removeUpload()" class="remove-image">Remove <span class="image-title">Uploaded Image</span></button>
  157. </div>
  158. </div>
  159. </div>
  160. <script src="js/index.js"></script>
  161. </fieldset>
  162. </div>
  163. <footer>
  164. <div class="submit_link">
  165. <input type="submit" value="Update" class="alt_btn">
  166. </div>
  167. </footer>
  168. </form>
  169. </div>
  170. <!-- module extra tab -->
  171. <div id="tab2" class="tab_content">
  172. <header><h3>Chinese</h3></header>
  173. <form action="editlegal.php?id=<?php echo $id;?>&lang=<?php echo "2";?>" method="post" enctype="multipart/form-data">
  174. <?php
  175. $varLang=2;
  176. $result = $conn->query("SELECT * FROM legal WHERE legalmulti_id = '$id' and language_lang_id='2' ");
  177. $row = $result->fetch_assoc();
  178. ?>
  179. <fieldset style="width:48%; float:left;"> <!-- to make two field float next to one another, adjust values accordingly -->
  180. <label>Legal Name</label>
  181. <input type="text" name="legal_name" value="<?php echo $row['legal_name']; ?>" style="width:92%;" >
  182. </fieldset>
  183. <fieldset style="width:48%; float:right; ">
  184. <label>Description</label>
  185. <textarea rows="5" name="legal_description" id="content" style="width:92%;"><?php echo $row['legal_description']; ?></textarea>
  186. </fieldset>
  187. <fieldset style="width:48%; float:left; "> <!-- to make two field float next to one another, adjust values accordingly -->
  188. <label>Lanuage Type</label>
  189. <select style="width:92%;" name="language" id="language" >
  190. <?php
  191. $resultq = $conn->query("SELECT * FROM `language`where lang_id='$varLang'");
  192. while($rowq = $resultq->fetch_assoc()){
  193. echo "<option value=\"" .$rowq['lang_id']. "\">" . $rowq['lang_name'] ."</option>" ;
  194. }
  195. ?>
  196. </select>
  197. </fieldset>
  198. <!-- Another Row -->
  199. <div class="clear"></div>
  200. <!-- <fieldset><label for="chkImage">
  201. <input type="checkbox" name="chkImage" id="chkImage" value="yes" onclick="ShowHideDivChin(this)" />
  202. Select to Update Image
  203. </label>
  204. </fieldset> -->
  205. <!-- <div id="dvChin" style="display: none">
  206. <fieldset>
  207. <script class="jsbin" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
  208. <div class="file-upload">
  209. <button class="file-upload-btn" type="button" onclick="$('.file-upload-input').trigger( 'click' )">Add Image</button>
  210. <div class="image-upload-wrap">
  211. <input class="file-upload-input" type='file' name="UploadImage" id = "UploadImage" onchange="readURL(this);" accept="image/*" />
  212. <div class="drag-text">
  213. <h3>Drag and drop a file or select add Image to Update
  214. <img src="<?php echo $row['tour_image'];?> " alt= "" style= "height:300px;">
  215. </h3>
  216. </div>
  217. </div>
  218. <div class="file-upload-content">
  219. <img class="file-upload-image" src="#" alt="your image" />
  220. <div class="image-title-wrap">
  221. <button type="button" onclick="removeUpload()" class="remove-image">Remove <span class="image-title">Uploaded Image</span></button>
  222. </div>
  223. </div>
  224. </div>
  225. <script src="js/index.js"></script>
  226. </fieldset>
  227. </div> -->
  228. <footer>
  229. <div class="submit_link">
  230. <input type="submit" value="Update" class="alt_btn">
  231. </div>
  232. </footer>
  233. </form>
  234. </div>
  235. <div id="tab3" class="tab_content">
  236. <br/>
  237. <header><h3>Japanese</h3></header>
  238. <form action="editlegal.php?id=<?php echo $id;?>&lang=<?php echo "3";?>" method="post" enctype="multipart/form-data">
  239. <?php
  240. $varLang=3;
  241. $result = $conn->query("SELECT * FROM legal WHERE legalmulti_id = '$id' and language_lang_id='3' ");
  242. $row = $result->fetch_assoc();
  243. ?>
  244. <fieldset style="width:48%; float:left;"> <!-- to make two field float next to one another, adjust values accordingly -->
  245. <label>Legal Name</label>
  246. <input type="text" name="legal_name" value="<?php echo $row['legal_name']; ?>" style="width:92%;" >
  247. </fieldset>
  248. <fieldset style="width:48%; float:right; ">
  249. <label>Description</label>
  250. <textarea rows="5" name="legal_description" id="content" style="width:92%;"><?php echo $row['legal_description']; ?></textarea>
  251. </fieldset>
  252. <fieldset style="width:48%; float:left; "> <!-- to make two field float next to one another, adjust values accordingly -->
  253. <label>Lanuage Type</label>
  254. <select style="width:92%;" name="language" id="language" >
  255. <?php
  256. $resultq = $conn->query("SELECT * FROM `language`where lang_id='$varLang'");
  257. while($rowq = $resultq->fetch_assoc()){
  258. echo "<option value=\"" .$rowq['lang_id']. "\">" . $rowq['lang_name'] ."</option>" ;
  259. }
  260. ?>
  261. </select>
  262. </fieldset>
  263. <div class="clear"></div>
  264. <!-- <fieldset><label for="chkImage">
  265. <input type="checkbox" name="chkImage" id="chkImage" value="yes" onclick="ShowHideDivJap(this)" />
  266. Select to Update Image
  267. </label>
  268. </fieldset> -->
  269. <!-- <div id="dvJap" style="display: none">
  270. <fieldset>
  271. <script class="jsbin" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
  272. <div class="file-upload">
  273. <button class="file-upload-btn" type="button" onclick="$('.file-upload-input').trigger( 'click' )">Add Image</button>
  274. <div class="image-upload-wrap">
  275. <input class="file-upload-input" type='file' name="UploadImage" id = "UploadImage" onchange="readURL(this);" accept="image/*" />
  276. <div class="drag-text">
  277. <h3>Drag and drop a file or select add Image to Update
  278. <img src="<?php echo $row['tour_image'];?> " alt= "" style= "height:300px;">
  279. </h3>
  280. </div>
  281. </div>
  282. <div class="file-upload-content">
  283. <img class="file-upload-image" src="#" alt="your image" />
  284. <div class="image-title-wrap">
  285. <button type="button" onclick="removeUpload()" class="remove-image">Remove <span class="image-title">Uploaded Image</span></button>
  286. </div>
  287. </div>
  288. </div>
  289. <script src="js/index.js"></script>
  290. </fieldset>
  291. </div> -->
  292. <footer>
  293. <div class="submit_link">
  294. <input type="submit" value="Update" class="alt_btn">
  295. </div>
  296. </footer>
  297. </form>
  298. </div>
  299. </div>
  300. <div class="clear"></div>
  301. </div>
  302. </article><!-- end of post new article -->
  303. <div class="spacer"></div>
  304. </section>
  305. </body>
  306. </html>