(我没有足够的声誉发布超过2个链接,因此我写了URLS)
在material-ui(w * w.material-ui.com)中,我可以编写嵌套菜单和下拉菜单。但是我没有找到一个在主菜单中打开嵌套菜单的例子。
使用嵌套菜单和下拉菜单,嵌套菜单每次都会打开,作为主菜单旁边或上方的新窗口。就像这个例子:Menu with nested menu opened to the right
但我想在主菜单中打开嵌套菜单。像这个例子: Nested menus open in main menu
有人可以告诉我一个如何实现这个目标的例子。 感谢
答案 0 :(得分:2)
您使用的是错误的组件。使用带有NestedItems
的ListItem的List <?php
include('dbcon.php');
if (isset($_POST['submit'])){
$month = $_POST['month'];
$guard = $_POST['guard_id'];
$time = $_POST['time_id'];
$area1 = $_POST['aream'];
$area2 = $_POST['areat'];
$area3 = $_POST['areaw'];
$area4 = $_POST['areath'];
$area5 = $_POST['areaf'];
$m = $_POST['m'];
$t = $_POST['t'];
$w = $_POST['w'];
$th = $_POST['th'];
$f = $_POST['f'];
foreach($area1 as $aream)
{
//monday sched
foreach ($m as $daym){
//check conflict
$query=mysql_query("select *,COUNT(*) as count from gov_sched
natural join member natural join time where guard_id='$guard' and gov_sched.time_id='$daym' and area='$aream'
and day='m' and month='$month'")or die(mysql_error());
$row=mysql_fetch_array($query);
$count=$row['count'];
$time1=date("h:i a",strtotime($row['time_in']))."-".date("h:i a",strtotime($row['time_out']));
$guard1=$row['lastname']." ".$row['firstname'];
$area1=$row['area'];
$queryt=mysql_query("select * from member where member_id='$guard'")or die(mysql_error());
$rowt=mysql_fetch_array($queryt);
$guardt=$rowt['lastname']." ".$rowt['firstname'];
$querytime=mysql_query("select * from time where time_id='$daym'")or die(mysql_error($con));
$rowt=mysql_fetch_array($querytime);
$timet=date("h:i a",strtotime($rowt['time_in']))."-".date("h:i a",strtotime($rowt['time_out']));
if ($count==0)
{
mysql_query("INSERT INTO gov_sched(month,guard_id,area,time_id,day) VALUES ('$month','$guard','$aream','$daym','m')")or die(mysql_error());
echo "<span class='text-success'>$month $timet $guardt at $aream every Monday successfully added!</span><br>";
}
else{
echo "<span class='text-danger'>$month $time1 is already taken by $guard1 at $aream every Monday </span><br>";
}
}
}
foreach($area2 as $areat)
{
foreach ($t as $dayt){
//check conflict
$query=mysql_query("select *,COUNT(*) as count from gov_sched
natural join member natural join time where guard_id='$guard' and gov_sched.time_id='$dayt' and area='$areat'
and day='t' and month='$month'")or die(mysql_error());
$row=mysql_fetch_array($query);
$count=$row['count'];
$time1=date("h:i a",strtotime($row['time_in']))."-".date("h:i a",strtotime($row['time_out']));
$guard1=$row['lastname']." ".$row['firstname'];
$area1=$row['area'];
$queryt=mysql_query("select * from member where member_id='$guard'")or die(mysql_error());
$rowt=mysql_fetch_array($queryt);
$guardt=$rowt['lastname']." ".$rowt['firstname'];
$querytime=mysql_query("select * from time where time_id='$dayt'")or die(mysql_error($con));
$rowt=mysql_fetch_array($querytime);
$timet=date("h:i a",strtotime($rowt['time_in']))."-".date("h:i a",strtotime($rowt['time_out']));
if ($count==0)
{
mysql_query("INSERT INTO gov_sched(month,guard_id,area,time_id,day) VALUES ('$month','$guard','$areat','$dayt','t')")or die(mysql_error());
echo "<span class='text-success'>$month $timet $guardt at $areat every Tuesday successfully added!</span><br>";
}
else{
echo "<span class='text-danger'>$month $time1 is already taken by $guard1 at $areat every Tuesday </span><br>";
}
}
}
foreach($area3 as $areaw)
{
foreach ($w as $dayw){
//check conflict
$query=mysql_query("select *,COUNT(*) as count from gov_sched
natural join member natural join time where guard_id='$guard' and gov_sched.time_id='$dayw' and area='$areaw'
and day='w' and month='$month'")or die(mysql_error());
$row=mysql_fetch_array($query);
$count=$row['count'];
$time1=date("h:i a",strtotime($row['time_in']))."-".date("h:i a",strtotime($row['time_out']));
$guard1=$row['lastname']." ".$row['firstname'];
$area1=$row['area'];
$queryt=mysql_query("select * from member where member_id='$guard'")or die(mysql_error());
$rowt=mysql_fetch_array($queryt);
$guardt=$rowt['lastname']." ".$rowt['firstname'];
$querytime=mysql_query("select * from time where time_id='$dayw'")or die(mysql_error($con));
$rowt=mysql_fetch_array($querytime);
$timet=date("h:i a",strtotime($rowt['time_in']))."-".date("h:i a",strtotime($rowt['time_out']));
if ($count==0)
{
mysql_query("INSERT INTO gov_sched(month,guard_id,area,time_id,day) VALUES ('$month','$guard','$areaw','$dayw','w')")or die(mysql_error());
echo "<span class='text-success'>$month $timet $guardt at $areaw every Wednesday successfully added!</span><br>";
}
else{
echo "<span class='text-danger'>$month $time1 is already taken by $guard1 at $areaw every Wednesday </span><br>";
}
}
}
foreach($area4 as $areath)
{
foreach ($th as $dayth){
//check conflict
$query=mysql_query("select *,COUNT(*) as count from gov_sched
natural join member natural join time where guard_id='$guard' and gov_sched.time_id='$dayth' and area='$areath'
and day='th' and month='$month'")or die(mysql_error());
$row=mysql_fetch_array($query);
$count=$row['count'];
$time1=date("h:i a",strtotime($row['time_in']))."-".date("h:i a",strtotime($row['time_out']));
$guard1=$row['lastname']." ".$row['firstname'];
$area1=$row['area'];
$queryt=mysql_query("select * from member where member_id='$guard'")or die(mysql_error());
$rowt=mysql_fetch_array($queryt);
$guardt=$rowt['lastname']." ".$rowt['firstname'];
$querytime=mysql_query("select * from time where time_id='$dayth'")or die(mysql_error($con));
$rowt=mysql_fetch_array($querytime);
$timet=date("h:i a",strtotime($rowt['time_in']))."-".date("h:i a",strtotime($rowt['time_out']));
if ($count==0)
{
mysql_query("INSERT INTO gov_sched(month,guard_id,area,time_id,day) VALUES ('$month','$guard','$areath','$dayth','th')")or die(mysql_error());
echo "<span class='text-success'>$month $timet $guardt at $areath every Thursday successfully added!</span><br>";
}
else{
echo "<span class='text-danger'>$month $time1 is already taken by $guard1 at $areath every Thursday </span><br>";
}
}
}
foreach($area5 as $areaf)
{
foreach ($f as $dayf){
//check conflict
$query=mysql_query("select *,COUNT(*) as count from gov_sched
natural join member natural join time where guard_id='$guard' and gov_sched.time_id='$dayf' and area='$areaf'
and day='f' and month='$month'")or die(mysql_error());
$row=mysql_fetch_array($query);
$count=$row['count'];
$time1=date("h:i a",strtotime($row['time_in']))."-".date("h:i a",strtotime($row['time_out']));
$guard1=$row['lastname']." ".$row['firstname'];
$area1=$row['area'];
$queryt=mysql_query("select * from member where member_id='$guard'")or die(mysql_error());
$rowt=mysql_fetch_array($queryt);
$guardt=$rowt['lastname']." ".$rowt['firstname'];
$querytime=mysql_query("select * from time where time_id='$dayf'")or die(mysql_error($con));
$rowt=mysql_fetch_array($querytime);
$timet=date("h:i a",strtotime($rowt['time_in']))."-".date("h:i a",strtotime($rowt['time_out']));
if ($count==0)
{
mysql_query("INSERT INTO gov_sched(month,guard_id,area,time_id,day) VALUES ('$month','$guard','$areaf','$dayf','f')")or die(mysql_error());
echo "<span class='text-success'>$timet $guardt at $areaf every Friday successfully added!</span><br>";
}
else{
echo "<span class='text-danger'>$time1 is already taken by $guard1 at $areaf every Friday </span><br>";
}
}
}
}
?>