<?php
	require_once "pageBase.php";
	require_once "../../bin/system/conver.php";
	require_once "../../dal/photoDAL.php";
	class _photo extends pageBase {
		private $dal;

		public function __construct() {
			$this->dal = new photoDAL();
		}

		public function load(): void {
			$this->aryJ["msg"] = "";

			$action = parent::getPost("do");
			switch ($action) {
				case "del":
					$this->delete();
					break;
				default:
					break;
			}
			parent::load();
		}
		
		private function delete() {
			$id = parent::getPost("id");
			echo ($this->dal->deleteRecord($id)) ? "1" : "-1";
		}
	}

	$page = new _photo();
	$page->load();
?>