CREATE TABLE kfh_detail_1 (
  id int(11) AUTO_INCREMENT,
  client_open tinyint(1),
  interviewer_no varchar(10),
  approved tinyint(1),
  approved_date datetime,
  date_Insert datetime,
  serial_no varchar(10),
  day int(2),
  month int(2),
  year int(4),
  date date,
  wday tinyint(1),
  quarter int(11),
  tofv_hr int(2),
  tofv_min int(2),
  tofv datetime,
  branch_id int,
  agent_id int,
  shopper_id int,
  transation_id int,
  service_location int,
  no_waiting_cus int,
  no_recp_agnts int,
  rec_starttime_hr int(2),
  rec_starttime_min int(2),
  rec_start_time datetime,
  rec_endtime_hr int(2),
  rec_endtime_min int(2),
  rec_end_time datetime,
  rec_vduration_min int(4),
  bvar_1 tinyint(1),
  bvar_2 tinyint(1),
  bvar_3 tinyint(1),
  bvar_4 tinyint(1),
  bvar_5 tinyint(1),
  bvar_6 tinyint(1),
  bvar_7 tinyint(1),
  bvar_8 tinyint(1),
  bvar_9 tinyint(1),
  bvar_10 tinyint(1),
  bvar_11 tinyint(1),
  bvar_12 tinyint(1),
  bvar_13 tinyint(1),
  bvar_14 tinyint(1),
  bvar_15 tinyint(1),
  bvar_16 tinyint(1),
  bvar_17 tinyint(1),
  bvar_18 tinyint(1),
  bvar_19 tinyint(1),
  bvar_20 tinyint(1),
  bvar_21 tinyint(1),
  bvar_22 tinyint(1),
  bvar_23 tinyint(1),
  bvar_com_1 text CHARACTER SET utf8 COLLATE utf8_bin,
  bvar_com_2 text CHARACTER SET utf8 COLLATE utf8_bin,
  bvar_com_3 text CHARACTER SET utf8 COLLATE utf8_bin,
  bvar_com_4 text CHARACTER SET utf8 COLLATE utf8_bin,
  bvar_com_5 text CHARACTER SET utf8 COLLATE utf8_bin,
  bvar_com_6 text CHARACTER SET utf8 COLLATE utf8_bin,
  bvar_com_7 text CHARACTER SET utf8 COLLATE utf8_bin,
  bvar_com_8 text CHARACTER SET utf8 COLLATE utf8_bin,
  bvar_com_9 text CHARACTER SET utf8 COLLATE utf8_bin,
  bvar_com_10 text CHARACTER SET utf8 COLLATE utf8_bin,
  bvar_com_11 text CHARACTER SET utf8 COLLATE utf8_bin,
  bvar_com_12 text CHARACTER SET utf8 COLLATE utf8_bin,
  bvar_com_13 text CHARACTER SET utf8 COLLATE utf8_bin,
  bvar_com_14 text CHARACTER SET utf8 COLLATE utf8_bin,
  bvar_com_15 text CHARACTER SET utf8 COLLATE utf8_bin,
  bvar_com_16 text CHARACTER SET utf8 COLLATE utf8_bin,
  bvar_com_17 text CHARACTER SET utf8 COLLATE utf8_bin,
  bvar_com_18 text CHARACTER SET utf8 COLLATE utf8_bin,
  bvar_com_19 text CHARACTER SET utf8 COLLATE utf8_bin,
  bvar_com_21 text CHARACTER SET utf8 COLLATE utf8_bin,
  bvar_com_22 text CHARACTER SET utf8 COLLATE utf8_bin,
  bvar_com_23 text CHARACTER SET utf8 COLLATE utf8_bin,
  score_a_point int(11),
  score_a_allot int(11),
  score_b_point int(11),
  score_b_allot int(11),
  score_c_point int(11),
  score_c_allot int(11),
  score_d_point int(11),
  score_d_allot int(11),
  total_point int(11),
  total_allot int(11),
  comment1 text  CHARACTER SET utf8 COLLATE utf8_bin,
  PRIMARY KEY (id),
  UNIQUE KEY uniq (shopper_id,quarter,serial_no)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;


CREATE TABLE IF NOT EXISTS `kfh_branches` (
  id int(11) NOT NULL,
  br_name_ar varchar(100)  CHARACTER SET utf8 COLLATE utf8_bin,
  br_name_en varchar(100),
  br_section varchar(10),
  br_area varchar(30),
  total_visit int,
  cso int,
  teller int
) ENGINE=MyISAM;

CREATE TABLE IF NOT EXISTS `kfh_agents` (
  id int(11) NOT NULL,
  agent_name_ar varchar(100)  CHARACTER SET utf8 COLLATE utf8_bin,
  agent_name_en varchar(100)
) ENGINE=MyISAM;

CREATE TABLE IF NOT EXISTS `kfh_trans` (
  id int(11) NOT NULL,
  trans_name_ar varchar(100)  CHARACTER SET utf8 COLLATE utf8_bin,
  trans_name_en varchar(100),
  job_title varchar(100),
  location varchar(100)
) ENGINE=MyISAM;

CREATE TABLE IF NOT EXISTS `kfh_location` (
  id int(11) NOT NULL,
  loc_name_ar varchar(100)  CHARACTER SET utf8 COLLATE utf8_bin,
  loc_name_en varchar(100)
) ENGINE=MyISAM;
