Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if (session_status() == PHP_SESSION_NONE) {
- session_set_cookie_params(0);
- session_start();
- }
- ?>
- <!DOCTYPE html PUBLIC "-W3C//DD XHTML 1.0 Strict//EN""Http//www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
- <html xmins="http://www.w3.org/1999.xhtml">
- <head>
- <title>Create Invoice</title>
- <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
- <style>
- html {
- position: relative;
- min-height: 100%;
- }
- body {
- margin: 0 0 100px; /* bottom = footer height */
- }
- .logHTML{
- width:100%;
- color:red;
- }
- #bottom-footer {
- position: absolute;
- left: 0;
- bottom: 0;
- height: 100px;
- width: 100%;
- }
- .thisIsSticky{
- background: #B8C1C8;
- border-bottom: 1px solid #989EA4;
- border-top: 1px solid #717D85;
- color: #FFF;
- margin: 0;
- padding: 2px 0 0 12px;
- position: -webkit-sticky;
- position: sticky;
- top: -1px;
- }
- .rainbow {
- /* Chrome, Safari, Opera */
- -webkit-animation: rainbow 1s infinite;
- /* Internet Explorer */
- -ms-animation: rainbow 1s infinite;
- /* Standar Syntax */
- animation: rainbow 1s infinite;
- }
- /* Chrome, Safari, Opera */
- @-webkit-keyframes rainbow{
- 20%{color: red;}
- 40%{color: yellow;}
- 60%{color: green;}
- 80%{color: blue;}
- 100%{color: orange;}
- }
- /* Internet Explorer */
- @-ms-keyframes rainbow{
- 20%{color: red;}
- 40%{color: yellow;}
- 60%{color: green;}
- 80%{color: blue;}
- 100%{color: orange;}
- }
- /* Standar Syntax */
- @keyframes rainbow{
- 20%{color: red;}
- 40%{color: yellow;}
- 60%{color: green;}
- 80%{color: blue;}
- 100%{color: orange;}
- }
- </style>
- <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate"/>
- <meta http-equiv="Pragma" content="no-cache"/>
- <meta http-equiv="Expires" content="0"/>
- </head>
- <body onLoad="document.getElementById('chatBox').focus();">
- <?php
- ob_start();
- $FrontPartOfFile = "UNKNOWN";
- $IsUserLoggedIn = false;
- if (!isset($_SESSION['loggedInUserName']) || empty($_SESSION['loggedInUserName'])) {
- echo "<a href='../userLogin.php'>You need to login in order to use this app</a>";
- }else{
- $IsUserLoggedIn = true;
- $UserID = $_SESSION['loggedInUserID'];
- }
- $HasAccessToMakeInvoice = false;
- if($IsUserLoggedIn){
- $username = "id1904204_admin";
- $password = "Markiscool1";
- $database = "id1904204_login";
- $hostname = "localhost";
- $conn = mysqli_connect($hostname, $username, $password, $database);
- if(!$conn){
- die("Failed to connect to database" . mysqli_connect_error());
- }
- $sql = "SELECT * FROM loginInfo";
- $query = mysqli_query($conn, $sql);
- if(!$query){
- die("Error Found" . mysqli_error($conn));
- }
- while ($row = mysqli_fetch_array($query)){
- if($row['ID'] == $UserID){
- if($row['InvoiceAccess'] == 1){
- $HasAccessToMakeInvoice = true;
- echo "<h3>Create Invoice</h3>";
- }else{
- echo "\nYou need to have access to make invoices. Please contact an admin.";
- }
- }
- }
- }
- function writeToFile($txt, $chat, $yourName){
- 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>");
- fclose($chat);
- }
- if (isset($_POST['newChat'])) {
- if(isExceptionalText($_POST['newChat'])){
- writeToFile($_POST['newChat'], $chatLog, $UserName);
- unset($_POST["newChat"]);
- //header( 'Location: Redirect.php' );
- //echo '<script>window.location = "Redirect.php"</script>';
- }
- //readTextFile($UserID, $TalkingToUserID);
- } else {
- //readTextFile($UserID, $TalkingToUserID);
- }
- if($HasAccessToMakeInvoice){
- ?>
- <div style="width:100%;">
- <form action=“CreateInvoice.php" method="post">
- Name:<input type="text" id="OwnerName" name="OwnerName" style="" value="">
- Phone:<input type="number" id="PhoneNumber" style="" name="PhoneNumber" value="">
- Email:<input type="text" id="Email" style="" name="Email" value="">
- <br>
- <h4>Address</h4>
- Street:<input type="text" id="Street" style="" name="Street" value="">
- City:<input type="text" id="City" style="" name="City" value="">
- State:<input type="text" id="State" style="" name="State" value="">
- Zip Code:<input type="text" id="ZipCode" style="" name="ZipCode" value="">
- <input type="submit" name="submit" value="Send" style="width:6%">
- </form>
- </div>
- <?php
- }
- ?>
- <script>
- </script>
- </body>
- <?php
- ob_end_flush();
- ?>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement