ok
Direktori : /home2/selectio/public_html/salemgovtitialumni.in/dashboard/admin/ |
Current File : /home2/selectio/public_html/salemgovtitialumni.in/dashboard/admin/alumini-reports-delete.php |
<?php require_once('header.php'); ?> <?php if(!isset($_REQUEST['id'])) { header('location: logout.php'); exit; } else { // Check the id is valid or not $statement = $pdo->prepare("SELECT * FROM tbl_trainee WHERE id=?"); $statement->execute(array($_REQUEST['id'])); $total = $statement->rowCount(); if( $total == 0 ) { header('location: logout.php'); exit; } } ?> <?php // Getting photo ID to unlink from folder $statement = $pdo->prepare("SELECT * FROM tbl_trainee WHERE id=?"); $statement->execute(array($_REQUEST['id'])); $result = $statement->fetchAll(PDO::FETCH_ASSOC); foreach ($result as $row) { $photo = $row['acheiver_file']; } // Unlink the photo if($photo!='') { unlink('../'.$photo); } // Delete from tbl_service $statement = $pdo->prepare("DELETE FROM tbl_trainee WHERE id=?"); $statement->execute(array($_REQUEST['id'])); header('location:alumini-reports-lists.php?code='.$_REQUEST['type']); ?>