-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprogram.php.bak
More file actions
132 lines (117 loc) · 4.43 KB
/
Copy pathprogram.php.bak
File metadata and controls
132 lines (117 loc) · 4.43 KB
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
<?php
include 'newcurriculm.php';
?>
<script>
$(document).ready(function(){
$(document).on('click', '#get_sub', function(e){
e.preventDefault();
var prog = $(this).data('id');
$.ajax({
url: 'get_subject.php',
type: 'POST',
data: 'prog='+prog,
beforeSend:function()
{
$("#content").html('Working on Please wait ..');
},
success:function(data)
{
$("#content").html(data);
},
})
});
})
</script>
<h3 class="page-header">Program <small>section</small></h3>
<div class="col-md-8">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">List of Department</h3>
</div>
<div class="panel-body">
<table id="students" class="table table-hover table-bordered">
<thead>
<tr id="heads">
<th style="width:10%">Department</th>
<th style="width:10%">Term</th>
<th style="width:20%"></th>
</tr>
</thead>
<tbody>
<?php
include 'db.php';
$sql= mysqli_query($conn, "SELECT * FROM program Order by DEPARTMENT");
while($row = mysqli_fetch_assoc($sql)) {
?>
<form method="post" action="update_program.php">
<tr>
<input type="hidden" name="id" value="<?php echo $row['PROGRAM_ID']?>">
<td><input name="dep" type="text" style="border:0px" value="<?php echo $row['DEPARTMENT'] ?>"></td>
<td><textarea name="trm" type="text" style="border:0px;width:100%" ><?php echo $row['TERM'] ?></textarea></td>
<td><center><a data-toggle="modal" data-target="#program" data-id="<?php echo $row['DEPARTMENT'] ?>" id="get_sub">Subjects</a>|<button type="submit" style="border:0px;background:white" ><i class="fa fa-pencil-square" aria-hidden="true"></i> update</button></center></td>
</tr>
</form>
<?php
} mysqli_close($conn);
?>
</tbody>
</table>
</div>
</div>
</div>
<div class="col-md-4">
<div class="container frm-new">
<div class="row main">
<div class="main-login main-center">
<h3>Add New Department</h3>
<form class="" method="post" >
<input type="hidden" name="id">
<div class="form-group">
<label for="sub" class="cols-sm-2 control-label">Department</label>
<div class="cols-sm-4">
<div class="input-group">
<input type="text" class="form-control" name="dep" id="sub"
style="width:225px" placeholder="Enter Department" value="<?php if(isset($_POST['dep'])){echo $_POST['dep'];} ?>"/>
<p>
<?php if(isset($errors['dep'])){echo "<br><br><div class='erlert'><h5>" .$errors['dep']. "</h5></div>"; } ?>
</p>
</div>
</div>
</div>
<div class="form-group">
<label for="trm" class="cols-sm-2 control-label">Term</label>
<div class="cols-sm-4">
<div class="input-group">
<input type="text" class="form-control" name="trm" id="trm"
style="width:225px" placeholder="Enter Term" value="<?php if(isset($_POST['trm'])){echo $_POST['trm'];} ?>" ></textarea>
<p>
<?php if(isset($errors['des'])){echo "<br><br><br><div class='erlert'><h5>" .$errors['des']. "</h5></div>"; } ?>
</p>
</div>
</div>
</div>
<div class="form-group ">
<input type="reset" class="btn btn-info" id="reset" name="reset" value="Cancel">
<button class="btn btn-info" id="submit">Add</button>
</div>
</form>
</div>
</div>
</div>
<div class="modal fade" id="program" role="dialog">
<div class="modal-dialog modal-md">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Subjects</h4>
</div>
<div class="modal-body">
<div class="container">
<div id="content"></div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-success" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>