Advertisement
Guest User

Untitled

a guest
Jan 10th, 2018
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.40 KB | None | 0 0
  1. <?php
  2. if (session_status() == PHP_SESSION_NONE) {
  3. session_set_cookie_params(0);
  4. session_start();
  5. }
  6. ?>
  7. <!DOCTYPE html PUBLIC "-W3C//DD XHTML 1.0 Strict//EN""Http//www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  8. <html xmins="http://www.w3.org/1999.xhtml">
  9. <head>
  10. <title>Create Invoice</title>
  11. <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
  12. <style>
  13. html {
  14. position: relative;
  15. min-height: 100%;
  16. }
  17. body {
  18. margin: 0 0 100px; /* bottom = footer height */
  19. }
  20. .logHTML{
  21. width:100%;
  22. color:red;
  23. }
  24. #bottom-footer {
  25. position: absolute;
  26. left: 0;
  27. bottom: 0;
  28. height: 100px;
  29. width: 100%;
  30. }
  31. .thisIsSticky{
  32. background: #B8C1C8;
  33. border-bottom: 1px solid #989EA4;
  34. border-top: 1px solid #717D85;
  35. color: #FFF;
  36. margin: 0;
  37. padding: 2px 0 0 12px;
  38. position: -webkit-sticky;
  39. position: sticky;
  40. top: -1px;
  41. }
  42. .rainbow {
  43. /* Chrome, Safari, Opera */
  44. -webkit-animation: rainbow 1s infinite;
  45.  
  46. /* Internet Explorer */
  47. -ms-animation: rainbow 1s infinite;
  48.  
  49. /* Standar Syntax */
  50. animation: rainbow 1s infinite;
  51. }
  52.  
  53. /* Chrome, Safari, Opera */
  54. @-webkit-keyframes rainbow{
  55. 20%{color: red;}
  56. 40%{color: yellow;}
  57. 60%{color: green;}
  58. 80%{color: blue;}
  59. 100%{color: orange;}
  60. }
  61. /* Internet Explorer */
  62. @-ms-keyframes rainbow{
  63. 20%{color: red;}
  64. 40%{color: yellow;}
  65. 60%{color: green;}
  66. 80%{color: blue;}
  67. 100%{color: orange;}
  68. }
  69.  
  70. /* Standar Syntax */
  71. @keyframes rainbow{
  72. 20%{color: red;}
  73. 40%{color: yellow;}
  74. 60%{color: green;}
  75. 80%{color: blue;}
  76. 100%{color: orange;}
  77. }
  78. </style>
  79. <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate"/>
  80. <meta http-equiv="Pragma" content="no-cache"/>
  81. <meta http-equiv="Expires" content="0"/>
  82. </head>
  83. <body onLoad="document.getElementById('chatBox').focus();">
  84. <?php
  85.  
  86. ob_start();
  87.  
  88. $FrontPartOfFile = "UNKNOWN";
  89.  
  90. $IsUserLoggedIn = false;
  91.  
  92. if (!isset($_SESSION['loggedInUserName']) || empty($_SESSION['loggedInUserName'])) {
  93. echo "<a href='../userLogin.php'>You need to login in order to use this app</a>";
  94. }else{
  95. $IsUserLoggedIn = true;
  96. $UserID = $_SESSION['loggedInUserID'];
  97. }
  98.  
  99. $HasAccessToMakeInvoice = false;
  100.  
  101. if($IsUserLoggedIn){
  102. $username = "id1904204_admin";
  103. $password = "Markiscool1";
  104. $database = "id1904204_login";
  105. $hostname = "localhost";
  106.  
  107. $conn = mysqli_connect($hostname, $username, $password, $database);
  108.  
  109. if(!$conn){
  110. die("Failed to connect to database" . mysqli_connect_error());
  111. }
  112.  
  113. $sql = "SELECT * FROM loginInfo";
  114.  
  115. $query = mysqli_query($conn, $sql);
  116.  
  117. if(!$query){
  118. die("Error Found" . mysqli_error($conn));
  119. }
  120.  
  121. while ($row = mysqli_fetch_array($query)){
  122. if($row['ID'] == $UserID){
  123. if($row['InvoiceAccess'] == 1){
  124. $HasAccessToMakeInvoice = true;
  125. echo "<h3>Create Invoice</h3>";
  126. }else{
  127. echo "\nYou need to have access to make invoices. Please contact an admin.";
  128. }
  129. }
  130. }
  131. }
  132.  
  133. function writeToFile($txt, $chat, $yourName){
  134. fwrite($chat, "\n <div class='message' style=''><div class='".$class."' style='display:inline;color:" . $color . "'>" . $yourName . "</div><div style='display:inline;text-align:left'>: " . $txt . "</div></div>");
  135. fclose($chat);
  136. }
  137.  
  138. if (isset($_POST['newChat'])) {
  139. if(isExceptionalText($_POST['newChat'])){
  140. writeToFile($_POST['newChat'], $chatLog, $UserName);
  141. unset($_POST["newChat"]);
  142. //header( 'Location: Redirect.php' );
  143. //echo '<script>window.location = "Redirect.php"</script>';
  144. }
  145. //readTextFile($UserID, $TalkingToUserID);
  146. } else {
  147. //readTextFile($UserID, $TalkingToUserID);
  148. }
  149.  
  150.  
  151. if($HasAccessToMakeInvoice){
  152.  
  153. ?>
  154. <div style="width:100%;">
  155. <form action=“CreateInvoice.php" method="post">
  156. Name:<input type="text" id="OwnerName" name="OwnerName" style="" value="">
  157. Phone:<input type="number" id="PhoneNumber" style="" name="PhoneNumber" value="">
  158. Email:<input type="text" id="Email" style="" name="Email" value="">
  159. <br>
  160. <h4>Address</h4>
  161. Street:<input type="text" id="Street" style="" name="Street" value="">
  162. City:<input type="text" id="City" style="" name="City" value="">
  163. State:<input type="text" id="State" style="" name="State" value="">
  164. Zip Code:<input type="text" id="ZipCode" style="" name="ZipCode" value="">
  165. <input type="submit" name="submit" value="Send" style="width:6%">
  166. </form>
  167. </div>
  168. <?php
  169. }
  170. ?>
  171. <script>
  172. </script>
  173. </body>
  174. <?php
  175. ob_end_flush();
  176. ?>
  177. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement