Option selection help in Table with PHP & Html -
here index coding
<?php require_once '../../fv-pluginapi.php'; // running engine fbacctheader(); //get account header ?> <form method="post"> <input type="hidden" name="userid" value="<?= $_session['userid']; ?>"><br> <html><head><link rel="stylesheet" type="text/css" href="css/index.css" /> <style type="text/css"> html, body {background-color: #f0f0f0;border:0;font-family:hobo std;font-size: 10pt;margin:1px;} .maintable1 {margin-top: 1px; border:1px solid:#3675c5; background-color: white; color:#40007f } .maintable th {font-size:10pt; padding: 1px; border:1px solid #40007f; background-color: #2496ff; color:white ;} .maintable td {font-size:10pt;padding:1px; border:1px solid #40007f; } .maintable1 {margin-top: 1px; border:1px solid:red; background-color:#f0f0f0; color:white } .maintable1 th {font-size:10pt; padding: 1px; border:1px solid black; background-color: #007f00; color:white ;} .maintable1 td {font-size:10pt;padding:1px; border:1px solid black; } .maintable1 tr{height:12px;} .maintable1 td:hover {background-color:#ffff00;} </style> <br> <form name="tpform" method="post"> <? # header selection form echo '<br><table class="maintable1" align="center">'; $damt2 = isset($_post['damt2']) ? $_post['damt2'] : 200; // confusion here $dateinfo2 = json_decode(file_get_contents($_session['base_path'] . 'dl.dict'), true); //dl.dict file i'm getting info in table arsort($dateinfo2); //arsort — sort array in reverse order , maintain index association $dateinfo2 = array_slice($dateinfo2, 0, $damt2); //array_slice — extract slice of array ?> <center> <font color="darkred" >show last enhanced list: <form method="post" style="display:inline"> <input type="hidden" name="userid" value="<?= $_session['userid']; ?>"> <select name="damt2" onchange="this.form.submit()"> <option value="50" <?= (isset($damt2) & $damt2 == 50) ? 'selected' : ''; ? >>50</option> <option value="100" <?= (isset($damt2) & $damt2 == 100) ? 'selected' : ''; ?>>100</option> <option value="200" <?= (isset($damt2) & $damt2 == 200) ? 'selected' : ''; ?>>200</option> <option value="300" <?= (isset($damt2) & $damt2 == 300) ? 'selected' : ''; ?>>300</option> </select> <input type="submit" name="submit" value="show list & save"> </center></br> <? echo '<tr><th>image</th> <th>info</th> <th>image</th><th>info</th></tr>'; foreach ($dateinfo2 $key => $time) { $uinfo = $_session['data']->table('units')->byname($key)->data();//item data name if ($uinfo["keyword"] != 'horse'&& $uinfo["type"] != 'tree' && $uinfo["keyword"] != 'chicken'&& $uinfo["keyword"] != 'cow' && $uinfo["type"] != 'building') continue; /* note: can write if ($uinfo["keyword"] != 'horse' && $uinfo["type"] != 'tree') continue; */ $iconurl = getimageurl($uinfo['iconname']); @$bgcolor = ($bgcolor == '#b3002d') ? '#80ff00' : '#ffffff'; if ($qq / 2 == intval($qq / 2)) echo '</tr><tr style="background-color: ' . $bgcolor . ';">'; echo '<td align="center"><br><img onclick="document.getelementbyid(\'itemn\').value=document.getelementbyid(\'itemn\').value + \''; echo '|'.$uinfo['code'].''; echo '\'" src="' . $iconurl . '" title="'.$uinfo[realname].' '.$uinfo[limitedstart].'" width="120" '; echo '<br><br><a onclick="document.getelementbyid(\'itemn\').value=document.getelementbyid(\'itemn\').value+ \''; echo $uinfo['code'].'|'; echo '\'"/> <font color="dimgray">' . $uinfo['code'] . '</font></br>'; echo '<center><font color="orange"><b>'.$uinfo['cost'].'</font><img src="'.$img1.'" width="17px"/></b><br>'; echo '<center><font color="green"><b>'.$uinfo['cash'].'</font><img src="'.$img.'" width="17px"/></b><br></td>'; echo '<td width=200px><center><font color="black">'.$uinfo['realname'].'</font><br>'; echo '<center><font color="black">'.$uinfo['name'].'</font><br>'; # if req info empty noting show in text/heading if (isset($uinfo['type']) && !empty($uinfo['type'])) { echo '<center><font color="olive">type: '.$uinfo['type'].'</font><br>'; }else{ } if (isset($uinfo['animaltype']) && !empty($uinfo['animaltype'])) { echo '<center><font color="black">animal tp: '.$uinfo['animaltype'].'</font><br>'; }else{ } if (isset($uinfo['baby']) && !empty($uinfo['baby'])) { echo '<center><font color="jade">baby nm: '.$uinfo['baby'].'</font><br>'; }else{ } if (isset($uinfo['buyable']) && !empty($uinfo['buyable'])) { echo '<center><font color="jade">can buy</font><br>'; }else{ } echo '<font color="darkblue">' . date($_session['dateformat'], $time).'</td>'; $qq++; } echo '</div></tr></tr>'; echo '</table>'; ?> right ! above coding i'm able number selection drop down option means select how many number of items wanted result in table. show list & save
but question :
i want add 1 more option selection menu filter items hores & tree & chicken in selection range
tip : range selection is
value = 50
value = 100
value = 200
and value = 300
in above coding
Comments
Post a Comment