<?php

namespace user;

class depmain
{
    public function reg($name,$duid,$upid='0'){
        global $medoo;
        return $medoo->insert("dep_info",[
           "name" =>$name,
            "orders"=>$duid,
            "upn"=>$upid
        ]);
    }

    public function del($did){
        global $medoo;
        return $medoo->delete("dep_info",[
            "did"=>$did
        ]);
    }

    public function cha($did){
        global $medoo;
        return $medoo->get("dep_info","*",[
            "did"=>$did
        ]);
    }

    public function update($did,$name){
        global $medoo;
        return $medoo->update("dep_info",[
            "name"=>$name
        ],[
            "did"=>$did
        ]);
    }
    public function hello(){
        return "hello";
    }
}