Exemple #1
0
        } else {
            $sell = "<IMG height=13 src=\"images/cross.png\" width=16 align=absMiddle />";
        }
        echo "<td align=center class=txlrow>" . $sell . "</td>";
        echo "<td align=center class=txlrow>" . $row['dinname'] . "</td>";
        ?>

<td align=center class=txlrow>
<?php 
        if ($row['dinimage']) {
            echo "<img src='" . $row[dinimage] . "' width='80px' hight='60px'/>";
        } else {
            echo "&nbsp";
        }
        ?>
</td>
<?php 
        echo "<td align=center class=txlrow>" . get_dintypename($db, $row['shopid'], $row['dintype']) . "</td>";
        echo "<td align=center class=txlrow>" . $row['dinprice'] . "</td>";
        echo "<td align=center class=txlrow>" . "<a href=delete.php?dinid=" . $row['dinid'] . ">ɾ³ý</a></td>";
        echo "<td align=center class=txlrow>" . "<a href=adddin.php?dinid=" . $row['dinid'] . ">±à¼­</a></td>";
        echo "</tr>";
    }
} else {
}
?>
</tbody>
</table>
</body>
</html>
    $cart = new jcart();
}
$email = !empty($_SESSION['email']) ? $_SESSION['email'] : 0;
if ($cart->get_contents()) {
    extract($_POST);
    $orderdate = date("Y-m-d H:i:s");
    foreach ($cart->get_contents() as $item) {
        $total_price[$item['shop']] += $item['price'] * $item['qty'];
    }
    foreach ($cart->get_contents() as $item) {
        $item_id = $item['id'];
        $detail = get_din_details($db, $item_id);
        $item_name = $item['name'];
        $item_price = $item['price'];
        $item_qty = $item['qty'];
        $shopid = $item['shop'];
        $type = get_dintypename($db, $shopid, $detail['dintype']);
        if ($shopid != $shop) {
            $orderid = "3" . $shopid . get_orders($db, $shopid);
            $query = "insert into wm_orders values('{$orderid}{$shopid}','{$email}','{$shopid}','','','','','','','{$orderdate}','','2','{$total_price[$shopid]}','')";
            $db->query($query);
        }
        $sqlquery = "insert into wm_order_items values('{$orderid}{$shopid}','{$item_id}','" . $shopid . "','" . $item['name'] . "','" . $type . "',{$item_qty} ,'" . $item_price * $item_qty . "','" . $item_price . "' , '" . $orderdate . "','')";
        if (!$db->query($sqlquery)) {
            echo "数据操作失误,请联系管理员!电话:15251435057";
            exit;
        }
        $shop = $shopid;
    }
    $cart->empty_cart();
}
Exemple #3
0
$typeid = empty($_GET['typeid']) ? $_POST['typeid'] : $_GET['typeid'];
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    if ($_POST['tname']) {
        $query = "update wm_dincategory set dintype='{$_POST['tname']}' where id='{$typeid}'";
        $result = $db->query($query);
        if ($result) {
            echo "<font color='#FF0000'>修改成功</font> 1秒钟后自动返回<meta http-equiv='refresh' content=\"1; URL='addCategory.php'\" />";
        } else {
            echo "修改失败";
        }
    } else {
        echo "<font color='#FF0000'>信息填写不完整请重新再试,谢谢!</font>";
    }
}
$shopid = get_admin($db, $sid);
$typename = get_dintypename($db, $sid, $typeid);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<link rel="stylesheet" href="./css/main.css" type="text/css" />
<title>无标题文档</title>
</head>
<body>
  <form action="edittype.php" method="post" >
  <table  width="100%" border=0 align=center cellpadding=2 cellspacing=1 bordercolor="#799AE1" class=tableBorder>
    <tbody>
      <tr>
        <th align=center colspan=6 style="height: 23px">餐品类别修改</th>
      </tr>