Example #1
0
$period = $_POST["period"];
$longitude = $_POST["longitude"];
$latitude = $_POST["latitude"];
$expressType = "";
$itemIntroduction = "";
$itemImageSrc = "";
$address = "";
if (isset($_POST["address"])) {
    $address = $_POST["address"];
}
if (isset($_POST["expressType"])) {
    $expressType = $_POST["expressType"];
}
if (isset($_POST["itemIntroduction"])) {
    $itemIntroduction = $_POST["itemIntroduction"];
}
if (isset($_POST["itemImageSrc"])) {
    $itemImageSrc = $_POST["itemImageSrc"];
}
$arr = array("longitude" => $longitude, "latitude" => $latitude, "itemName" => $itemName, "money" => $money, "period" => $period, "expressType" => $expressType, "itemIntroduction" => $itemIntroduction, "itemImageSrc" => $itemImageSrc, "uid" => $uid, "address" => $address);
$item = new Item($data = $arr);
$iteId = $item->publish($uid, $hash);
if (!$iteId) {
    add_return_data(0, 7, "Error while updating.");
}
$returndata["data"] = array("itemId" => $iteId);
$iteImg = uploadPic("itemPic", $iteId, "itemImageSrc");
if ($item->updateItemImage($uid, $hash, $iteId, $iteImg)) {
    add_return_data(1, 1, "Success");
}
add_return_data(1, 2, "Success uploding data except Image");