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
|
<?php
// $Id$
/*
Approval Status :
0 - Pending
1 - Approved
2 - Dis-Approved
3 - Solved
Solution Status :
0 - Pending
1 - Approved
2 - Dis-Approved
Solution Display :
0 - No
1 - Yes
Tables :
lab_migration_solution : approval_status
0 - Pending
1 - Approved
2 - Disapproved (delete it)
*/
/* workshop booking registration form */
function osdag_workshop_booking_form($form, &$form_state)
{
global $user;
/************************ start approve book details ************************/
$query = db_select('osdag_workshop_booking');
$query->fields('osdag_workshop_booking');
$query->condition('uid', $user->uid);
$query->orderBy('id', 'DESC');
$query->range(0, 1);
$proposal_q = $query->execute();
$proposal_data = $proposal_q->fetchObject();
if ($proposal_data)
{
if ($proposal_data->approval_status == 0 || $proposal_data->approval_status == 1)
{
drupal_set_message(t('We have already received your proposal.'), 'status');
drupal_goto('');
return;
} //$proposal_data->approval_status == 0 || $proposal_data->approval_status == 1
} //$proposal_data
$form['#attributes'] = array(
'enctype' => "multipart/form-data"
);
$form['name_title'] = array(
'#type' => 'select',
'#title' => t('Title'),
'#options' => array(
'Dr' => 'Dr.',
'Prof' => 'Prof.',
'Shri' => 'Shri',
'Smt' => 'Smt',
'Ku.' => 'Ku.',
'Mr.' => 'Mr.',
'Mrs.' => 'Mrs.',
'Ms.' => 'Ms.',
),
'#required' => TRUE
);
$form['fname'] = array(
'#type' => 'textfield',
'#title' => t('First Name'),
'#size' => 30,
'#maxlength' => 50,
'#required' => TRUE
);
$form['lname'] = array(
'#type' => 'textfield',
'#title' => t('last Name'),
'#size' => 30,
'#maxlength' => 50,
'#required' => TRUE
);
$form['designation'] = array(
'#type' => 'textfield',
'#title' => t('Designation'),
'#size' => 30,
'#maxlength' => 50,
'#required' => TRUE
);
$form['institute_company'] = array(
'#type' => 'textfield',
'#title' => t('Name of the Institute/Company'),
'#size' => 30,
'#maxlength' => 50,
'#required' => TRUE
);
$form['email_id'] = array(
'#type' => 'textfield',
'#title' => t('Email'),
'#size' => 30,
'#value' => $user->mail,
'#disabled' => TRUE
);
$form['alt_email_id'] = array(
'#type' => 'textfield',
'#title' => t('Organization Email'),
'#size' => 30,
'#value' => $user->mail,
'#disabled' => False
);
$form['contact_ph'] = array(
'#type' => 'textfield',
'#title' => t('Contact No.'),
'#size' => 30,
'#maxlength' => 15,
'#required' => TRUE
);
$form['department'] = array(
'#type' => 'select',
'#title' => t('Department/Branch'),
//'#options' => _lm_list_of_departments(),
'#options' => array(""=>""),
'#required' => TRUE
);
$form['university'] = array(
'#type' => 'textfield',
'#title' => t('University/ Institute'),
'#size' => 80,
'#maxlength' => 200,
'#required' => TRUE,
'#attributes' => array(
'placeholder' => 'Insert full name of your institute/ university.... '
),
'#description' => 'Please insert full name of your institute/ university.'
);
$form['city'] = array(
'#type' => 'select',
'#title' => t('City/ Village'),
//'#options' => _lm_list_of_cities(),
'#options' => array(""=>""),
'#maxlength' => 150,
'#required' => TRUE,
'#description' => 'Please select location of your institute/ university.'
);
$form['pincode'] = array(
'#type' => 'textfield',
'#title' => t('Pincode'),
'#size' => 30,
'#maxlength' => 6,
'#required' => TRUE,
'#attributes' => array(
'placeholder' => 'Insert pincode of your city/ village....'
),
'#description' => 'Please insert pincode of your institute/ university.'
);
$form['all_state'] = array(
'#type' => 'select',
'#title' => t('State'),
//'#options' => _lm_list_of_states(),
'#options' => array(""=>""),
'#required' => TRUE,
'#tree' => TRUE,
'#validated' => TRUE,
'#description' => 'Please select state of your institute/ university.'
);
$form['submit'] = array(
'#type' => 'submit',
'#value' => t('Submit')
);
return $form;
}
|