project-data-fix #35

Merged
rodude123 merged 2 commits from project-data-fix into master 2023-06-26 18:13:40 +01:00
6 changed files with 12 additions and 10 deletions
Showing only changes of commit 7d0317ed60 - Show all commits

View File

@ -173,7 +173,7 @@ class projectData
// update the database with the new image location
$conn = dbConn();
$stmt = $conn->prepare("UPDATE projects SET imgLocation = :imgLocation WHERE ID = :ID");
$stmt->bindParam(":imgLocation", $targetFile);
$stmt->bindParam(":imgLocation", $targetFile["imgLocation"]);
$stmt->bindParam(":ID", $ID);
$stmt->execute();

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -173,7 +173,7 @@ class projectData
// update the database with the new image location
$conn = dbConn();
$stmt = $conn->prepare("UPDATE projects SET imgLocation = :imgLocation WHERE ID = :ID");
$stmt->bindParam(":imgLocation", $targetFile);
$stmt->bindParam(":imgLocation", $targetFile["imgLocation"]);
$stmt->bindParam(":ID", $ID);
$stmt->execute();

View File

@ -18,9 +18,10 @@
class="fa fa-caret-right"></i></a></li>
<li class="dropdown">
<ul>
<li><a href="#" id="goToAddPost" class="active"><span>&lt;</span>Add Blog Post<span>&gt;</span></a>
<li><a href="#" id="goToAddPost"><span>&lt;</span>Add Blog Post<span>&gt;</span></a>
</li>
<li><a href="#" id="goToEditPost"><span>&lt;</span>Edit Blog Post<span>&gt;</span></a></li>
<li><a href="#" id="goToEditPost" class="active"><span>&lt;</span>Edit Blog
Post<span>&gt;</span></a></li>
</ul>
</li>
<li><a href="#" id="logout"><span>&lt;</span>Logout<span>&gt;</span></a></li>
@ -205,6 +206,8 @@
<input type="submit" value="Add new blog post" class="btn btnPrimary boxShadowIn boxShadowOut">
</form>
</section>
</main>
<script src="js/editor.js"></script>

View File

@ -56,7 +56,7 @@ document.addEventListener('DOMContentLoaded', () =>
{
json.forEach(item =>
{
addProject(item["ID"], (item["isMainProject"] === "1" ? "true" : "false"), (item["imgLocation"] === "") ? "../imgs/placeholder.png" : item["imgLocation"], item["title"], item["information"], item["projectLink"], item["gitLink"]);
addProject(item["ID"], (item["isMainProject"] === 1 ? "true" : "false"), (item["imgLocation"] === "") ? "../imgs/placeholder.png" : item["imgLocation"], item["title"], item["information"], item["projectLink"], item["gitLink"]);
})
return;
}
@ -353,7 +353,6 @@ document.querySelector("#projError .close").addEventListener("click", () =>
document.querySelector("#addPostError .close").addEventListener("click", () =>
document.querySelector("#addPostError").classList.toggle("hidden"));
document.querySelector("#addPostSuccess .close").addEventListener("click", () =>
document.querySelector("#addPostSuccess").classList.toggle("hidden"));
@ -777,7 +776,7 @@ function updateProjectItem(id, e)
{
window.location.href = "./";
return;
}ujh
}
document.querySelector(`#projError${id}`).classList.remove("hidden");
document.querySelector(`#projError${id} div`).innerHTML = updatedProjectImage.error;
@ -856,7 +855,7 @@ function addProject(id , isMainProject, imgLocation, title, information, project
</div>
<div class="formControl isMainProject">
<label class="checkContainer" for="isMainProject${id}">Is It The Main Project
<input type="checkbox" id="isMainProject${id}" name="isMainProject${id}" ${(isMainProject === "true" ? "checked" : "")}>
<input type="checkbox" id="isMainProject${id}" name="isMainProject${id}" ${(isMainProject === "true" ? "checked=''" : "")}>
<span class="checkmark"></span>
</label>
</div>