</div> </fieldset> </form> <?php include "supControl.php"; include_once "Supplier.php"; //creates the model class $sup = new Supplier(); if (isset($_POST['delete'])) { $key = $_POST['sid']; $result = supControl::Delete($key); //prints the alert if ($result > 0) { echo "Done"; } else { echo "Error"; } } ?> <script src="/home/ayesh/group/jquery-2.1.4.min.js"></script> <script src="/home/ayesh/group/bootstrap.min.js"></script> <script src="/home/ayesh/group/script.js"></script> </body> </html>
<th>NIC</th> <th>LandPhone</th> <th>Mobile</th> <th>Address</th> <th>Email</th> </tr> </thead> <tbody> <?php include "dbcontroller//ItemController.php"; include_once "model//Item.php"; //creates the model class $newItem = new Item(); if (isset($_GET['view'])) { $key = $_GET['sid']; $search = supControl::Search($key); if (!empty($search)) { foreach ($search as $s) { echo "<tr>\n \t\t\t\t\t<td>{$s->getName()}</td>\n \t\t\t\t\t<td>{$s->getLPN()}</td>\n \t\t\t\t\t<td>{$s->getMPN()}</td>\n \t\t\t\t\t<td>{$s->getADR()}</td>\n \t\t\t\t\t<td>{$s->getEmail()}</td>\n \t\t\t\t\t<td>{$s->getNIC()}</td>\n \t\t\t\t\t</tr>"; } } else { echo '<h3>No items found</h3>'; } } ?> </tbody> </tbody> </table> </div>
include "supControl.php"; include_once "Supplier.php"; if (isset($_POST['sbt'])) { //creates the model class if (filter_input(INPUT_POST, 'npwd') == filter_input(INPUT_POST, 'vpwd')) { $newSup = new Supplier(); //setting values to model Item $newSup->setName(filter_input(INPUT_POST, 'sname')); $newSup->setNIC(filter_input(INPUT_POST, 'nic')); $newSup->setPrev(filter_input(INPUT_POST, 'prv')); $newSup->setLPN(filter_input(INPUT_POST, 'lpn')); $newSup->setMPN(filter_input(INPUT_POST, 'mpn')); $newSup->setEmail(filter_input(INPUT_POST, 'email')); $newSup->setADR(filter_input(INPUT_POST, 'adr')); $newSup->setPWD(filter_input(INPUT_POST, 'npwd')); $reulst = supControl::Insert($newSup); //prints the alert if ($reulst > 0) { echo "Data Inserted Successfully."; } else { echo "Error Inserting Record."; } } else { echo "Enter valid password."; } } ?> <script src="/home/ayesh/group/jquery-2.1.4.min.js"></script> <script src="/home/ayesh/group/bootstrap.min.js"></script> <script src="/home/ayesh/group/script.js"></script>