forked from Nobody9810/React-Event
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEvent.js
181 lines (143 loc) · 4.74 KB
/
Event.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
//befor start this file, pls add antd first from ur terminal
// add npm antd or
import React, { Component, Fragment,} from 'react';
import 'antd/dist/antd.css';
import { UserOutlined } from '@ant-design/icons';
import { Input,Button,Select,DatePicker,PageHeader, Descriptions } from 'antd';
import './css.css'
class Event extends Component{
constructor(props){
super(props);
this.state = {
NameValue:'',
AddressValue:'',
PhoneValue:'',
EmailValue:'',
EventVenue:'',
Date:'',
}
}
render(){
return(
<Fragment>
<h1 className ='head'> Welecome To IIUM Event System </h1>
<div>
<div className='mian' id='id'>
<h2>Event Information</h2>
<Input
className='NameInput'
placeholder='Name'
prefix={<UserOutlined/>}
value={this.state.NameValue}
onChange={this.handleInputChange.bind(this)}/>
<p>
<Input
className='AddressInput'
placeholder='Address'
value={this.state.AddressValue}
onChange={this.handleAddressChange.bind(this)}/>
</p>
<p>
<Input
className='PhoneInput'
placeholder='Phone'
onChange={this.handlePhoneChange.bind(this)}/>
</p>
<p>
<Input
className='EmailInput'
placeholder='Email'
value={this.state.EmailValue}
onChange={this.handleEmailChange.bind(this)}/>
</p>
<p>
<Select
defaultValue= 'EventVenue'
onChange={this.handleSelectChange.bind(this)}>
<Select.Option value="EventVenue">EventVenue</Select.Option>
<Select.Option value="KICT MAIN HALL">KICT MAIN HALL</Select.Option>
<Select.Option value="ECONS MAIN HALL">ECONS MAIN HALL</Select.Option>
<Select.Option value="LAW MAIN COURT">LAW MAIN COURT</Select.Option>
<Select.Option value="CAS">CAS</Select.Option>
</Select>
</p>
<DatePicker style={{ width: 100 }}
value={this.state.Date}
onChange={this.handleDateChange.bind(this)} />
<Button
type="primary"
onClick={this.handleBtnClick.bind(this)}>Submit</Button>
</div>
</div>
<div className="Detail" id='id'>
<PageHeader
ghost={false}
title="Event"
subTitle="This Is Your Event Details">
<Descriptions size="small" column={3}>
<Descriptions.Item>Name: {this.state.outputName}</Descriptions.Item>
<Descriptions.Item >Address: {this.state.outputAddress}</Descriptions.Item>
<Descriptions.Item >Phone: {this.state.outputPhone}</Descriptions.Item>
<Descriptions.Item >Email: {this.state.outputEmail}</Descriptions.Item>
<Descriptions.Item >EventVenue: {this.state.outputEventVenue}</Descriptions.Item>
<Descriptions.Item >Date:{this.state.outputDate}</Descriptions.Item>
</Descriptions>
<Button key="1" type="primary"
onClick={this.handleconfirmclick.bind(this)}>Confirm</Button>
</PageHeader>
</div>
</Fragment>
)}
handleInputChange(e) {
this.setState({
NameValue:e.target.value,
});
}
handleAddressChange(e){
this.setState({
AddressValue:e.target.value,
})
}
handlePhoneChange(e){
this.setState({
PhoneValue:e.target.value,
})
}
handleEmailChange(e){
this.setState({
EmailValue:e.target.value
});
}
handleSelectChange(m){
this.setState({
EventVenue:m
})
}
handleDateChange (n){
console.log(n)
this.setState({
Date:n
})
}
handleBtnClick() {
this.setState ({
outputName : this.state.NameValue.toUpperCase(),
outputAddress: this.state.AddressValue.toUpperCase(),
outputPhone:this.state.PhoneValue,
outputEmail:this.state.EmailValue,
formValue:this.state.listData,
outputEventVenue:this.state.EventVenue,
outputDate: this.state.Date.toString(),
NameValue:'',
AddressValue:'',
PhoneValue:'',
EmailValue:'',
Date:''
});
}
handleconfirmclick(){
this.setState({
})
}
}
export default Event;