public function checkTransLog($id) { if (!empty($id)) { $transaction = Transaction::find_by_main_id($id); if ($transaction) { return $transaction; } else { return false; } } }
public function checkTransLog($id) { if (!empty($id)) { $transaction = Transaction::find_by_main_id($id); if ($transaction) { //echo "<p><strong class='alert-box alert'>Record cannot be deleted! <br /> History already existing for this record</strong></p>"; return 2; } elseif (!$transaction) { $merole = Roles::find_by_mainid($id); if ($merole->delete()) { return 1; } } else { return 3; ///Unexpected Error } } }
public function checkTransLog($id) { if (!empty($id)) { $transaction = Transaction::find_by_main_id($id); print_r($transaction); if ($transaction) { //echo "<p><strong class='alert-box alert'>Record cannot be deleted! <br /> History already existing for this record</strong></p>"; return 2; } else { $merole = Product::find_by_mainid(trim($id)); print_r($merole); if ($merole->delete()) { return 1; } } } }