-
Notifications
You must be signed in to change notification settings - Fork 0
/
itemset.php
1 lines (1 loc) · 5.37 KB
/
itemset.php
1
<?php session_start(); if(!isset($_SESSION['logged']) || !$_SESSION['logged']){ header("Location: ./index.php"); } $method = $_GET["itemset_method"]; $title="CS634 - Midterm Project | ".(($method=="apriori")?"Apriori":"BruteForce")." Itemset generation";?><!DOCTYPE html><html lang="en"><head> <!-- Metadata --> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="description" content="CS634 Midterm Project on Frequent Item set generation. This project highlight the use of Brute-force algorithm for frequent itemset generation and improvizes the frequent itemset generation by the use of Apriori frequent itemset generation algorithm. This also showcases the time taken by both versions, where in both algorithm generates same set of association mining rules after the frequent-itemlist generation."> <meta name="keywords" content="cs634, 634, data mining, jason wang, midterm project, apriori algorithm, frequent itemset, Brute-force frequent itemset"> <meta name="author" content="Rahul Gautham Putcha"> <title><?php echo $title;?></title> <!-- Styles: External (opensource) --> <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-+0n0xVW2eSR5OomGNYDnhzAbDsOXxcvSN1TPprVMTNDbiYZCxYbOOl7+AMvyTG2x" crossorigin="anonymous"> <link rel="preconnect" href="https://fonts.gstatic.com"> <link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@300&display=swap" rel="stylesheet"> <!-- Styles: Rahul Gautham Putcha --> <link href="./res/styles/style.css" rel="stylesheet" type="text/css"></head><body><!-- Sign-in / Signup page --> <header class="fixed-top"> <div class="d-flex flex-column flex-md-row align-items-center p-3 px-md-4 mb-3 navbar-dark bg-dark border-bottom box-shadow"> <h1 class="my-0 mr-md-auto font-weight-normal">NJIT MART</h1> <nav class="my-2 my-md-0 mr-md-3" > <a class="p-1 text-light" href="./shopping.php">Shop Item</a> <a class="<?php echo ($method==="bruteforce")?"active":"";?> p-1 text-light" href="./itemset.php?itemset_method=bruteforce">Bruteforce</a> <a class="<?php echo ($method==="apriori")?"active":"";?> p-1 text-light" href="./itemset.php?itemset_method=apriori">Apriori</a> </nav> <a class="btn btn-outline-primary" href="./logout.php">Logout</a> </div> </header> <main class="p-3 container" style="margin-top: 125px;"> <div class="row"> <form id="itemset-generation" class="col-12"> <fieldset> <legend>Generate Itemset:</legend> <label for="min_support">Minimum Support </label> <input type="number" id="min_support" name="min_support" min="0" max="100" value="50" required/>% <br/><br/> <label for="min_confidence">Minimum Confidence</label> <input type="number" id="min_confidence" name="min_confidence" min="0" max="100" value="50" required />% <input style="display:none" type="text" id="hidden-method" name="itemset_method" value="<?php echo $method; ?>" required /> <br/><br/> <input type="submit" value="Generate" class="px-2 py-1"/> </fieldset> </form> </div> <br/><br/> <div class="header-text"> <h2>Input Transactions</h2> </div><br/><br/><br/> <div class="table-responsive m-2 m-md-0"> <?php /* -- SQL Config -- */ $servername = "localhost"; $username = "root"; $password = "root123"; $conn = new mysqli($servername, $username, $password, $_SESSION["User_DB"]); if ($conn->connect_error) { echo "<div style='background-color: white; width:100%;'><hr/><br/>500 - Internal Server Error. <br/> Cannot connect to MySQL. Please do proper setup of XAAMP again.<br/><hr/></div>"; die("Connection failed: " . $conn->connect_error); }else{ $sql = "SELECT T.Tid, TransDateTime, Detail FROM Transactions AS T , (SELECT Tid, GROUP_CONCAT(DISTINCT label) 'Detail' FROM transactiondetails GROUP BY Tid) AS TD WHERE T.Tid = TD.Tid"; $result = $conn->query($sql); if ($result->num_rows > 0) { echo "<table class='table text-white'>"; echo "<thead><tr><th>Tid</th><th>TransDateTime</th><th>Transaction Details</th></tr></thead><tbody>"; while($row=$result->fetch_array(MYSQLI_ASSOC)){ echo "<tr><td>".$row['Tid']."</td><td>".$row['TransDateTime']."</td><td>".$row['Detail']."</td></tr>"; }echo "</tbody></table><br/><br/><br/>"; } else { echo "<hr/><br/>No Records to display <br/><hr/>"; } } ?> </div> <div class="header-text"> <h2>Association Rules</h2> </div><br/><br/><br/> <div id="output" class="m-2 m-md-0"> <div class="text-center"><p class="h5 text-white">* Click on <u><strong>Generate</strong></u> to view Association Rules.</p></div> </div> <br/><br/><br/><br/> </main> <footer class='text-center fixed-bottom bg-dark pb-2'> <div id="copyright" class="pt-2"><h6>© Copyright 2021-2022 | By Rahul Gautham Putcha<h6></div> </footer> <!-- Scripts: External (opensource) --> <script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script> <script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.9.2/dist/umd/popper.min.js" integrity="sha384-IQsoLXl5PILFhosVNubq5LC7Qb9DXgDA9i+tQ8Zj3iwWAwPtgFTxbJ8NT4GN1R8p" crossorigin="anonymous"></script> <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.1/dist/js/bootstrap.min.js" integrity="sha384-Atwg2Pkwv9vp0ygtn1JAojH0nYbwNJLPhwyoVbhoPwBhjQPR5VtM2+xf0Uwh9KtT" crossorigin="anonymous"></script> <!-- Styles: Rahul Gautham Putcha --> <script src="./res/script/script2.js"></script></body></html>