Пример #1
0
 function act_sureAdd()
 {
     $data = array();
     $property_arr = array();
     $id = post_check(trim($_POST['standardId']));
     $is_open = post_check(trim($_POST['isopen']));
     $data['sampleTypeId'] = post_check(trim($_POST['typeId']));
     $data['sName'] = post_check(trim($_POST['sName']));
     $data['minimumLimit'] = post_check(trim($_POST['minimumLimit']));
     $data['maximumLimit'] = post_check(trim($_POST['maximumLimit']));
     $data['sizeCodeId'] = post_check(trim($_POST['codeId']));
     $data['userId'] = $_SESSION['sysUserId'];
     $data['createdTime'] = time();
     if (empty($id)) {
         $data['is_open'] = 0;
         $insertid = SampleStandardModel::insertRow($data);
         if ($insertid) {
             return true;
         } else {
             return false;
         }
     } else {
         $updatedata = SampleStandardModel::update($data, "and id='{$id}'");
         if ($updatedata) {
             return true;
         } else {
             return false;
         }
     }
 }