HTML Table in PHP code overlap each other - php

I have two tables that are "To-do Tasks" and "Completed Tasks". I don't know why when I add new tasks to the To-do Tasks table, the table grow bigger and start overlapping the Completed Tasks table. I did set the max-width for the table to stop it but it didn't help. Can someone teach me how to fix it? Thank you
$displayQuery="SELECT * FROM incomplete where owner=:owner";
$displayTask= $conn->prepare($displayQuery);
$displayTask->bindValue(':owner', $owner);
$displayTask->execute();
$allTask=$displayTask->fetchAll();
echo "<table class=\"incomplete_table\"><caption>To-do Tasks</caption><tr><th>ID</th><th>Title</th><th>Description</th><th>Due Date</th><th>Time</th><th colspan='3'>Button</th></tr>";
if(count($allTask) > 0)
{
foreach ($allTask as $row) {
echo "<tr><td>".$row["id"]."</td><td>".$row["title"]."</td><td>".$row["description"]."</td><td>".$row["due_date"]."</td><td>".$row["time"]."</td><td><button><a
href='delete.php?table=todotask&did=".$row["id"]."'>Delete</a></button></td>"."<td><button><a
href='checkcomplete.php?table=todotask&did=".$row["id"]."'>Complete</a></button></td>"."<td><button><a
href='modify.php?table=todotask&did=".$row["id"]."'>Modify</a></button></td>"."</td></tr>";
}
}
$displayQueryComplete="SELECT * FROM complete where owner=:owner";
$displayTaskComplete= $conn->prepare($displayQueryComplete);
$displayTaskComplete->bindValue(':owner', $owner);
$displayTaskComplete->execute();
$allTaskComplete= $displayTaskComplete->fetchAll();
echo "<table class=\"complete_table\"><caption>Completed Tasks</caption><tr><th>ID</th><th>Title</th><th>Description</th><th>Due Date</th><th>Time</th><th colspan='3'>Button</th></tr>";
if(count($allTaskComplete) > 0)
{
foreach ($allTaskComplete as $row) {
echo "<tr><td>".$row["id"]."</td><td>".$row["title"]."</td><td>".$row["description"]."</td><td>".$row["due_date"]."</td><td>".$row["time"]."</td><td><button><a
href='delete.php?table=completedtask&did=".$row["id"]."'>Delete</a></button></td>"."<td><button><a
href='checkcomplete.php?table=completedtask&did=".$row["id"]."'>Complete</a></button></td>"."<td><button><a
href='modify.php?table=completedtask&did=".$row["id"]."'>Modify</a></button></td>"."</td></tr>";
}
}
CSS:
.complete_table{
border: 4px solid #5e001f;
border-collapse: collapse;
position: absolute;
top: 34%;
right: 1%;
width: 600px;
max-width: 600px;
}
.complete_table caption, .incomplete_table caption{
font-size: 17px;
color: #5e001f;
font-weight: bold;
border: 1px solid #5e001f;
border-radius: 7px;
padding: 7px;
background-color: white;
margin: 7px;
}
.complete_table th{
border: 1px solid #5e001f;
color: #5e001f;
padding: 7px;
}
.complete_table td{
border: 1px solid #5e001f;
padding: 7px;
color: #5e001f;
}
.incomplete_table{
border: 4px solid #5e001f;
border-collapse: collapse;
position: absolute;
top: 34%;
left: 1%;
width: 600px;
max-width: 600px;
}
.incomplete_table th{
border: 1px solid #5e001f;
color: #5e001f;
padding: 7px;
}
.incomplete_table td{
border: 1px solid #5e001f;
padding: 7px;
color: #5e001f;
}
.incomplete_table a, .complete_table a{
text-decoration: none;
color: #5e001f;
}
.incomplete_table button, .complete_table button{
width: 76px;
background-color: white;
font-size: 14px;
font-weight: bold;
border: 1px solid #5e001f;
border-radius: 7px;
}

try this:
$displayQuery="SELECT * FROM incomplete where owner=:owner";
$displayTask= $conn->prepare($displayQuery);
$displayTask->bindValue(':owner', $owner);
$displayTask->execute();
$allTask=$displayTask->fetchAll();
echo "<table class=\"incomplete_table\"><caption>To-do Tasks</caption><tr><th>ID</th><th>Title</th><th>Description</th><th>Due Date</th><th>Time</th><th colspan='3'>Button</th></tr>";
if(count($allTask) > 0)
{
foreach ($allTask as $row) {
echo "<tr><td>".$row["id"]."</td><td>".$row["title"]."</td><td>".$row["description"]."</td><td>".$row["due_date"]."</td><td>".$row["time"]."</td><td><button><a
href='delete.php?table=todotask&did=".$row["id"]."'>Delete</a></button></td>"."<td><button><a
href='checkcomplete.php?table=todotask&did=".$row["id"]."'>Complete</a></button></td>"."<td><button><a
href='modify.php?table=todotask&did=".$row["id"]."'>Modify</a></button></td>"."</td></tr>";
}
}
echo "</table>";
$displayQueryComplete="SELECT * FROM complete where owner=:owner";
$displayTaskComplete= $conn->prepare($displayQueryComplete);
$displayTaskComplete->bindValue(':owner', $owner);
$displayTaskComplete->execute();
$allTaskComplete= $displayTaskComplete->fetchAll();
echo "<table class=\"complete_table\"><caption>Completed Tasks</caption><tr><th>ID</th><th>Title</th><th>Description</th><th>Due Date</th><th>Time</th><th colspan='3'>Button</th></tr>";
if(count($allTaskComplete) > 0)
{
foreach ($allTaskComplete as $row) {
echo "<tr><td>".$row["id"]."</td><td>".$row["title"]."</td><td>".$row["description"]."</td><td>".$row["due_date"]."</td><td>".$row["time"]."</td><td><button><a
href='delete.php?table=completedtask&did=".$row["id"]."'>Delete</a></button></td>"."<td><button><a
href='checkcomplete.php?table=completedtask&did=".$row["id"]."'>Complete</a></button></td>"."<td><button><a
href='modify.php?table=completedtask&did=".$row["id"]."'>Modify</a></button></td>"."</td></tr>";
}
}
echo "</table>";

Related

PHP SQL displaying outside of intended div when new record is displayed

I have a site where a user can post an image, along with some other information about said image. I have a sidebar for users to navigate to other parts of that specific side of my site.
It looks like it is displaying outside the div that I intended and envisioned all posts would be under, and it's worth mentioning that upon each new post, it is appearing farther and farther outside it's original intended place until reaching the body.
Here's what I mean. The screenshots are zoomed out screenshots of the site.
Just below is the code to the container which contains all my code for the tabs and posts, above that is just the "Answer Key" title, and the posting modal that the button to the right of it pulls out. Below it is the php that sends all the info the user inputted into the modal to the database. Apologies for the slight messiness.
<div id="container" class="row">
<div class="tab col-sm-3 border border-end-0 border-start-0" id="sidenav">
<ul style="list-style-type:none;padding:0;margin:0;" class="text-end" id="menu">
<li>
<a class="tablinks">Home</a>
</li>
<li>
<a class="tablinks">Calculators</a>
</li>
</ul>
</div>
<div id="entirepost" class="col-sm-9">
<?php
$query = mysqli_query($conn,"SELECT *,UNIX_TIMESTAMP() - sub_date_created AS TimeSpent from submission LEFT JOIN user on user.user_id = submission.sub_user_id order by submission_id DESC")or die(mysqli_error());
while($submission_row=mysqli_fetch_array($query)){
$id = $submission_row['submission_id'];
$upid = $submission_row['sub_user_id'];
$posted_by = $submission_row['firstname']." ".$submission_row['lastname'];
?>
<div id="posts">
<?php
if((isset($_SESSION['role']) && $_SESSION['role'] == "admin")){
echo "<a style='float:right; font-size: large;' class='btn btn-outline-danger' href='deletesubmission.php?id=" . $id . "'><b>×</b></a>";
}
elseif((isset($_SESSION['role']) && $_SESSION['role'] == "developer")){
echo "<a style='float:right; font-size: large;' class='btn btn-outline-danger' href='deletesubmission.php?id=" . $id . "'><b>×</b></a>";
}
elseif((isset($_SESSION['user_id']) && $_SESSION['user_id'] == $upid)) {
echo "<a style='float:right; font-size: large;' class='btn btn-outline-danger' href='deletesubmission.php?id=" . $id . "'><b>×</b></a>";
}
else {
echo "";
}
?>
<h3><?php echo $submission_row['sub_title']; ?></h3>
<h5>
<?php echo "<span class='badge rounded-pill' id='grade" . $submission_row['grade'] . "Flare'>" . $submission_row['grade'] . " Grade</span>"; ?>
<?php echo $submission_row['teacher']; ?> · <?php echo $submission_row['subject']; ?><br>
</h5>
<img id="uploadedImage" src="<?php echo "images//" . $submission_row['image_url'] ?>"/>
<p>
<?php echo $submission_row['sub_content'];?>
<!-- </?php echo "images//" . $submission_row['image_url'] ?><br> -->
<table id="submissionInfoTable">
<thead>
<tr>
<th width="25%">Assigned</th>
<th>Due</th>
</tr>
</thead>
<tbody>
<tr>
<td><i><?php echo date('F d, Y', $submission_row['assigned']) ?></i></td>
<td><i><?php echo date('F d, Y', $submission_row['due']) ?></i></td>
</tr>
</tbody>
<tbody>
<tr>
<td colspan="2">
<?php echo "<b>" . $submission_row['weight'] . "%</b> of your grade"; ?>
<i style="color:grey" class="bi bi-info-circle" data-bs-toggle="tooltip" title="Assignments may weigh differently depending on the teacher's grading system and how many other assignments are under this weight"></i>
</td>
</tr>
</tbody>
</table>
</p>
<small>
<i>
<?php echo $posted_by; ?>
</i>
<?php
if((isset($_SESSION['role']) && $_SESSION['role'] == "admin")){
echo "<span class='badge bg-primary'>Admin</span>";
}
elseif((isset($_SESSION['role']) && $_SESSION['role'] == "developer")){
echo "<span class='badge bg-primary'>Dev</span>";
}
else {
echo "";
}
?> ·
<?php
$days = floor($submission_row['TimeSpent'] / (60 * 60 * 24));
$remainder = $submission_row['TimeSpent'] % (60 * 60 * 24);
$hours = floor($remainder / (60 * 60));
$remainder = $remainder % (60 * 60);
$minutes = floor($remainder / 60);
$seconds = $remainder % 60;
if($days > 0)
echo date('F d, Y - H:i:sa', $submission_row['date_created']);
elseif($days == 0 && $hours == 0 && $minutes == 0)
echo "A few seconds ago";
elseif($days == 0 && $hours == 0)
echo $minutes.' minutes ago';
elseif($days == 0 && $hours == 1)
echo $hours.' hour ago';
elseif($days == 0 && $hours > 1)
echo $hours.' hours ago';
?>
</small>
<hr>
</div>
<br>
</div>
<?php
}
?>
</div>
#content {
margin: 20px;
}
#postcontent {
resize: none;
outline: none;
border: 1px solid rgb(192, 192, 192);
transition: all 0.5s ease;
border-radius: 16px;
padding: 10px;
width: 100%;
margin-top: 15px;
}
#postcontent:focus {
border: 1px solid #5865F2;
}
#entirepost {
border-right: 1px solid gray;
border-left: 1px solid gray;
/* border-radius: 5px; */
padding: 20px;
/* width:auto; */
}
#commentstextarea {
resize: none;
outline: none;
border: 1px solid gray;
transition: all 0.5s ease;
}
#commentstextarea:focus {
border: 1px solid #5865F2;
}
#comments {
margin-top: 10px;
}
#commentcontent {
margin-top: 1%;
padding-left:10px;
border-left: 3px solid #ccc;
width: 50%;
}
#commentstitle {
margin-left: 1%;
margin-top: 2%;
}
#title {
width: 100%;
font-size: 16px;
padding: 12px 20px 12px 40px;
margin-bottom: 12px;
outline: none;
border-radius: 16px;
background-color: transparent;
border: 1px solid rgb(192, 192, 192);
color: black;
transition: all 0.5s ease;
}
#title:focus {
border: 1px solid #5865F2;
}
#header {
padding:5px;
}
#NewSubmission {
background-color: transparent;
color: #3d4cf3;
border: 1px solid #a3a9f5;
}
#NewSubmission:hover {
background-color:#a3a9f5;
}
#PageTitle {
width:40%;
display: inline;
}
#container {
width: 100%;
padding-right: 0;
}
#sidenav {
padding-right: 0;
}
.tab {
float: left;
background-color: #f1f1f1;
transition: all 0.3s ease;
height: 100%;
}
.tab button, .tab a {
display: block;
text-decoration: none;
background-color: inherit;
color: black;
padding: 22px 16px;
width: 100%;
border: none;
outline: none;
text-align: left;
cursor: pointer;
transition: 0.3s;
font-size: 17px;
transition: all 0.3s ease;
}
.tab button:hover, .tab a:hover {
background-color: #ddd;
transition: all 0.3s ease;
}
.tab button.active, .tab a:hover {
background-color: #ccc;
transition: all 0.3s ease;
}
#search {
transition: all 0.3s ease;
width: 100%;
padding: 1%;
margin: 1%px;
outline: none;
border: none;
background-color: rgb(231, 230, 230);
}
.select2, input {
margin-top: 10px;
}
.select2 {
font-size: 16px;
outline: none;
border-radius: 16px;
}
.select2-selection {
-webkit-box-shadow: 0;
box-shadow: 0;
background-color: #fff;
border: 0;
border-radius: 16px;
color: #555555;
font-size: 14px;
outline: 0;
min-height: 48px;
text-align: left;
}
.select2-selection__rendered {
margin: 10px;
border-radius: 16px;
}
.select2-selection__arrow {
margin: 10px;
border-radius: 16px;
}
[class^='select2'] {
border-radius: 16px !important;
}
#weight, #DateAssign, #DateDue {
width: 80%;
font-size: 16px;
padding: 8px;
outline: none;
border-radius: 16px;
background-color: transparent;
border: 1px solid rgb(192, 192, 192);
color: black;
transition: all 0.5s ease;
}
#weight:focus {
border: 1px solid #5865F2;
}
.modal-dialog {
width: 50%;
}
/* #sidenav {
width: 17%;
background-color: #ccc;
}
#container {
width: 300px;
background-color: #ffcc33;
margin: auto;
}
#sidenav {
width: 17%;
background-color: #ccc;
float: left;
height: auto;
}
#entirepost {
width: 83%;
float: left;
height: auto;
}
#clear {
clear: both;
} */
input[type=file]::file-selector-button {
border: 1px solid #34495e;
padding: 6px;
border-radius: 16px;
background-color: transparent;
width: 150px;
transition: all 0.5s ease;
}
input[type=file]::file-selector-button:hover {
background-color: #34495e;
}
#uploadedImage {
border-radius: 12px;
max-width: 100%;
height: auto;
margin-bottom: 15px;
}
#submissionInfoTable {
width: 50%;
}
#submissionInfoTable th, td {
padding: 2px;
/* border: 1px solid black; */
}
#dropdownmenu i {
float:right;
}
#dropdownmenu {
width: 200px;
}
#grade9thFlare {
background-color: rgb(133, 244, 228);
color: rgb(50, 110, 121);
}
#grade10thFlare {
background-color: rgb(198, 244, 179);
color: rgb(50, 100, 54);
}
#grade11thFlare {
background-color: rgb(206, 213, 255);
color: rgb(50, 100, 145);
}
#grade12thFlare {
background-color: rgb(239, 222, 240);
color: rgb(148, 91, 206);
}
The two posts below the first are both underneath the sidebar and are not within the left and right borders of the first post. And, of course, the 2 posts at the bottom were not in there in the original code as shown above. the sidebar is using the bootstrap utility .col-sm-4 while the posts are all supposed to be using .col-sm-8.
This also seems to happen when I attempt to add a comments feature to another part of my site, the discussion board.
Maybe my googling- I mean, programming skills aren't as good as they usually are, but a good amount of research has yielded no results for my specific issue.
in #entirepost use these
If you want your posts to be displayed horizontally
`display: flex;
align-items: flex-start;
justify-content: center;
flex-direction: row;`
and for vertical display use
display: flex;
align-items: flex-start;
justify-content: center;
flex-direction: column;
Kindly inform me if it did not helped ...

Multi level sub menu

I am trying to create a multi level submenu.
I can display just one sub level menu with this code.
How to increase the code to insert a system with parent id ?
There my code than I am trying to develop.
<style>
* {
margin: 0;
padding: 0;
}
body {
font-family: "Comic Sans MS", cursive;
font-size: 15px;
color: #232323;
}
#head {
background: #f9f9f9;
height: 100px;
padding-top: 15px;
border-bottom: 1px solid #d5dce8;
}
.wrap {
width: 1000px;
margin: 0 auto;
}
#head h1
{
float:left;
}
#head a
{
float:right;
}
input,select
{
width:300px;
height:35px;
}
/* nav menu */
#nav {
margin: 0;
padding: 0;
list-style: none;
border-left: 1px solid #d5dce8;
border-right: 1px solid #d5dce8;
border-bottom: 1px solid #d5dce8;
border-bottom-left-radius: 4px;
-moz-border-radius-bottomleft: 4px;
-webkit-border-bottom-left-radius: 4px;
border-bottom-right-radius: 4px;
-moz-border-radius-bottomright: 4px;
-webkit-border-bottom-right-radius: 4px;
height: 50px;
padding-left: 15px;
padding-right: 15px;
background: #f9f9f9;
}
#nav li {
float: left;
display: block;
background: none;
position: relative;
z-index: 999;
margin: 0 1px;
}
#nav li a {
display: block;
padding: 0;
font-weight: 700;
line-height: 50px;
text-decoration: none;
color: #818ba3;
zoom: 1;
border-left: 1px solid transparent;
border-right: 1px solid transparent;
padding: 0px 12px;
}
#nav li a:hover, #nav li a.hov {
background-color: #fff;
border-left: 1px solid #d5dce8;
border-right: 1px solid #d5dce8;
color: #576482;
}
/* subnav */
#nav ul {
position: absolute;
left: 1px;
display: none;
margin: 0;
padding: 0;
list-style: none;
-moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
-o-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
-webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
padding-bottom: 3px;
}
#nav ul li {
width: 180px;
float: left;
border-top: 1px solid #fff;
text-align: left;
}
#nav ul li:hover {
border-left: 0px solid transparent;
border-right: 0px solid transparent;
}
#nav ul a {
display: block;
height: 20px;
line-height: 20px;
padding: 8px 5px;
color: #666;
border-bottom: 1px solid transparent;
text-transform: uppercase;
color: #797979;
font-weight: normal;
}
#nav ul a:hover {
text-decoration: none;
border-right-color: transparent;
border-left-color: transparent;
background: transparent;
color: #4e4e4e;
}
</style>
<script type="text/javascript">
$(document).ready(function()
{
$('#nav li').hover(function()
{
$('ul', this).slideDown('fast');
}, function()
{
$('ul', this).slideUp('fast');
});
});
</script>
<div class="wrap">
<ul id="nav">
<?php
// Select all entries from the menu table
$Qmenus = $Db->prepare('SELECT a.id,
a.link,
a.parent,
a.class,
a.sort_order,
amd.label
FROM :table_administrator_menu a,
:table_administrator_menu_description amd
where a.id = amd.id
and amd.language_id = :language_id
ORDER BY a.parent,
a.sort_order
');
$Qmenus->bindInt(':language_id', $OSCOM_Language->getId());
$Qmenus->execute();
while($Qmenus->fetch()){
?>
<li class="<?php $Qmenus->value('class'); ?>"><?php echo $Qmenus->value('label'); ?>
<?php
// Select all entries from the menu table
$QsubMenus = $Db->prepare('SELECT sm.id,
sm.link,
sm.parent,
sm.class,
smd.label,
sm.sort_order
FROM :table_administrator_sub_menu sm,
:table_administrator_sub_menu_description smd
where sm.sub_menu_id = smd.sub_menu_id
and smd.language_id = :language_id
order by sm.parent,
sm.sort_order
');
$QsubMenus->bindInt(':language_id', $OSCOM_Language->getId());
$QsubMenus->execute()
?>
<ul>
<?php
while($QsubMenus->fetch()) {
?>
<li class="<?php $QsubMenus->value('class'); ?>"><?php echo $QsubMenus->value('label'); ?></li><?php
}
?>
</ul>
</li>
<?php
}
?>
</ul>
</div>

jquery .show on mouseenter distorts the popup div when 2 divs are side by side

I have created a div that loads hrefs using jquery .load function.
When you mouseenter over an href it loads another popup div using .load.
Everything appears normal when 1 div (with the dates) is loaded see pic(show1) enter image description here
But when I load a second div of dates the popup gets all distorded see pic(show2)enter image description here
Any ideas why this is happening?
Thanks.
This is the code that loads the divs with the hrefs:
<script>
$(document).ready(function(){
$("#left1");
});
</script>
<script>
$(document).ready(function(){
$("#center1");
});
</script>
<script>
$(document).ready(function(){
$("#center2");
});
</script>
<script>
$(document).ready(function(){
$("#center3").load("2016_select_paycheck_to_view.php");
});
</script>
<script>
$(document).ready(function(){
$("#center4").load("2015_select_paycheck_to_view.php");
});
</script>
#center3 {
border-top: 1px solid green;
border-bottom : 1px solid green;
border-left : 0px solid green;
border-right : 1px solid green;
background-color: #FDF5E6;
display: inline-table;
width: 190px;
height: 480px;
}
m3
{
font-family: calibri;
color: black;
font-size: 1em;
text-align: left;
border-top: 2px solid #4d4d4d;
border-left: 2px solid #4d4d4d;
border-right: 0px solid #4d4d4d;
position: relative;
top: 0px;
left: 0px;
padding: 0.2em;
margin-bottom: 0px;
margin-left: 0px;
width: 78px;
line-height: 0.8em;
}
m3t
{
font-family: arial black;
color: white;
font-size: 1em;
text-align: center;
border-top: 3px solid #8A0800;
border-left: 1px solid #8A0800;
border-right: 1px solid #8A0800;
border-bottom: 3px solid #8A0800;
position: relative;
left: 2px;
padding-top: 0.4em;
padding-bottom: 0.4em;
padding-left: 0.1em;
margin-bottom: 0px;
width: 79px;
line-height: 85%;
background-color: #8A0800;
}
m3b
{
font-family: arial black;
color: white;
font-size: 1em;
text-align: center;
border-top: 3.3px solid #8A0800;
border-left: 1px solid #8A0800;
border-right: 1px solid #8A0800;
border-bottom: 3.3px solid #8A0800;
position: relative;
left: 2px;
padding-top: 0.4em;
padding-bottom: 0.4em;
padding-left: 0.1em;
margin-top: 0.8px;
width: 79px;
line-height: 85%;
background-color: #8A0800;
}
#center4 {
border-top: 1px solid green;
border-bottom : 1px solid green;
border-left : 0px solid green;
border-right : 1px solid green;
background-color: #FDF5E6;
width: 190px;
height: 480px;
}
m4
{
font-family: calibri;
color: black;
font-size: 1em;
text-align: left;
border-top: 2px solid #4d4d4d;
border-left: 2px solid #4d4d4d;
border-right: 0px solid #4d4d4d;
display: block;
float: left;
clear: both;
position: relative;
top: 0px;
left: 0px;
padding: 0.2em;
margin-bottom: 0px;
margin-left: 0px;
width: 78px;
line-height: 0.8em;
}
m4t
{
font-family: arial black;
color: white;
font-size: 1em;
text-align: center;
border-top: 3px solid #8A0800;
border-left: 1px solid #8A0800;
border-right: 1px solid #8A0800;
border-bottom: 3px solid #8A0800;
display: block;
float: left;
clear: both;
position: relative;
left: 2px;
padding-top: 0.4em;
padding-bottom: 0.4em;
padding-left: 0.1em;
margin-bottom: 0px;
width: 79px;
line-height: 85%;
background-color: #8A0800;
}
m4b
{
font-family: arial black;
color: white;
font-size: 1em;
text-align: center;
border-top: 3.3px solid #8A0800;
border-left: 1px solid #8A0800;
border-right: 1px solid #8A0800;
border-bottom: 3.3px solid #8A0800;
display: block;
float: left;
clear: both;
position: relative;
left: 2px;
padding-top: 0.4em;
padding-bottom: 0.4em;
padding-left: 0.1em;
margin-top: 0.8px;
width: 79px;
line-height: 85%;
background-color: #8A0800;
}
<div id="firstwrapper">
<div id="left1"> 2019 </div>
<div id="center1"> 2018 </div>
<div id="center2"> 2017 </div>
<div id="center3"> 2016 </div>
<div id="center4"> 2015 </div>
</div>
This is the code that loads the popup divs:
$(function() {
$("a#trigger").mouseenter(function () {
$("div#pop-up").clearQueue();
$("div#pop-up").show();
});
$("a#trigger").mouseleave(function () {
$("div#pop-up").delay(60).slideUp();
});
$("div#pop-up").mouseenter(function () {
$(this).clearQueue();
});
$("div#pop-up").mouseleave(function () {
$(this).delay(200).slideUp();
});
$("a#trigger").mousemove(function(){
var x = $("#center3").offset();
if(x.top > 400, x.left > 9) {
var moveDown = 200;
var moveLeft = -200;
$("div#pop-up").css('top', x.top + moveDown).css('left', x.left + moveLeft);
} else if(x.top > 600, x.left > 40) {
var moveDown = 200;
var moveLeft = -200;
$("div#pop-up").css('top', x.top + moveDown).css('left', x.left + moveLeft);
} else {
var moveDown = 200;
var moveLeft = -200;
$("div#pop-up").css('top', x.top + moveDown).css('left', x.left + moveLeft);
}
});
<style type="text/css">
#secondwrapper {
border: 0px dashed red; /* black */
background: transparent;
position: relative;
left: 0px;
top: 0px;
z-index: 20;
width: 190px;
height: 480px;
}
#middle1 {
border: 1px dashed teal;
width: 190px;
height: 480px;
display: block;
clear: both;
float: left;
position: absolute;
left: 0px;
top: 0px;
margin-top: 0px;
margin-bottom: 20px;
background-color: #FDF5E6;
}
m1year
{
font-family: arial;
color: black;
font-weight: 700;
font-size: 0.9em;
text-align: left;
border: 1px dotted red;
display: block;
float: left;
clear: both;
position: relative;
top: 0px;
left: 0px;
padding: 0.3em;
width: 50px;
height: 8px;
line-height: 0.7em;
background-color: transparent;
}
m1
{
font-family: calibri;
color: #8c0000;
font-size: 1em;
text-align: left;
border-top: 1px solid black;
border-left: 1px solid black;
border-right: 1px solid black;
display: block;
float: left;
clear: both;
position: relative;
top: 0px;
left: 0px;
padding: 0.36em;
margin-bottom: 0em;
margin-left: 10px;
width: 155px;
height: 5px;
line-height: 4.3px;
background-color: white;
}
a:link {
text-decoration: none;
color: #8c0000;
}
a:visited {
color: #8c0000;
} /* visited link */
a:hover {
color: red;
} /* mouse over link */
div#pop-up {
display: none;
position: absolute;
left: 100px;
z-index: 30;
width: 550px;
height: 600px;
background: transparent;
color: #000000;
border: 0px dashed #ff6600; /* ORANGE */
}
</style>
<script>
$(document).ready(function(){
$("#pop-up").load("2016_dump_expenses_sums_PER_PAYCHECK_DYNAMIC.php? THURSDAY=<?PHP echo ($array0); ?>&WEDNESDAY=<?PHP echo ($array13); ?>&pay=<?PHP echo (958); ?>" ); });
</script>
<div id="secondwrapper">
<div id="middle1"
<m1year> 2016 </m1year>
<m1>
<A HREF="2016_dump_expenses_sums_PER_PAYCHECK_DYNAMIC.php?THURSDAY=<?PHP echo ($array0); ?>&WEDNESDAY=<?PHP echo ($array13); ?>&pay=<?PHP echo (958); ?> "
TARGET="mainFrame" id="trigger">
<?PHP
print ("$newMonth1");
print ("&nbsp");
print ("$newDay1");
print ("&nbsp");
print ("-");
print ("&nbsp");
print ("$newMonth1a");
print ("&nbsp");
print ("$newDay1a");
?>
</A></m1>
</div>
</div>
<div id="pop-up"> </div>
<div id="pop-up2"> </div>
<div id="pop-up3"> </div>
<div id="pop-up4"> </div>
Ok I think I fixed it. It was my css I removed some divs and it appears to be working ok now.
Please, show us the markup and css you're using: it looks like something inherent to css issue.

Pagination in PHP using For Loop

echo "<ul class ='pagination'>";
for ($b=1;$b<=$a;$b++)
{
?><li><?php echo $b; ?></li><?php
}
echo "</ul>";
ul.pagination {
display: inline-block;
padding: 0;
margin: 0;
}
ul.pagination li {display: inline;}
ul.pagination li a {
color: black;
float: left;
padding: 8px 16px;
text-decoration: none;
transition: background-color .3s;
border: 1px solid #ddd;
}
.pagination li:first-child a {
border-top-left-radius: 5px;
border-bottom-left-radius: 5px;
}
.pagination li:last-child a {
border-top-right-radius: 5px;
border-bottom-right-radius: 5px;
}
ul.pagination li a.active {
background-color: #4CAF50;
color: white;
border: 1px solid #4CAF50;
}
ul.pagination li a:hover:not(.active) {background-color: #ddd;}
I need help in for loops .. my pagination looks like this
1 ----- 2 ----- 3 ----- 4
5 ------- 6 ----- 7 ----- 8

Moodle Login page Change

I'm trying to add new fields in moodle login page. I'm simply editing the index_form.html in login folder.
I'm using evolve theme and using moodle version 2.8
I want a dropdown field for administrator, teacher and student. If user selects administrator or teacher they have the fields of username and password, but if student is been selected one extra field of Adhar number is added for validation dynamically.
I have created the fields just need to add it to database and conditional logic. In the backend of user profile fields I've added a custom user fields under the name of Adhar Number whose short name I've kept as Adharno, lot of things more is to be done and I'm unable to find path, following is the link below with html code and css
www.sanskritiskills.com/assessment/login/index.php
Code block:
<?php
if ($show_instructions) {
$columns = 'twocolumns';
} else {
$columns = 'onecolumn';
}
if (!empty($CFG->loginpasswordautocomplete)) {
$autocomplete = 'autocomplete="off"';
} else {
$autocomplete = '';
}
if (empty($CFG->authloginviaemail)) {
$strusername = get_string('username');
} else {
$strusername = get_string('usernameemail');
}
?>
<div class="loginbox clearfix <?php echo $columns ?>">
<div class="loginpanel">
<?php
if (($CFG->registerauth == 'email') || !empty($CFG->registerauth)) { ?>
<div class="skiplinks"><a class="skip" href="signup.php"><?php print_string("tocreatenewaccount"); ?></a></div>
<?php
} ?>
<h2><?php print_string("login") ?></h2>
<div class="subcontent loginsub">
<?php
if (!empty($errormsg)) {
echo html_writer::start_tag('div', array('class' => 'loginerrors'));
echo html_writer::link('#', $errormsg, array('id' => 'loginerrormessage', 'class' => 'accesshide'));
echo $OUTPUT->error_text($errormsg);
echo html_writer::end_tag('div');
}
?>
<form action="<?php echo $CFG->httpswwwroot; ?>/login/index.php" method="post" id="login" <?php echo $autocomplete; ?> >
<div class="loginform">
<div class="form-input">
Select Role :
<select required>
<option value="Admin">Admin</option>
<option value="Student">Student</option>
<option value="Teacher">Teacher</option>
</select>
</div>
</div>
<div class="clearer"><!-- --></div>
<div class="form-label"><label for="username"><?php echo($strusername) ?></label></div>
<div class="form-input">
<input type="text" name="username" id="username" size="15" value="<?php p($frm->username) ?>" />
</div>
<div class="clearer"><!-- --></div>
<div class="form-label"><label for="password"><?php print_string("password") ?></label></div>
<div class="form-input">
<input type="password" name="password" id="password" size="15" value="" <?php echo $autocomplete; ?> />
</div>
<div class="clearer"><!-- --></div>
<div class="form-label"><label for="password">Adhar No.</label></div>
<div class="form-input">
<input type="password" name="Adhar Number" id="password" size="15" value="" <?php echo $autocomplete; ?> />
</div>
</div>
<div class="clearer"><!-- --></div>
<?php if (isset($CFG->rememberusername) and $CFG->rememberusername == 2) { ?>
<div class="rememberpass">
<input type="checkbox" name="rememberusername" id="rememberusername" value="1" <?php if ($frm->username) {echo 'checked="checked"';} ?> />
<label for="rememberusername"><?php print_string('rememberusername', 'admin') ?></label>
</div>
<?php } ?>
<div class="clearer"><!-- --></div>
<input type="submit" id="loginbtn" value="<?php print_string("login") ?>" />
<div class="forgetpass"><?php print_string("forgotten") ?></div>
</form>
<div class="desc">
<?php
echo get_string("cookiesenabled");
echo $OUTPUT->help_icon('cookiesenabled');
?>
</div>
</div>
<?php if ($CFG->guestloginbutton and !isguestuser()) { ?>
<div class="subcontent guestsub">
<div class="desc">
<?php print_string("someallowguest") ?>
</div>
<form action="index.php" method="post" id="guestlogin">
<div class="guestform">
<input type="hidden" name="username" value="guest" />
<input type="hidden" name="password" value="guest" />
<input type="submit" value="<?php print_string("loginguest") ?>" />
</div>
</form>
</div>
<?php } ?>
</div>
<?php if ($show_instructions) { ?>
<div class="signuppanel">
<h2><?php print_string("firsttime") ?></h2>
<div class="subcontent">
<?php if (is_enabled_auth('none')) { // instructions override the rest for security reasons
print_string("loginstepsnone");
} else if ($CFG->registerauth == 'email') {
if (!empty($CFG->auth_instructions)) {
echo format_text($CFG->auth_instructions);
} else {
print_string("loginsteps", "", "signup.php");
} ?>
<div class="signupform">
<form action="signup.php" method="get" id="signup">
<div><input type="submit" value="<?php print_string("startsignup") ?>" /></div>
</form>
</div>
<?php } else if (!empty($CFG->registerauth)) {
echo format_text($CFG->auth_instructions); ?>
<div class="signupform">
<form action="signup.php" method="get" id="signup">
<div><input type="submit" value="<?php print_string("startsignup") ?>" /></div>
</form>
</div>
<?php } else {
echo format_text($CFG->auth_instructions);
} ?>
</div>
</div>
<?php } ?>
<?php if (!empty($potentialidps)) { ?>
<div class="subcontent potentialidps">
<h6><?php print_string('potentialidps', 'auth'); ?></h6>
<div class="potentialidplist">
<?php foreach ($potentialidps as $idp) {
echo '<div class="potentialidp">' . $OUTPUT->render($idp['icon'], $idp['name']) . $idp['name'] . '</div>';
} ?>
</div>
</div>
<?php } ?>
</div>
CSS File which is available:
/* evolved CSS
-------------------------*/
#dock {background: #32352c; }
.arrow {color: #3d3d3d; }
.block .header h2 {color: #3d3d3d;}
.dir-rtl a.logo {
background: url([[setting:logo]]) no-repeat 100% 0;
display: block;
float: right;
}
.pagelayout-report .no-overflow {
overflow: auto;
}
.service {
display:block;
padding:10px;
margin: 10px;
text-align:left;
background-color: [[setting:marketboxcolor]];
-webkit-border-radius:4px;
-moz-border-radius:4px;
border-radius:4px;
}
#fullbkg {
background: url([[setting:fpbkg]]) no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
/*Frontpage Login*/
.wrap {
width:250px;
height: auto;
margin: auto;
margin-top: 10%;
margin-bottom: 3%;
}
.avatarlogin {
width: 100%;
margin: auto;
width: 65px;
border-radius: 100px;
height: 65px;
background: #000 ;
position: relative;
bottom: -15px;
}
.avatarlogin img {
width: 55px;
height: 55px;
border-radius: 100px;
margin: auto;
border:3px solid #fff;
display: block;
}
.wrap input {
border: none;
background: #fff;
font-family:Lato ;
font-weight:700 ;
display: block;
height: 40px;
outline: none;
width: calc(100% - 24px) ;
margin: auto;
padding: 6px 12px 6px 12px;
}
.bar {
width: 100%;
height: 1px;
background: #fff ;
}
.bar i {
width: 95%;
margin: auto;
height: 1px ;
display: block;
background: #d1d1d1;
}
.wrap input[type="text"] {
border-radius: 7px 7px 0px 0px ;
}
.wrap input[type="password"] {
border-radius: 0px 0px 7px 7px ;
}
.forgot_link {
color: #83afdf ;
color: #83afdf;
text-decoration: none;
font-size: 11px;
position: relative;
left: 193px;
top: -36px;
}
.wrap button {
width: 100%;
border-radius: 7px;
background: #b6ee65;
text-decoration: center;
border: none;
color: #51771a;
margin-top:-5px;
padding-top: 14px;
padding-bottom: 14px;
outline: none;
font-size: 20px;
border-bottom: 3px solid #307d63;
cursor: pointer;
}
/*.loginbox {
background: rgba(100,100,100,.1);
padding:50px;
-webkit-box-shadow: 1px 0px 29px 14px rgba(255,255,255,0.6);
-moz-box-shadow: 1px 0px 29px 14px rgba(255,255,255,0.6);
box-shadow: 1px 0px 29px 14px rgba(255,255,255,0.6);
-webkit-border-radius:10px;
-moz-border-radius:10px;
border-radius:10px;
}*/
.loginbox h2{
color: #DBDBDB;
text-align:center;
}
.loginbox form a{
color: #fff;
}
.loginbox form{
color: #fff;
}
.loginbox p{
color: #fff;
}
/*.loginpanel .loginsub {
background: rgba(0,0,0,.6);
-webkit-border-radius:10px;
-moz-border-radius:10px;
border-radius:10px;
margin: 10px;
}*/
.loginpanel .loginsub {
background: rgba(0,0,0,.8);
max-width:400px;
-webkit-box-shadow: 1px 0px 29px 14px rgba(255,255,255,0.6);
-moz-box-shadow: 1px 0px 29px 14px rgba(255,255,255,0.6);
box-shadow: 1px 0px 29px 14px rgba(255,255,255,0.6);
-webkit-border-radius:10px;
-moz-border-radius:10px;
border-radius:10px;
border:5px solid #fff;
margin: auto;
padding:20px;
}
.signuppanel .subcontent{
background: rgba(0,0,0,.6);
max-width:400px;
-webkit-box-shadow: 1px 0px 29px 14px rgba(255,255,255,0.6);
-moz-box-shadow: 1px 0px 29px 14px rgba(255,255,255,0.6);
box-shadow: 1px 0px 29px 14px rgba(255,255,255,0.6);
-webkit-border-radius:10px;
-moz-border-radius:10px;
border-radius:10px;
margin: auto;
}
/* Alerts (aardvark) */
#page-header-generalalert {
clear:both;
display: block;
color:#ff9f00;
background-color:#fef8d2;
padding:8px 35px 8px 14px;
margin-bottom:20px;
text-shadow:0 1px 0 rgba(255,255,255,0.5);
border:1px solid #fde6af;
-webkit-border-radius:4px;
-moz-border-radius:4px;
border-radius:4px;
}
#page-header-generalalert:before {
background-color: #ff9f00;
color: #FFFFFF;
display: block;
float: left;
font-family: FontAwesome;
font-size: 1.2em;
height: 1.4em;
margin-right: 0.5em;
margin-top: -0.15em;
margin-left: -0.5em;
padding-top: 0.2em;
text-align: center;
width: 1.7em;
content:"\f06a";
border-radius: 3px 3px 3px 3px;
text-shadow:none;
}
#page-header-snowalert {
clear:both;
display: block;
color:#3a87ad;
background-color:#d9edf7;
padding:8px 35px 8px 14px;
margin-bottom:20px;
text-shadow:0 1px 0 rgba(255,255,255,0.5);
border:1px solid #bce8f1;
-webkit-border-radius:4px;
-moz-border-radius:4px;
border-radius:4px;
}
#page-header-snowalert:before {
background-color: #3a87ad;
color: #FFFFFF;
display: block;
float: left;
font-family: FontAwesome;
font-size: 1.2em;
height: 1.4em;
margin-right: 0.5em;
margin-top: -0.15em;
margin-left: -0.5em;
padding-top: 0.2em;
text-align: center;
width: 1.7em;
content:"\f069";
border-radius: 3px 3px 3px 3px;
text-shadow:none;
}
/*Google Fonts (Theme Essential)*/
/* #group Headings */
h1, h2, h3, h4, h5, h6,
.back-to-top,
.socials p,
#socialheading,
.forumpost .subject,
.block_login label {
font-family: "[[setting:headingfont]]", sans-serif;
}
/* #group Main Text */
body,
.block_login input[type="submit"] {
font-family: "[[setting:bodyfont]]", Arial, Helvetica, sans-serif;
font-size: [[setting:bodysize]];
font-weight: [[setting:bodyweight]];
}
/* #end */
/*Special thanks to Shaun Daubney (Theme Aardvark)
for the colored icons in the blocks.
*/
.block .header .title h2:before {
color: #FFFFFF;
display: block;
float: left;
font-family: FontAwesome;
font-size: 1.2em;
height: 1.3em;
margin-left: -0.5em;
margin-right: 0.5em;
margin-top: -0.2em;
padding-top: 0.2em;
text-align: center;
width: 1.5em;
-webkit-border-radius:2px;
-moz-border-radius:2px;
border-radius:2px;
}
.block_news_items .header .title h2:before {
background-color: #29A294;
content:"\f0a1";
}
.block_navigation .header .title h2:before {
background-color: #f42941;
content:"\f0e8";
}
.block_calendar_upcoming .header .title h2:before,
.block_calendar_month .header .title h2:before {
background-color: #008ecd;
content:"\f073";
}
.block_course_list .header .title h2:before {
background-color: #ffce00;
content:"\f108";
}
.block_completionstatus .header .title h2:before,
.block_selfcompletion .header .title h2:before {
background-color: #76b900;
content:"\f0e4";
}
.block_rss_client .header .title h2:before {
background-color: #ff9500;
content:"\f09e";
}
.block_rss_plus .header .title h2:before {
background-color: #ff9500;
content:"\f09e";
}
.block_blog_menu .header .title h2:before {
background-color: #ff9500;
content:"\f02d";
}
.block_quiz_results .header .title h2:before {
background-color: #76b900;
content:"\f080";
}
.block_quiz_navblock .header .title h2:before {
background-color: #76b900;
content:"\f126";
}
.block_glossary_random .header .title h2:before {
background-color: #3d3d3d;
content:"\f0eb";
}
.block_book_toc .header .title h2:before {
background-color: #3d3d3d;
content:"\f02d";
}
.block_participants .header .title h2:before,
.block_online_users .header .title h2:before {
background-color: #92499e;
content:"\f0c0";
}
.block_html .header .title h2:before {
background-color: #eeeeee;
}
.block_section_links .header .title h2:before {
background-color: #f42941;
content:"\f02e";
}
.block_activity_modules .header .title h2:before {
background-color: #f42941;
content:"\f12e";
}
.block_comments .header .title h2:before {
background-color: #ffce00;
content:"\f075";
}
.block_settings .header .title h2:before,
.block_admin_bookmarks .header .title h2:before{
background-color: #004675;
content:"\f085";
}
.block_blog_tags .header .title h2:before,
.block_tags .header .title h2:before {
background-color: #ff9f00;
content:"\f02c";
}
.block_private_files .header .title h2:before {
background-color: #82cadd;
content:"\f114";
}
.block_block_mentees .header .title h2:before {
background-color: #3d3d3d;
content:"\f0c0";
}
.block_messages .header .title h2:before {
background-color: #ffce00;
content:"\f0e0";
}
.block_community .header .title h2:before {
background-color: #ffce00;
content:"\f0ac";
}
.block_login .header .title h2:before {
background-color: #3d3d3d;
content:"\f007";
}
.block_recent_activity .header .title h2:before {
background-color: #cee3ed;
content:"\f017";
}
.block_search_forums .header .title h2:before {
background-color: #ffce00;
content:"\f0e6";
}
.block_myprofile .header .title h2:before {
background-color: #f42941;
content:"\f007";
}
.block_adminblock .header .title h2:before {
background-color: #E0F52A;
content:"\f055";
}
.block_feedback .header .title h2:before {
background-color: #ffce00;
content:"\f087";
}
.block_flickr .header .title h2:before {
background-color: #ff3096;
content:"\f03e";
}
.block_youtube .header .title h2:before {
background-color: #f42941;
content:"\f145";
}
.block_course_badges .header .title h2:before {
background-color: #29a294;
content:"\f091";
}
.block_twitter_search .header .title h2:before {
background-color: #008ecd;
content:"\f099";
}
.block_heritage .header .title h2:before {
background-color: #3e647e;
content:"\f02d";
}
.block_lrc .header .title h2:before {
background-color: #3e647e;
content:"\f02d";
}
/*Social Wall*/
.format-socialwall .course-content ul.topics li.section {
border-bottom: 0px solid #ccc;
margin-top: 0;
}
/*.mform {
background-color: #f2f2f2;
padding: 10px;
border-radius: 10px;
}*/
.format-socialwall #section-2 .content {
background-color: #f7f7f7;
padding: 10px;
margin: 0px;
border: 3px solid #d4d4d4;
border-radius: 4px;
margin-top:15px;
margin-bottom: 15px;
-moz-box-shadow: 0px 0px 25px #ccc;
-webkit-box-shadow: 0 0 25px #ccc;
box-shadow: 0px 0px 25px #ccc;
}
.tl-post {
margin: 30px 0px 50px 0px;
padding:15px;
}
.tl-posttext {
background-color: #fff;
padding: 10px 10px 20px 10px;
border-radius: 10px 10px 0px 0px;
//border: 1px solid #ccc;
margin-top: 10px;
}
ul.section.tl-postattachment {
background-color: #fff;
padding: 5px 5px 5px 50px;
//border-left: 1px solid #ccc;
//border-right: 1px solid #ccc;
margin:0px;
}
.tl-text {
margin-left: 40px;
padding: 0 5px;
border: 2px solid #efefef;
padding: 10px;
-moz-box-shadow: 0px 0px 25px #e7e7e7;
-webkit-box-shadow: 0 0 25px #e7e7e7;
box-shadow: 0px 0px 25px #e7e7e7;
border-radius: 4px 4px 4px 4px;
}
/*.tl-text {
margin-left: 40px;
//border: none;
border: 1px solid #efefef;
background-color: #f7f7f7;
padding:7px;
border-radius: 10px 10px 10px 10px;
}*/
.tl-comments {
background-color: #f7f7f7;
padding:15px;
margin:0px;
}
.tl-comment {
padding-left:25px;
padding-top: 0px;
padding-bottom: 0px;
}
.tl-post-actionarea {
//border: 1px solid #ccc;
padding: 4px 4px 10px 4px;
//background: #F0F3F7;
//border-radius: 0px 0px 5px 5px;
}
.tl-timeago, .tl-counts {
font-size: 12px;
color: #666;
line-height: 15px;
padding-bottom: 5px;
}
.like {
border-top: 1px solid #96d1f8;
background: #65a9d7;
background: -webkit-gradient(linear, left top, left bottom, from(#3e779d), to(#65a9d7));
background: -webkit-linear-gradient(top, #3e779d, #65a9d7);
background: -moz-linear-gradient(top, #3e779d, #65a9d7);
background: -ms-linear-gradient(top, #3e779d, #65a9d7);
background: -o-linear-gradient(top, #3e779d, #65a9d7);
padding: 5px 5px;
-webkit-border-radius: 8px;
-moz-border-radius: 8px;
border-radius: 8px;
-webkit-box-shadow: rgba(0,0,0,1) 0 1px 0;
-moz-box-shadow: rgba(0,0,0,1) 0 1px 0;
box-shadow: rgba(0,0,0,1) 0 1px 0;
text-shadow: rgba(0,0,0,.4) 0 1px 0;
color: white;
font-size: 14px;
font-family: Georgia, serif;
text-decoration: none;
vertical-align: middle;
}
.like:hover {
border-top-color: #28597a;
background: #28597a;
color: #ccc;
}
.like:active {
border-top-color: #1b435e;
background: #1b435e;
}
.likenomore {
border-top: 1px solid #96d1f8;
background: #65a9d7;
background: -webkit-gradient(linear, left top, left bottom, from(#3e779d), to(#65a9d7));
background: -webkit-linear-gradient(top, #3e779d, #65a9d7);
background: -moz-linear-gradient(top, #3e779d, #65a9d7);
background: -ms-linear-gradient(top, #3e779d, #65a9d7);
background: -o-linear-gradient(top, #3e779d, #65a9d7);
padding: 5px 5px;
-webkit-border-radius: 8px;
-moz-border-radius: 8px;
border-radius: 8px;
-webkit-box-shadow: rgba(0,0,0,1) 0 1px 0;
-moz-box-shadow: rgba(0,0,0,1) 0 1px 0;
box-shadow: rgba(0,0,0,1) 0 1px 0;
text-shadow: rgba(0,0,0,.4) 0 1px 0;
color: white;
font-size: 14px;
font-family: Georgia, serif;
text-decoration: none;
vertical-align: middle;
}
.likenomore:hover {
border-top-color: #28597a;
background: #28597a;
color: #ccc;
}
.likenomore:active {
border-top-color: #1b435e;
background: #1b435e;
}
form.tl-commentform {
padding-top: 10px;
}
#postform .fitem .felement #id_submitbutton {
margin:0px;
}
Please help me out in this
I'm not 100% sure what you're asking here - Is it the backend element or is it the frontend element that you're struggling with?
The easiest way (not the best way) to achieve what you're doing here is to hide the extra field if the user selects a non-student role. This is just basic JavaScript.
The script you're looking for looks something like this:
$(document).ready(function () {
$("select").change(function () {
$("select option:selected").each(function () {
if ($(this).attr("value") == "Student") {
$(".test").show();
}
if ($(this).attr("value") != "Student") {
$(".test").hide();
}
});
}).change();
});
And here's the Fiddle to see it in action.
HTH

Categories