| Server IP : 77.37.53.228 / Your IP :
216.73.216.109 [
Web Server : LiteSpeed System : Linux nl-srv-web1124.main-hosting.eu 4.18.0-553.121.1.lve.el8.x86_64 #1 SMP Thu Apr 30 16:40:41 UTC 2026 x86_64 User : u964240598 ( 964240598) PHP Version : 8.4.19 Disable Function : system, exec, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail Domains : 2 Domains MySQL : OFF | cURL : ON | WGET : ON | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /home/u964240598/domains/hofam.org/public_html/churchapp/application/models/ |
Upload File : |
<?php
/**
* Created by PhpStorm.
* User: ray
* Date: 12/06/2018
* Time: 14:29
*/
class Bible_model extends CI_Model{
public $status = 'error';
public $message = 'Error processing requested operation.';
public $user = "";
function __construct(){
parent::__construct();
}
function biblesListing(){
$this->db->select('tbl_bible_versions.*');
$this->db->from('tbl_bible_versions');
$this->db->order_by('name','ASC');
$query = $this->db->get();
$result = $query->result();
foreach ($result as $res) {
$res->source = base_url()."uploads/".$res->source;
}
return $result;
}
function checkNameExists($name, $id = 0)
{
//echo $name . " and ". $group;
$this->db->select("name");
$this->db->from("tbl_bible_versions");
$this->db->where("name", $name);
if($id != 0){
$this->db->where("id !=", $id);
}
$query = $this->db->get();
//var_dump($query->result()); die;
return $query->result();
}
function addNewBible($info)
{
if(empty($this->checkNameExists($info['name']))){
$this->db->trans_start();
$this->db->insert('tbl_bible_versions', $info);
$this->db->trans_complete();
$this->status = 'ok';
$this->message = 'New Bible Version added successfully';
}else{
$this->status = 'error';
$this->message = 'Bible Version name already exists';
}
}
function editBible($info, $id){
if(empty($this->checkNameExists($info['name'],$id))){
$this->db->where('id', $id);
$this->db->update('tbl_bible_versions', $info);
$this->status = 'ok';
$this->message = 'Bible Version name edited successfully';
}else{
$this->status = 'error';
$this->message = 'Bible Version name already exists';
}
}
function getBibleInfo($id)
{
$this->db->select('tbl_bible_versions.*');
$this->db->from('tbl_bible_versions');
$this->db->where('id', $id);
$query = $this->db->get();
return $query->row();
}
function deleteBible($id){
$this->db->where('id', $id);
$this->db->delete('tbl_bible_versions');
$this->status = 'ok';
$this->message = 'Bible Version deleted successfully.';
}
}
Anon7 - 2022
AnonSec Team
