<?php

class common_ajax extends mainController {

    public function __construct() {
        parent::__construct();
    }

    public function landing() {
        
    }

    public function ViewByEntryId() {
        $data = CommonFunctions::CommonView($_GET['table'], [$_GET['entry_id']], [$_GET['entry_value']]);
        die(json_encode($data));
    }
    public function commonDelete() {
        $submit = CommonFunctions::commonDelete($_GET['table'], [$_GET['entry_id']], [$_GET['entry_value']]);
       die($submit ? "ok" : "error");
    }

    public function CommonUpdateRecord() {
        $submit = CommonFunctions::UpdateRecordStatus($_GET['table'], $_GET['entry_id'], $_GET['entry_value'], $_GET['attr_id'], $_GET['attr_value']);
        die(empty($submit) ? "ok" : "error");
    }

}
