$query = "SELECT * from INGREDIENT WHERE Ingredient_Id={$ing_id}"; $ing = mysql_query($query); $num_fields = mysql_num_fields($ing); for ($i = 0; $i < $num_fields; $i++) { echo "<tr>" . "\n"; echo "<td>" . "\n"; $field = mysql_field_name($ing, $i); echo "<b>" . $field . "</b>" . "\n"; echo "</td>" . "\n"; echo "<td>" . "\n"; $res = mysql_result($ing, 0, $i); if ($i) { echo "<input type = \"text\" name = \"{$field}\" value=\"{$res}\">"; } else { echo "<input type = \"text\" name = \"{$field}\" value=\"{$res}\" readonly=\"readonly\">"; } echo "</td>" . "\n"; echo "</tr>" . "\n"; } echo "</table>" . "\n" . "<br/>"; echo "<input type=\"submit\" name=\"submitbutton\" value=\"Update\">" . "\n"; echo "</form>" . "\n"; } ?> <body background="1.png"> <?php update_menu(intval($_POST["ingredient"])); ?> </body> </html>
$smarty->display('weixin/wx_newsview.html'); } else { sys_msg('记录不存在', 0, $link); } break; case "addconfig": $id = intval($_REQUEST['id']); $token = getstr($_POST['token']); $title = getstr($_POST['title']); $appid = getstr($_POST['appid']); $appsecret = getstr($_POST['appsecret']); if ($id > 1) { $smarty->assign('config', $db->getRow("SELECT * FROM " . $GLOBALS['ecs']->table('weixin_config') . " WHERE id={$id}")); } if ($id > 1 && $_GET['up'] == 1) { update_menu($id); $link[] = array('href' => 'weixin.php?act=addconfig', 'text' => '多帐号管理'); sys_msg('操作成功', 0, $link); } if ($id > 1 && $_GET['up'] == 2) { $db->query("delete from " . $GLOBALS['ecs']->table('weixin_config') . " where `id` = '{$id}'"); $link[] = array('href' => 'weixin.php?act=addconfig', 'text' => '多帐号管理'); sys_msg('操作成功', 0, $link); } if ($_POST) { if ($id > 1) { $ret = $db->query("UPDATE " . $GLOBALS['ecs']->table('weixin_config') . " SET `title`='{$title}',`token`='{$token}',`appid`='{$appid}',`appsecret`='{$appsecret}' WHERE `id`={$id}"); } else { $ret = $db->query("INSERT INTO " . $GLOBALS['ecs']->table('weixin_config') . " (`token`,`appid`,`appsecret`) VALUE ('{$token}','{$appid}','{$appsecret}')"); } $link[] = array('href' => 'weixin.php?act=addconfig', 'text' => '多帐号管理');
$query = "SELECT * from MENU WHERE Menu_Id={$menu_id}"; $menu = mysql_query($query); $num_fields = mysql_num_fields($menu); for ($i = 0; $i < $num_fields; $i++) { echo "<tr>" . "\n"; echo "<td>" . "\n"; $field = mysql_field_name($menu, $i); echo "<b>" . $field . "</b>" . "\n"; echo "</td>" . "\n"; echo "<td>" . "\n"; $res = mysql_result($menu, 0, $i); if ($i) { echo "<input type = \"text\" name = \"{$field}\" value=\"{$res}\">"; } else { echo "<input type = \"text\" name = \"menu_id\" value=\"{$res}\" readonly=\"readonly\">"; } echo "</td>" . "\n"; echo "</tr>" . "\n"; } echo "</table>" . "\n" . "<br/>"; echo "<input type=\"submit\" name=\"submitbutton\" value=\"Update\">" . "\n"; echo "</form>" . "\n"; } ?> <body background="1.png"> <?php update_menu(intval($_POST["menu"])); ?> </body> </html>