Beispiel #1
0
def get_sub_select():
    res = conn.getsub(request.form['cid'])
    if res:
        r = """<select name="sub" id="sub" class="form-control" placeholder="Subject" onchange="getmod(value)">
                        <option disabled="disabled" selected="selected" value="null">Choose Subject
                        </option>"""

        for i in res:
            r = r + """<option value=""" + str(i[0]) + """>""" + str(
                i[1]) + """</option>"""

        r = r + """</select>"""
        return r
Beispiel #2
0
def get_sub():
    res = conn.getsub(request.form['cid'])
    print('gggg', res)
    if res:
        r = """<div class="card shadow mb-4">
				<div class="card-header py-3">
				<h6 class="m-0 font-weight-bold text-primary">Subjects List</h6>
				</div>
				<div class="card-body">
				<div class="table-responsive">
					<table class="table table-bordered" id="dataTable" width="100%" cellspacing="0">
					<thead>
						<tr>
						<th>ID</th>
						<th>Name</th>
						<th>Type</th>
						<th>Semester</th>
						<th>No of Modules</th>
						</tr>
					</thead>
					<tbody>"""
        for i in res:
            r = r + """<tr>
						<td style="cursor: pointer;" data-toggle="modal" data-target="#sub_updt_modal"
                        onclick="updt('""" + str(i[0]) + """', '""" + str(
                i[1]) + """', '""" + str(i[2]) + """', '""" + str(
                    i[3]) + """', '""" + str(i[4]) + """', '""" + str(
                        i[5]) + """')">""" + str(i[0]) + """</td>
						<td>""" + str(i[1]) + """</td>
						<td>""" + str(i[2]) + """</td>
						<td>""" + str(i[3]) + """</td>
						<td>""" + str(i[4]) + """</td>
						</tr>"""
        r = r + """ </tbody>
					</table>
				</div>
				</div>
			</div>"""
        return r