Example #1
0
mysqli_stmt_store_result($statement);
mysqli_stmt_bind_result($statement, $clue_id);
while (mysqli_stmt_fetch($statement)) {
    $clue["clueId"] = $clue_id;
}
$path = "/image/clue/" . $clue_id . ".jpg";
file_put_contents(getcwd() . $path, $decodeImage);
$_POST["imageString"] = $path;
$query = "INSERT INTO clue_image(clueId, path) VALUES (?, ?)";
$statement = mysqli_prepare($con, $query);
mysqli_stmt_bind_param($statement, "ss", $clue_id, $path);
$success = mysqli_stmt_execute($statement);
if (!$success) {
    echo json_encode($clue);
    exit;
} else {
    $clue["resultStoreClueImage"] = 1;
}
//echo json_encode($clue);
mysqli_stmt_close($statement);
mysqli_close($con);
echo json_encode($clue);
$clue["logging"] = logging("Store_Clue_Data", json_encode($_POST));
if ($notice_id != -1) {
    createDatabaseImageOnly("clue", $clue_id);
    pushNotifiactionForDirectClueAdd($clue_id, $notice_id);
} else {
    $extFile = createExtFile("notice");
    callExeOfImageFindNotice("clue", $clue_id, $extFile);
    //sendToImgPart();
}
Example #2
0
    $notice["resultStoreNoticeData"] = 1;
}
$query = "SELECT id FROM notice_detail WHERE name = ? AND lostDate = ? AND adder = ?";
$statement = mysqli_prepare($con, $query);
mysqli_stmt_bind_param($statement, "sss", $name, $lostDate, $username);
$success = mysqli_stmt_execute($statement);
mysqli_stmt_store_result($statement);
mysqli_stmt_bind_result($statement, $id);
while (mysqli_stmt_fetch($statement)) {
    $notice["id"] = $id;
}
$path = "/image/notice/" . $id . ".jpg";
file_put_contents(getcwd() . $path, $decodeImage);
$query = "INSERT INTO notice_image(noticeId, path) VALUES (?, ?)";
$statement = mysqli_prepare($con, $query);
mysqli_stmt_bind_param($statement, "ss", $id, $path);
$success = mysqli_stmt_execute($statement);
if (!$success) {
    echo json_encode($notice);
    exit;
} else {
    $notice["resultStoreNoticeImage"] = 1;
}
$_POST["imageString"] = $path;
echo json_encode($notice);
mysqli_stmt_close($statement);
mysqli_close($con);
logging("Store_Notice_Data", json_encode($_POST));
//createDatabaseImageFile("notice",$id);
$extFileName = createExtFile("clue");
callExeOfImageFindClue("notice", $id, $extFileName);