Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2
2021-193 User-friendly enhanced machine learning-based railway management system
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
2021-193
2021-193 User-friendly enhanced machine learning-based railway management system
Commits
21b8f4b9
Commit
21b8f4b9
authored
Sep 28, 2021
by
Mihiranga G.L.V - IT18500790
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'IT18500790' into 'master'
Create trip plan See merge request
!5
parents
ecf03282
404d5c56
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
82 additions
and
5 deletions
+82
-5
sub_trip_planned_create_trip_plan.php
sub_trip_planned_create_trip_plan.php
+82
-5
No files found.
sub_trip_planned_create_trip_plan.php
View file @
21b8f4b9
...
...
@@ -175,7 +175,7 @@
// print_r($select_full_array);
$sql11
=
"SELECT MAX(train_no) AS firstStop FROM final_railway_station WHERE
line
= '
$get_line_no
' "
;
$sql11
=
"SELECT MAX(train_no) AS firstStop FROM final_railway_station WHERE
`line`
= '
$get_line_no
' "
;
$result11
=
mysqli_query
(
$con
,
$sql11
)
or
die
(
mysqli_error
(
$con
));
$row11
=
mysqli_fetch_assoc
(
$result11
);
...
...
@@ -193,6 +193,24 @@
$end_date
=
$ini_end_date
;
$start_time
=
'05:00:00'
;
$start_date_time
=
$ini_start_date
.
" "
.
$start_time
;
$main_start_time
=
""
;
?>
<table
class=
"table table-bordered"
>
<thead
class=
"thead-light"
>
<tr>
<th
scope=
"col"
>
Start Location
</th>
<th
scope=
"col"
>
Places
</th>
<th
scope=
"col"
>
Train Name
</th>
<th
scope=
"col"
>
Arrival Time
</th>
<th
scope=
"col"
>
End Location
</th>
<th
scope=
"col"
>
Departure Time
</th>
</tr>
</thead>
<tbody>
<?php
for
(
$c
=
$start_location
;
$c
>=
$last_railway_stop
;
$c
--
)
{
...
...
@@ -203,13 +221,72 @@
if
(
$c
==
$start_location
){
//Colombo fort to relevent Location
echo
$start_date_time
.
"<br>"
;
$start_date_time
=
date
(
'Y-m-d H:i:s'
,
strtotime
(
$start_date_time
.
'+15 hour'
));
// echo $start_date_time ."<br>";
// $start_date_time = date('Y-m-d H:i:s', strtotime($start_date_time.'+15 hour'));
$sql13
=
"SELECT * FROM final_railway_station WHERE `line` =
$now_line_no
AND `train_no` =
$start_location
"
;
$result13
=
mysqli_query
(
$con
,
$sql13
)
or
die
(
mysqli_error
(
$con
));
$row13
=
mysqli_fetch_assoc
(
$result13
);
$colombo_train_id_list
=
array
();
$sql14
=
"SELECT * FROM train_times WHERE `lineno` =
$now_line_no
AND `trainno` =
$start_location
AND `dirId` = 'f' ORDER BY `arrival` ASC "
;
$result14
=
mysqli_query
(
$con
,
$sql14
)
or
die
(
mysqli_error
(
$con
));
while
(
$row14
=
mysqli_fetch_array
(
$result14
)){
$colombo_start_time
=
$row14
[
'arrival'
];
$colombo_train_id
=
$row14
[
'id'
];
$str_start_time
=
strtotime
(
$start_time
);
$str_colombo_start_time
=
strtotime
(
$colombo_start_time
);
if
(
$str_start_time
<
$str_colombo_start_time
)
{
array_push
(
$colombo_train_id_list
,
$colombo_train_id
);
}
}
$colombo_first_train
=
$colombo_train_id_list
[
0
];
$sql16
=
"SELECT * FROM train_times WHERE `id` =
$colombo_first_train
"
;
$result16
=
mysqli_query
(
$con
,
$sql16
)
or
die
(
mysqli_error
(
$con
));
$row16
=
mysqli_fetch_assoc
(
$result16
);
$sql17
=
"SELECT MAX(placeTrainNo) AS colombo_to_next FROM visitplacetemp WHERE logUserid =
$logUserid
AND placeLineNo =
$now_line_no
"
;
$result17
=
mysqli_query
(
$con
,
$sql17
)
or
die
(
mysqli_error
(
$con
));
$row17
=
mysqli_fetch_assoc
(
$result17
);
$colombo_train_arrival_time
=
$row16
[
'arrival'
];
$colombo_train_dep_time
=
$row16
[
'dep'
];
$colombo_train_name
=
$row16
[
'trainname'
];
//Train name
$colombo_name
=
"Colombo Fort"
;
// Start name;
$colombo_train_arrival_date_time
=
$start_date
.
" "
.
$colombo_train_arrival_time
;
// Arrival
$colombo_train_dep_date_time
=
$start_date
.
" "
.
$colombo_train_dep_time
;
//Departure
$main_start_time
=
$colombo_train_dep_date_time
;
$colombo_to_next_station
=
$row17
[
'colombo_to_next'
];
$sql18
=
"SELECT * FROM final_railway_station WHERE train_no =
$colombo_to_next_station
AND `line` =
$now_line_no
"
;
$result18
=
mysqli_query
(
$con
,
$sql18
)
or
die
(
mysqli_error
(
$con
));
$row18
=
mysqli_fetch_assoc
(
$result18
);
$colombo_to_next_station_name
=
$row18
[
'name'
];
//Colombo to next station
?>
<tr>
<td>
<?php
echo
$colombo_name
?>
</td>
<td></td>
<td>
<?php
echo
$colombo_train_name
?>
</td>
<td>
<?php
echo
str_replace
(
' '
,
'<br>'
,
$colombo_train_arrival_date_time
)
?>
</td>
<td>
<?php
echo
$colombo_to_next_station_name
?>
</td>
<td>
<?php
echo
str_replace
(
' '
,
'<br>'
,
$colombo_train_dep_date_time
)
?>
</td>
</tr>
<?php
}
else
if
(
$rowcount15
>
0
)
{
// Place to place
echo
$start_date_time
.
"<br>"
;
$start_date_time
=
date
(
'Y-m-d H:i:s'
,
strtotime
(
$start_date_time
.
'+12 hour'
));
// echo $start_date_time ."<br>";
// $start_date_time = date('Y-m-d H:i:s', strtotime($start_date_time.'+12 hour'));
echo
$main_start_time
.
"<br>"
;
}
else
{
continue
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment