File tree Expand file tree Collapse file tree 4 files changed +42
-3
lines changed Expand file tree Collapse file tree 4 files changed +42
-3
lines changed Original file line number Diff line number Diff line change 11# ignore input.php file
22input.php
3+
4+ # ignore buffers
5+ buffer /
Original file line number Diff line number Diff line change 4040 echo "<tr> " .$ str ."</tr> " ;
4141}
4242echo "</table> " ;
43- echo "<h3>AVERAGE WAITING TIME: " .$ output [$ num_proc ]."<br>AVERAGE TURN-AROUND TIME: " .$ output [$ num_proc +1 ]."</h3> " ;
44- echo "<h3>GANTT CHART<br> " .$ output [$ num_proc +2 ]."<br> " .$ output [$ num_proc +3 ]."</h3> " ;
43+ echo "<h4>AVERAGE WAITING TIME: " .$ output [$ num_proc ]."<br>AVERAGE TURN-AROUND TIME: " .$ output [$ num_proc +1 ]."</h4> " ;
44+ echo "<h4>GANTT CHART<br></h4> " ;
45+
46+ echo "<table id= \"gantt_chart \"> " ;
47+ $ temp = explode (" " ,$ output [$ num_proc +2 ]);
48+ $ time = array_slice (explode (" " ,$ output [$ num_proc +3 ]),1 );
49+ $ str ="" ;
50+
51+ $ i =0 ;
52+ $ px =20 ;
53+ foreach ($ temp as $ result ) {
54+ if ( $ i == 0 )
55+ $ str = $ str ."<th style= \"width: " .(int )$ time [$ i ]*$ px ."px \">P " .$ result ."</th> " ;
56+ else
57+ $ str = $ str ."<th style= \"width: " .((int )$ time [$ i ]-(int )$ time [$ i -1 ])*$ px ."px \">P " .$ result ."</th> " ;
58+ $ i ++;
59+ }
60+ echo "<tr> " .$ str ."</tr> " ;
61+
62+ $ str ="" ;
63+ $ i =0 ;
64+ foreach ($ time as $ result ) {
65+ if ( $ i == 0 )
66+ $ str = $ str ."<td><div style= \"float:left; \">0</div><div style= \"float:right; \"> " .$ result ."</div></td> " ;
67+ else
68+ $ str = $ str ."<td><div style= \"float:right \"> " .$ result ."</div></td> " ;
69+ $ i ++;
70+ }
71+ echo "<tr> " .$ str ."</tr></table> " ;
4572
4673?>
Original file line number Diff line number Diff line change @@ -107,7 +107,16 @@ function display_output() {
107107
108108$ _SESSION ["algo_num " ] = $ algo_num ;
109109
110- echo "<br><br> " ;
110+ $ algo_name ;
111+ if ( $ algo_num == 1 )
112+ $ algo_name = "FIRST COME FIRST SERVE " ;
113+ else if ( $ algo_num == 2 )
114+ $ algo_name = "SHORTEST JOB FIRST " ;
115+ else if ( $ algo_num == 3 )
116+ $ algo_name = "ROUND ROBIN " ;
117+ else
118+ $ algo_name = "PRIORITY SCHEDULING " ;
119+ echo "<h2 style= \"text-align:center \"> " .$ algo_name ."</h2><br> " ;
111120
112121echo "<table id= \"input_tab \"> " ;
113122if ( $ algo_num == 4 ) {
You can’t perform that action at this time.
0 commit comments