<h2> <i class="halflings-icon list"></i> <span class="break"></span> <b>Countries</b> </h2> <div class="box-icon"> <a href="countryEntry.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 dbCountry(); $result = $obj->getAllCountryData(); ?> <div class="box-content"> <table class="table table-striped table-bordered bootstrap-datatable datatable"> <thead> <tr> <th>Serial</th> <th>Country Name</th> <th style="text-align:center">Operations</th> <th style="text-align:center"></th> <th style="text-align:center"></th> </tr>
<?php include '../../Model/dbCountry.php'; $finalArray = array(); foreach ($_POST as $key => $valuesArray) { if ($key != 'submit') { if ($key == 'id') { $id = $valuesArray; } else { $finalArray[] = $key . " = '" . $valuesArray . "'"; } } } $obj = new dbCountry(); $obj->editData('tblCountries', $finalArray, $id); header('location: /school/View/countries/countryList.php');
<?php include '../../Model/dbCountry.php'; $mykey = array(); $myvalue = array(); foreach ($_POST as $key => $value) { if ($key != 'submit') { $mykey[] = $key; $myvalue[] = $value; } } $obj = new dbCountry(); $obj->insertData('tblCountries', $mykey, $myvalue); header('location: /schoolNew/View/countries/countryList.php');