<?php include '../../Model/dbSubject.php'; $finalArray = array(); foreach ($_POST as $key => $valuesArray) { if ($key != 'submit') { if ($key == 'id') { $id = $valuesArray; } else { $finalArray[] = $key . " = '" . $valuesArray . "'"; } } } $obj = new dbSubject(); $obj->editAnyData('tblSubject', $finalArray, $id); header('location: /schoolNew/View/subjects/subjectList.php');
<h2> <i class="halflings-icon list"></i> <span class="break"></span> <b>Subject List</b> </h2> <div class="box-icon"> <a href="subjectEntry.php"><i class="halflings-icon plus"></i></a> <a href="#" class="btn-minimize"> <i class="halflings-icon chevron-up"></i> </a> </div> </div> <?php $obj = new dbSubject(); $result = $obj->getAllSubjects(); ?> <div class="box-content"> <table class="table table-striped table-bordered bootstrap-datatable datatable"> <thead> <tr> <th>Serial</th> <th>Subject Name</th> <th>Standard</th> <!-- <th style="text-align:center">View</th> --> <th style="text-align:center">Edit</th> <th style="text-align:center">Delete</th> </tr>
<?php include '../../Model/dbSubject.php'; $id = $_GET['id']; $obj = new dbSubject(); $result = $obj->getSubject($id); $row = mysqli_fetch_assoc($result); //print_r($row); ?> <!DOCTYPE html> <html lang="en"> <head> <!-- start: Meta --> <meta charset="utf-8"> <title>Edit Subject</title> <!-- end: Meta --> <!-- start: Mobile Specific --> <meta name="viewport" content="width=device-width, initial-scale=1"> <!-- end: Mobile Specific --> <!-- start: CSS --> <link id="bootstrap-style" href="../../Theme/css/bootstrap.min.css" rel="stylesheet"> <link href="../../Theme/css/bootstrap-responsive.min.css" rel="stylesheet"> <link id="base-style" href="../../Theme/css/style.css" rel="stylesheet"> <link id="base-style-responsive" href="../../Theme/css/style-responsive.css" rel="stylesheet"> <link id="font-awesome" href="../../Theme/css/font-awesome.css" rel="stylesheet"> <link id="font-awesomemin" href="../../Theme/css/font-awesome.min.css" rel="stylesheet">
<?php include '../../Model/dbSubject.php'; $id = $_GET['id']; $obj = new dbSubject(); $obj->subjectDelete($id); header('location: /schoolNew/View/subjects/subjectList.php');
<?php include '../../Model/dbSubject.php'; $mykey = array(); $myvalue = array(); /* foreach($_POST as $key => $value) { if($key!='submit') { $mykey[] = $key; $myvalue[] = $value; } } */ $tSubjectName = $_POST['tSubjectName']; $nForStandard = $_POST['nForStandard']; //echo "$tSubjectName<BR/>" ; //echo "$nForStandard<BR/>" ; $obj = new dbSubject(); //$obj->insertAnyData('tblSubject',$mykey,$myvalue); $obj->insertSubject($tSubjectName, $nForStandard); header('location: /schoolNew/View/subjects/subjectList.php');