Example #1
0
 public function view_onSampleCoefficient()
 {
     if (!isset($_SESSION['userId'])) {
         //检测用户是否登陆
         header('location:index.php?mod=login&act=index');
         exit;
     }
     $sampleCoefficientAct = new SampleCoefficientAct();
     $sampleTypeOnId = isset($_GET['sampleTypeOnId']) ? post_check($_GET['sampleTypeOnId']) : '';
     $cNameOn = isset($_GET['cNameOn']) ? post_check($_GET['cNameOn']) : '';
     if (empty($sampleTypeOnId) || empty($cNameOn)) {
         //为空时,跳转到列表页面,输出错误信息
         $status = '启动失败,id为空';
         header("location:index.php?mod=sampleCoefficient&act=getSampleCoefficientList&status={$status}");
         exit;
     }
     $return = $sampleCoefficientAct->act_onSampleCoefficient($cNameOn, $sampleTypeOnId);
     //启动该系数
     if ($return) {
         $flag = DetectStandardModel::updateSampleStandard();
         if ($flag) {
             $status = '启动成功,检测标准已自动更新';
         } else {
             $status = '启动成功,自动更新失败';
         }
     } else {
         $status = '找不到指定记录或已经启动';
     }
     header("location:index.php?mod=sampleCoefficient&act=getSampleCoefficientList&status={$status}");
 }
Example #2
0
 function act_getnowStandard()
 {
     $update = DetectStandardModel::updateSampleStandard();
     if ($update) {
         return true;
     } else {
         self::$errCode = "003";
         self::$errMsg = "";
         return false;
     }
 }