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
|
<?php
function form_edit_menu()
{
$items = array();
$items['form_edit/tbc/all'] = array(
'title' => 'All completed Proposals',
'description' => 'All completed Proposals',
'page callback' => '_completed_proposal_all',
'access callback' => 'user_access',
'access arguments' => array(
'edit completed book proposal'
),
'type' => MENU_NORMAL_ITEM,
'weight' => 2,
'file' => 'form_edit.inc'
);
$items['form_edit/lm/all'] = array(
'title' => 'All completed Lab Proposals',
'description' => 'All completed Lab Proposals',
'page callback' => '_completed_lab_proposal_all',
'access callback' => 'user_access',
'access arguments' => array(
'edit completed lab proposal'
),
'type' => MENU_NORMAL_ITEM,
'weight' => 2,
'file' => 'form_edit.inc'
);
$items['form_edit/tbc/edit'] = array(
'title' => 'Edit Proposal',
'description' => 'Edit Proposal',
'page callback' => 'drupal_get_form',
'page arguments' => array(
'proposal_edit_form'
),
'access arguments' => array(
'edit completed book proposal'
),
'type' => MENU_CALLBACK,
'file' => 'form_edit.inc'
);
$items['form_edit/lm/edit'] = array(
'title' => 'Edit Lab Proposal',
'description' => 'Edit Lab Proposal',
'page callback' => 'drupal_get_form',
'page arguments' => array(
'_completed_lab_proposal_edit_form'
),
'access arguments' => array(
'edit completed lab proposal'
),
'type' => MENU_CALLBACK,
'file' => 'form_edit.inc'
);
return $items;
}
function form_edit_permission()
{
return array(
"edit completed book proposal" => array(
"title" => t("edit completed book proposal"),
"description" => t("Allows users to edit completed book proposal.")
),
"edit completed lab proposal" => array(
"title" => t("edit completed lab proposal"),
"description" => t("Allows users to edit completed lab proposal.")
)
);
}
function _form_edit_list_of_departments()
{
$query = db_select('list_of_departments');
$query->fields('list_of_departments');
$query->orderBy('id', 'DESC');
$department_list = $query->execute();
while ($department_list_data = $department_list->fetchObject()) {
$department[$department_list_data->department] = $department_list_data->department;
} //$department_list_data = $department_list->fetchObject()
return $department;
}
function _form_edit_list_of_states()
{
$states = array(
0 => '-Select-'
);
$query = db_select('list_states_of_india');
$query->fields('list_states_of_india');
//$query->orderBy('', '');
$states_list = $query->execute();
while ($states_list_data = $states_list->fetchObject()) {
$states[$states_list_data->state] = $states_list_data->state;
} //$states_list_data = $states_list->fetchObject()
return $states;
}
function _form_edit_list_of_cities()
{
$city = array(
0 => '-Select-'
);
$query = db_select('list_cities_of_india');
$query->fields('list_cities_of_india');
$query->orderBy('city', 'ASC');
$city_list = $query->execute();
while ($city_list_data = $city_list->fetchObject()) {
$city[$city_list_data->city] = $city_list_data->city;
} //$city_list_data = $city_list->fetchObject()
return $city;
}
function _form_edit_list_of_category($category_id = NULL)
{
if ($category_id == NULL) {
$query = db_select('list_of_category');
$query->fields('list_of_category');
$query->orderBy('id', 'ASC');
$category_list = $query->execute();
} //$category_id == NULL
else {
$query = db_select('list_of_category');
$query->fields('list_of_category');
$query->condition('category_id', $category_id);
$query->orderBy('id', 'ASC');
$category_list = $query->execute();
}
while ($category_list_data = $category_list->fetchObject()) {
$category[$category_list_data->category_id] = $category_list_data->category_name;
} //$category_list_data = $category_list->fetchObject()
return $category;
}
|