0byt3m1n1
Path:
C:
/
wamp64
/
www
/
crop
/
Crops
/
[
Home
]
File: view.php
<?php $servername = "localhost"; $username = "root"; $password = ""; $dbname = "crops"; $conn = mysqli_connect($servername, $username, $password, $dbname); $email = $_GET['email']; $query = "SELECT * FROM crop WHERE Email='$email'"; $result = mysqli_query($conn, $query); ?> <!doctype html> <html lang="en"> <head> <link rel="stylesheet" href="assets/css/bootstrap.min.css"> <style> table { border-collapse: collapse; width: 100%; } th, td { padding: 8px; text-align: left; border-bottom: 1px solid #ddd; } th { background-color: #f2f2f2; } .image-cell img { width: 100px; height: 100px; object-fit: cover; } .action-buttons { display: flex; justify-content: space-between; } .edit-button, .delete-button { padding: 6px 12px; text-decoration: none; color: #fff; border-radius: 4px; cursor: pointer; } .edit-button { background-color: #007bff; } .delete-button { background-color: #dc3545; } </style> </head> <body> <div class="container"> <table> <tr> <th>ID</th> <th>NAME OF USER</th> <th>NAME OF THE CROP</th> <th>SCIENTIFIC NAME</th> <th>FAMILY</th> <th>IMAGE</th> <th>NUTRIENT</th> <th>SYMPTOMS</th> <th>MANAGEMENT</th> <th>IMAGE</th> <th>DISEASE</th> <th>SYMPTOMS</th> <th>MANAGEMENT</th> <th>PESTS</th> <th>SYMPTOMS</th> <th>MANAGEMENT</th> <th>IMAGE</th> <th>ACTIONS</th> </tr> <?php while ($rows = mysqli_fetch_assoc($result)) { ?> <tr> <td><?php echo $rows['Id']; ?></td> <td><?php echo $rows['Name_User']; ?></td> <td><?php echo $rows['Name']; ?></td> <td><?php echo $rows['Scientific_Name']; ?></td> <td><?php echo $rows['Family']; ?></td> <td class="image-cell"><img src='images/<?php echo $rows['img']; ?>' alt='<?php echo $rows['img']; ?>'></td> <td><?php echo $rows['Nutrient']; ?></td> <td><?php echo $rows['Symptoms']; ?></td> <td><?php echo $rows['Management']; ?></td> <td class="image-cell"><img src='images/<?php echo $rows['img2']; ?>' alt='<?php echo $rows['img2']; ?>'></td> <td><?php echo $rows['Dicease']; ?></td> <td><?php echo $rows['d_symptom']; ?></td> <td><?php echo $rows['D_mng']; ?></td> <td class="image-cell"><img src='images/<?php echo $rows['img3']; ?>' alt='<?php echo $rows['img3']; ?>'></td> <td><?php echo $rows['Pests']; ?></td> <td><?php echo $rows['Psymptom']; ?></td> <td><?php echo $rows['p_mng']; ?></td> <td class="image-cell"><img src='images/<?php echo $rows['img4']; ?>' alt='<?php echo $rows['img4']; ?>'></td> <td class="action-buttons"> <a href="Edit.php?id=<?php echo $rows['Id']?>&email=<?php echo $rows['Email']?>&nameuser=<?php echo $rows['Name_User']?>&name=<?php echo $rows['Name']?>&scname=<?php echo $rows['Scientific_Name']?>&fam=<?php echo $rows['Family']?>&img=<?php echo $rows['img']?>&nutri=<?php echo $rows['Nutrient']?>&sym=<?php echo $rows['Symptoms']?>&mng=<?php echo $rows['Management']?>&dis=<?php echo $rows['Dicease']?>&dsym=<?php echo $rows['d_symptom']?>&dmng=<?php echo $rows['D_mng']?>&pests=<?php echo $rows['Pests']?>&ps=<?php echo $rows['Psymptom']?>&pmng=<?php echo $rows['p_mng']?>" class="edit-button">Edit</a> <form method="post" action="delete.php" style="display: inline;"> <input type="hidden" name="id" value="<?php echo $rows['Id']; ?>"> <input type="hidden" name="email" value="<?php echo $_GET['email']; ?>"> <input type="submit" name="delete" value="Delete" class="delete-button"> </form> </td> </tr> <?php } ?> </table> </div> <script src="assets/js/bootstrap.bundle.min.js"></script> </body> </html>