Hello everyone!
How are you all? I hope my friends will be happy and well. by the grace of God, I am also well. Today I am here with new development of SW portal. In the last post SW portal, I've discussed my working on report adding to the database of SW portal as well as the backend behaviour of ADD reports.
Today i will share the development of fetching reports data from database and show it on the SW portal. i will also discuss the backend working behavior of it. first of all, we will a report and experience that how it will show on the portal then i will move on next part. Multiple languages are using in this project. These langauges are HTML, CSS, bootstrap, JavaScript, PHP and SQL language. Many types of condition are applied to stop the junk and dummy reports to database.
The hardest phase to handle is role-level security. It is the database concept that I will share in the next development post. First, our focus is on entering and fetching the data from the database. So let's start and add a random report.
Report added and message has been popup.
Now, open the Report Section, and you will see that the new report has been successfully populated. as shown in the screenshot below. After the role-level security phase is completed, the website will go live, and all reports will be published and available for viewing on the SW Portal.
Post Link and Source Column are the columns that can be clicked. The link will open in a new window after you click on it. I've never used this feature before, therefore it's quite challenging for me to open the link in a new tab. Since last week, I've been trying to figure out how to include it best.
A new column named Action is added in the report. the perpose of these colum is to edit and delete the report. Development of on this function is not completed yet. i will complete guide about it when it will completed.
PHP Code for report fetching from Database.
<?php
$conn = new mysqli($servername,$username,$password,$dbname);
if ($conn -> connect_errno){
echo "Failed to connect to MySQL: " . $conn -> connect_error;
exit(); }
$sql = "SELECT * FROM `swatcher`;";
$result = ($conn->query($sql));
$row = [];
if ($result->num_rows > 0){
$row = $result->fetch_all(MYSQLI_ASSOC); } ?>
<?php
if(!empty($row))
foreach($row as $rows)
{?>
<tr>
<td><?php echo $rows['ID']; ?></td>
<td><?php echo $rows['U_ID']; ?></td>
<td><?php echo "<a href='" .$rows['P_LINK']."'target=_blank>" .$rows['P_LINK']. "</a>" ?></td>
<td><?php echo "<a href='" .$rows['S_LINK']. "'target=_blank>" . $rows['S_LINK'] . "</a>"?></td>
<td><?php echo $rows['C_BY']; ?></td>
<td><?php echo $rows['P_TYPE']; ?></td>
</tr>
<?php } ?>
if you have any suggestion then must share with us in the comment section. we will focus on it and try to apply it if it will suitable.
Thanks for giving your precious time to my post.
Follow | Upvote | Share | Comments
Special Thanks to
Cc: @rme
Cc: @hungry-griffin
Cc: @blacks
Follow me on Instagram.
Instagram
🆃🅷🅰️🅽🅺 🆈🅾️🆄
Congratulations, your post has been upvoted by @dsc-r2cornell, which is the curating account for @R2cornell's Discord Community.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit