   `d_create` datetime DEFAULT NULL,
   `d_update` datetime DEFAULT NULL,
   PRIMARY KEY (`id`),
-  KEY `plan` (`plan_id`),
-  CONSTRAINT `plan` FOREIGN KEY (`plan_id`) REFERENCES `plan` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION
-) ENGINE=InnoDB AUTO_INCREMENT=45 DEFAULT CHARSET=utf8;
+  KEY `plan` (`plan_id`)
+) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8;
 
 -- ----------------------------
 -- Records of plan_week
 -- ----------------------------
-INSERT INTO `plan_week` VALUES ('7', '1', '2', 'ตรวจสอบสายยางอาหาร', '2017-01-05', '08:30:00', null, null, null, null, null, null, '', '2017-01-02', '19:54:09', '', '', null, '', '', '', '', '', '', '', '1', null, '2017-01-05 14:44:20');
-INSERT INTO `plan_week` VALUES ('8', '1', '2', 'ตรวจร่างกายทั่วไป', '2017-01-06', '12:00:00', null, null, '', '', '', '', '', '2017-01-03', '08:04:38', '', '', null, '', '', '', '', '', '', '', null, null, '2017-01-03 13:50:54');
-INSERT INTO `plan_week` VALUES ('18', '2', '2', 'เยี่ยมโดย CG', '2016-12-28', '14:49:00', null, null, null, null, null, null, '', '2017-01-02', '19:51:21', '', '', null, '', '', '', '', '', '', '', '1', '2017-01-02 14:45:24', '2017-01-03 09:47:30');
-INSERT INTO `plan_week` VALUES ('19', '2', '4', 'ให้อาหารทางสายยาง', '2017-01-04', '16:03:00', null, null, null, null, null, null, '', null, null, '', '', null, '', '', '', '', '', '', '', null, '2017-01-02 16:04:01', '2017-01-06 10:08:39');
-INSERT INTO `plan_week` VALUES ('20', null, '4', 'อาบน้ำ', '2017-01-04', '19:35:00', null, null, null, null, null, null, '', null, null, '', '', null, '', '', '', '', '', '', '', null, '2017-01-02 19:35:39', '2017-01-02 20:56:28');
-INSERT INTO `plan_week` VALUES ('23', null, '4', 'ดูแลโดย CG', '2017-01-09', '10:00:00', null, null, null, null, null, null, '', '2017-01-02', '20:26:06', '', '', null, '', '', '', '', '', '', '', null, '2017-01-02 20:25:54', '2017-01-02 23:57:13');
-INSERT INTO `plan_week` VALUES ('24', null, '2', 'ดูเสมหะ/ให้อาหาร และยาทางสายยาง', '2017-01-03', '21:23:00', null, null, null, null, null, null, '', '2017-01-02', '21:23:53', '', '', null, '', '', '', '', '', '', '', '1', '2017-01-02 21:23:32', '2017-01-03 10:31:37');
-INSERT INTO `plan_week` VALUES ('25', null, '2', 'ทีมหมอครอบครัวลงเยี่ยมดูแลรักษา', '2017-01-11', '08:30:00', null, null, null, null, null, null, '', '2017-01-02', '21:24:41', '', '', null, '', '', '', '', '', '', '', null, '2017-01-02 21:24:29', '2017-01-03 09:44:33');
-INSERT INTO `plan_week` VALUES ('26', null, '2', 'ทีมแพทย์ลงเยี่ยม', '2017-01-13', '21:52:00', null, null, null, null, null, null, '', '2017-01-03', '09:42:57', '', '', null, '', '', '', '', '', '', '', null, '2017-01-02 21:53:00', '2017-01-03 09:42:57');
-INSERT INTO `plan_week` VALUES ('27', null, '2', 'ดูแลโดย CG', '2017-01-02', '08:20:00', null, null, null, null, null, null, '', '2017-01-03', '09:58:34', '', '', null, '', '', '', '', '', '', '', '1', '2017-01-02 21:58:48', '2017-01-03 09:58:34');
-INSERT INTO `plan_week` VALUES ('28', null, '2', 'อื่นๆ.................', '2016-12-28', '22:58:00', null, null, null, null, null, null, '', '2017-01-03', '10:19:26', '', '', null, '', '', '', '', '', '', '', '1', '2017-01-02 22:58:29', '2017-01-06 10:03:22');
-INSERT INTO `plan_week` VALUES ('29', null, '2', 'ดูแลโดย CG', '2017-01-12', '07:27:00', null, null, null, null, null, null, '', '2017-01-03', '09:22:26', '', '', null, '', '', '', '', '', '', '', null, '2017-01-03 07:27:22', '2017-01-03 09:22:26');
-INSERT INTO `plan_week` VALUES ('31', null, '2', 'ให้การดูแลโดย CG', '2017-01-07', '09:00:00', null, null, null, null, null, null, '5', null, null, null, null, null, null, null, null, null, null, null, null, null, '2017-01-03 12:09:29', null);
-INSERT INTO `plan_week` VALUES ('32', null, '2', 'ดูแลครั้งที่ 1', '2017-01-04', '08:00:00', null, null, null, null, null, null, '', '2017-01-03', '20:30:20', '', '', '10.23', '', '', '', '', '', '', '', '1', '2017-01-03 13:59:01', '2017-01-05 14:44:12');
-INSERT INTO `plan_week` VALUES ('34', null, '2', 'ดูแลโดย cg', '2017-01-07', '08:00:00', null, null, null, null, null, null, '', null, null, null, null, null, null, null, null, null, null, null, null, null, '2017-01-03 21:08:48', null);
-INSERT INTO `plan_week` VALUES ('35', null, '2', 'ดูแลโดย cg', '2017-01-07', '10:00:00', null, null, null, null, null, null, '', null, null, null, null, null, null, null, null, null, null, null, null, null, '2017-01-03 21:09:37', null);
-INSERT INTO `plan_week` VALUES ('36', null, '2', 'cg', '2017-01-08', '08:00:00', null, null, null, null, null, null, '', null, null, null, null, null, null, null, null, null, null, null, null, null, '2017-01-03 21:13:31', null);
-INSERT INTO `plan_week` VALUES ('37', null, '7', 'อาบน้ำเช็ดตัว', '2017-01-06', '06:00:00', null, null, null, null, null, null, '', null, null, null, null, null, null, null, null, null, null, null, null, null, '2017-01-05 10:05:40', null);
-INSERT INTO `plan_week` VALUES ('41', null, '4', '33333', '2017-01-02', '08:00:00', null, null, null, null, null, null, '', null, null, null, null, null, null, null, null, null, null, null, null, null, '2017-01-06 10:19:03', null);
-INSERT INTO `plan_week` VALUES ('42', null, '6', 'ดูแลโดย CG', '2017-01-07', '09:00:00', null, null, null, null, null, null, '', '2017-01-06', '10:33:27', '', '', null, '', '', '', '', '', '', 'ใจดี ยิ้มหัวเรอะ', null, '2017-01-06 10:31:42', '2017-01-06 10:33:27');
-INSERT INTO `plan_week` VALUES ('43', null, '6', 'เยี่ยมโดย FCT', '2017-01-08', '09:00:00', null, null, null, null, null, null, '', null, null, '', '', null, '', '', '', '', '', '', '', null, '2017-01-06 10:31:57', '2017-01-06 10:32:14');
-INSERT INTO `plan_week` VALUES ('44', null, '6', 'ดูแลโดย CG', '2017-01-06', '08:00:00', null, null, null, null, null, null, '', '2017-01-06', '10:34:54', '', '', null, '', '', '', '', '', '', 'ยิ้ม หัวเรอะ', '1', '2017-01-06 10:34:11', '2017-01-06 10:34:54');
+INSERT INTO `plan_week` VALUES ('1', null, '2', 'ดูแลโดยCG', '2017-01-02', '07:00:00', null, '08:00:00', null, null, null, null, '13', null, null, null, null, null, null, null, null, null, null, null, null, null, '2017-01-07 16:57:26', null);
+INSERT INTO `plan_week` VALUES ('2', null, '2', 'ดูแลโดยCG', '2017-01-03', '07:00:00', null, null, null, null, null, null, '13', null, null, null, null, null, null, null, null, null, null, null, null, null, '2017-01-07 16:57:26', null);
+INSERT INTO `plan_week` VALUES ('3', null, '2', 'ดูแลโดยCG', '2017-01-04', '07:00:00', null, null, null, null, null, null, '13', null, null, null, null, null, null, null, null, null, null, null, null, null, '2017-01-07 16:57:26', null);
+INSERT INTO `plan_week` VALUES ('4', null, '2', 'ดูแลโดยCG', '2017-01-05', '07:00:00', null, null, null, null, null, null, '13', null, null, null, null, null, null, null, null, null, null, null, null, null, '2017-01-07 16:57:26', null);
+INSERT INTO `plan_week` VALUES ('5', null, '2', 'ดูแลโดยCG', '2017-01-06', '07:00:00', null, null, null, null, null, null, '13', null, null, null, null, null, null, null, null, null, null, null, null, null, '2017-01-07 16:57:26', null);
+INSERT INTO `plan_week` VALUES ('6', null, '2', 'ดูแลโดยCG', '2017-01-07', '07:00:00', null, null, null, null, null, null, '13', null, null, null, null, null, null, null, null, null, null, null, null, null, '2017-01-07 16:57:26', null);
+INSERT INTO `plan_week` VALUES ('7', null, '2', 'ดูแลโดยCG', '2017-01-08', '07:00:00', null, null, null, null, null, null, '13', null, null, null, null, null, null, null, null, null, null, null, null, null, '2017-01-07 16:57:26', null);
+INSERT INTO `plan_week` VALUES ('8', null, '2', 'ดูแลโดยCG', '2017-01-02', '08:00:00', null, '09:00:00', null, null, null, null, '13', null, null, null, null, null, null, null, null, null, null, null, null, null, '2017-01-07 16:59:19', null);
+INSERT INTO `plan_week` VALUES ('9', null, '2', 'ดูแลโดยCG', '2017-01-03', '08:00:00', null, '09:00:00', null, null, null, null, '13', null, null, null, null, null, null, null, null, null, null, null, null, null, '2017-01-07 16:59:19', null);
+INSERT INTO `plan_week` VALUES ('10', null, '2', 'ดูแลโดยCG', '2017-01-04', '08:00:00', null, '09:00:00', null, null, null, null, '13', null, null, null, null, null, null, null, null, null, null, null, null, null, '2017-01-07 16:59:19', null);
+INSERT INTO `plan_week` VALUES ('11', null, '2', 'ดูแลโดยCG', '2017-01-05', '08:00:00', null, '09:00:00', null, null, null, null, '13', null, null, null, null, null, null, null, null, null, null, null, null, null, '2017-01-07 16:59:19', null);
+INSERT INTO `plan_week` VALUES ('12', null, '2', 'ดูแลโดยCG', '2017-01-06', '08:00:00', null, '09:00:00', null, null, null, null, '13', null, null, null, null, null, null, null, null, null, null, null, null, null, '2017-01-07 16:59:19', null);
+INSERT INTO `plan_week` VALUES ('13', null, '2', 'ดูแลโดยCG', '2017-01-07', '08:00:00', null, '09:00:00', null, null, null, null, '13', null, null, null, null, null, null, null, null, null, null, null, null, null, '2017-01-07 16:59:19', null);
+INSERT INTO `plan_week` VALUES ('14', null, '2', 'ดูแลโดยCG', '2017-01-08', '08:00:00', null, '09:00:00', null, null, null, null, '13', null, null, null, null, null, null, null, null, null, null, null, null, null, '2017-01-07 16:59:19', null);
+
+-- ----------------------------
+-- Table structure for profile
+-- ----------------------------
+DROP TABLE IF EXISTS `profile`;
+CREATE TABLE `profile` (
+  `patient_id` int(11) NOT NULL,
+  `cm_id` int(11) DEFAULT NULL,
+  `cg_id` int(11) DEFAULT NULL,
+  `cc` text,
+  `pi` text,
+  `fh` text,
+  `ph` text,
+  `mh` text,
+  `nu` text,
+  `he` text,
+  `sh` text,
+  `pe` text,
+  `mse` text,
+  `pl` text,
+  `pm` text,
+  `co` text,
+  `d_update` datetime DEFAULT NULL,
+  PRIMARY KEY (`patient_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- ----------------------------
+-- Records of profile
+-- ----------------------------
 
 -- ----------------------------
 -- Table structure for user

  `careful` text COMMENT 'ข้อควรระวังในการให้บริการ',
  `d_update` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of plan
-- ----------------------------
INSERT INTO `plan` VALUES ('1', null, '2', '2017-01-05', 'blue', null, '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', null);
INSERT INTO `plan` VALUES ('2', null, '2', '2017-01-06', 'red', null, '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', null);
INSERT INTO `plan` VALUES ('3', null, '4', '2017-01-05', 'blue', null, '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', null);
INSERT INTO `plan` VALUES ('4', null, '6', '2017-01-06', 'red', null, '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', null);

-- ----------------------------
-- Table structure for plan_week

  `login_date` datetime DEFAULT NULL,
  `ip` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=53 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of user_log
