<?php

if (!function_exists('dr_mform_status_name')) {
    function dr_mform_status_name($value, $param = [], $data = [], $field = []) {
        if ($value == 0) {
            //待审核
            return '<span class="label label-success"> '.dr_lang('待审核').' </span>';
        } elseif ($value == 1) {
            //已通过
            return '<span class="label label-success"> '.dr_lang('已通过').' </span>';
        } else {
            //未通过
            return '<span class="label label-danger"> '.dr_lang('未通过').' </span>';
        }
    }
}

if (!function_exists('dr_mform_ctable')) {
    function dr_mform_ctable($mid, $tid, $cid, $siteid = SITE_ID) {

        return ($siteid ? $siteid.'_' : '').$mid.'_form_'.$tid;

        if ($cid && $tid && $mid) {
            $tableid = substr($cid, -1, 1);
            return ($siteid ? $siteid.'_' : '').$mid.'_form_'.$tid.'_'.($tableid ? $tableid : 0);
        }

        return ($siteid ? $siteid.'_' : '').$mid.'_form_'.$tid;
    }
}