/
assign_schedule.php
executable file
·242 lines (236 loc) · 11.2 KB
/
assign_schedule.php
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
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
<?php
require_once "session.php";
require_once "functions/category_function.php";
require_once "functions/create_schedule_function.php";
require_once "functions/assign_schedule_function.php";
require_once "header.php";
require_once "functions/athletes_functions.php";
$category = new categoryfunction();
$createschedule = new createscheduleFunction();
$assignschedule = new assignschedulefunction();
$athlete = new athletesFunction();
?>
<?php
$url = $_SERVER['PHP_SELF'];
if(isset($_GET['update_success'])){
echo "<script>alert('Assign schedule update successfully');var url ='".$url."'; window.location = url ;</script>";
}
?>
<style>
#ui-id-1{
width: 204px !important;
}
</style>
<div class="container">
<div class="container align_center align_height">
<span class="sports">ASSIGN SCHEDULE</span>
</div><!--end container-->
<div class="container">
<div class="col-xs-12 col-md-11">
<div class="col-md-4 hidden-xs"></div>
<div class="col-xs-12 col-md-7 align_margin">
<form method="post" id="assignschedule_form">
<div class="form-group">
<label for="sel1">Select Schedule Name</label>
<select class="form-control adjust_width classic assignsche_create" id="sel1" name="Schedule" data-validation-error-msg="Please Select Name of the Schedule" data-validation="required">
<option value="">Select Schedule Name</option>
<?php
$data = $createschedule->createscheduleselectfunction();
foreach( $data as $eachrecord ) {
?>
<option value="<?php echo $eachrecord ['createschedule_id']; ?>"><?php echo $eachrecord ['createschedule_name']; ?></option>
<?php } ?>
</select>
</div>
<div class="form-group">
<label for="sel1">Select Category Name</label>
<select class="form-control adjust_width classic assignsche_cate" id="sel1" name="category" data-validation-error-msg="Please Select Category of the Schedule" data-validation="required">
<option value="">Select Category Name</option>
</select>
</div>
<label for="athlete">Add Athletes</label><br>
<div class="assign_content_holder col-md-11">
<div class="assign_clone_content">
<div class="form-group col-md-12">
<div class="col-md-6 form-group combo--align">
<select class="form-control name_align athlete_name athlete_name1" placeholder="Name" name="athlete_name1" id="combobox" data-validation-error-msg="Please Select Athlete" data-validation="required">
<option value="">Athletes</option>
<?php
$data = $athlete->athleteSelect1();
foreach( $data as $eachrecord ) {
?>
<option value="<?php echo $eachrecord ['athlete_id']; ?>"><?php echo $eachrecord ['athlete_name']; ?></option>
<?php } ?>
</select>
</div>
<!-- <input type="text" class="form-control name_align fl athlete_name" id="name" placeholder="Name" name="athlete_name1" required> -->
<div class="form-group col-md-6">
<input type="text" class="form-control date_assign dob" id="dob" placeholder="Date" name="athlete_date1" disabled>
</div>
</div>
<div class="form-group col-md-12">
<div class="form-group col-md-6">
<input type="text" class="form-control name_align athlete_mobile mobile" id="mobile" placeholder="Mobile no" name="athlete_mobile1" disabled>
</div>
<div class="form-group col-md-6">
<input type="text" class="form-control date_assign athlete_bib" id="bib" placeholder="BIB NO" name="athlete_bib1" data-validation-error-msg="Please Enter the BIB NO" data-validation="number">
</div>
</div>
</div>
</div>
<div class="form-group assign-add-button col-md-3">
<!-- <input type="submit" class="btn btn-primary align_right adds_btn add_athelete" value="Add"> -->
<!-- <i class="fa fa-plus add_align"></i> -->
<i class="fa fa-plus plus_align add_athelete">
<div class="tooltip_parameter">Add</div>
<div class="tip_triangle"></div>
</i>
<i class="fa fa-minus assign_remove">
<div class="tooltip_remove">Remove</div>
<div class="tip_triangle"></div>
</i>
</div>
<div class="col-md-9 schedule_btn">
<input type="reset" class="btn btn-primary align_right clear" value="Cancel">
<input type="submit" class="btn btn-primary align_right test-submit clear assignschedule_submit" value="Submit">
</div>
</form>
</div>
<div class="container table-position">
<table class="table state_table">
<thead>
<tr class="row_color">
<th class="align_center">SLNO</th>
<th class="align_center">Schedule Name</th>
<!-- <th class="align_center">Category Name</th>
<th class="align_center">Athletes Name</th>
<th class="align_center">BIB NO</th> -->
<th class="align_center">Action</th>
</tr>
</thead>
<tbody>
<?php
$data = $assignschedule->assignscheduleSelect();
$i=1;
foreach( $data as $eachrecord ) {
?>
<tr class="align_center delete_color">
<input value="<?php echo $eachrecord ['assignschedule_id']; ?>" type="hidden">
<td><?php echo $i; ?></td>
<td><?php echo $eachrecord ['createschedule_name']; ?></td>
<td>
<span class="edit_state edit_assign_schedule" data-schedule="<?php echo $eachrecord ['createschedule_id']; ?>" data-category="<?php echo $eachrecord ['assigncategory_id']; ?>">Edit</span>
<span class="delete_state" data-value="<?php echo $eachrecord ['assignschedule_id']; ?>">Delete</span>
</td>
</tr>
<?php $i++;} ?>
</tbody>
</table>
</div>
</div>
</div><!-- end container-->
</div><!-- end container-->
<div class="popup_fade cancel_btn"></div><!--popup_fade-->
<div class="container">
<div class="range_div">
<code class="close_btn cancel_btn"> </code>
<div class="edit_title">
<span class="del_txt">EDIT</span>
</div><!--edit_title-->
<div class="container state-content col-md-12 assign-scroll">
<div class="col-xs-12 col-md-12 align_margin">
<form id="edit_assign_schedule_form" action="functions/assign_schedule_function.php" method="post">
<div class="form-group">
<label for="sel1">Select Schedule Name</label>
<input type="text" class="form-control adjust_width classic schedule_update" name="Schedule" data-validation-error-msg="Please Select Name of the Schedule" data-validation="required" disabled />
</div>
<div class="form-group">
<label for="sel1">Select Category Name</label>
<select class="form-control adjust_width classic category_update" id="sel1" name="category" data-validation-error-msg="Please Select Category of the Schedule" data-validation="required">
<option value="">Select Category Name</option>
<?php
$data = $category->categoryselectfunction();
foreach( $data as $eachrecord ) {
?>
<option value="<?php echo $eachrecord ['categories_id']; ?>"><?php echo $eachrecord ['categories_name']; ?></option>
<?php } ?>
</select>
</div>
<label for="athlete" class="email_txt">Add Athletes</label><br>
<div class="clone_schedule_update_content col-md-12">
<div class="clone_schedule_update">
<div class="form-group col-md-12">
<div class="col-md-6 combo--align--popup">
<select class="form-control name_align fl athlete_name athlete_name_update athlete_name1" id="combobox1" placeholder="Name" name="athlete_name1" id="combobox" data-validation-error-msg="Please Select Athlete" data-validation="required">
<option value="">Athletes</option>
<?php
$data = $athlete->athleteSelect1();
foreach( $data as $eachrecord ) {
?>
<option value="<?php echo $eachrecord ['athlete_id']; ?>"><?php echo $eachrecord ['athlete_name']; ?></option>
<?php } ?>
</select>
</div>
<div class="col-md-6">
<!-- <input type="text" class="form-control schedule-name fl" id="name" placeholder="Name" name="name" data-validation-error-msg="Please Enter the name of the Athelete" data-validation="required"> -->
<input type="text" class="form-control bib_popup fl dob_update dob" id="name" placeholder="Date" disabled>
</div>
</div>
<div class="form-group col-md-12">
<div class="col-md-6">
<input type="text" class="form-control schedule-name fl mobile_update mobile" id="name" placeholder="Mobile no" disabled>
</div>
<div class="col-md-6">
<input type="text" class="form-control bib_popup athlete_bib fl bib_update" id="name" placeholder="BIB NO" name="athlete_bib1" data-validation-error-msg="Please Enter the BIBO NO" data-validation="number">
</div>
<input type="hidden" class="assing_schedule_update_id" name="assing_schedule_update_id1" value="" />
</div>
</div>
</div>
<input type="hidden" name="assing_schedule_update" value="1" />
<div class="col-md-10 schedule_btn">
<input type="reset" value="Cancel" class="btn btn-primary align_right clear reset_form">
<input type="submit" value="Submit" class="btn btn-primary align_right test-submit clear">
</div>
</form>
</div>
</div><!--state-content-->
</div><!--range_div-->
</div><!--container-->
<script type="text/javascript">
$(document).ready(function() {
$("#combobox").combobox({
select: function (event, ui) {
var ath_id = $(this).val();
$.ajax({
type: "POST",
url: "functions/athletes_functions.php?get_ath=true",
data: {'ath_id':ath_id},
cache: false,
dataType:'json',
success: function(html) {
$('.assign_content_holder .assign_clone_content:first').find('.dob').val(html.athlete_dob).attr('disabled', 'disabled');
$('.assign_content_holder .assign_clone_content:first').find('.mobile').val(html.athlete_mobile).attr('disabled', 'disabled');
}
});
}
});
$("#combobox1").combobox({
select: function (event, ui) {
var ath_id = $(this).val();
$.ajax({
type: "POST",
url: "functions/athletes_functions.php?get_ath=true",
data: {'ath_id':ath_id},
cache: false,
dataType:'json',
success: function(html) {
$('.clone_schedule_update_content .clone_schedule_update:first').find('.dob').val(html.athlete_dob);
$('.clone_schedule_update_content .clone_schedule_update:first').find('.mobile').val(html.athlete_mobile);
}
});
}
});
});
</script>
<?php require_once "footer.php" ?>