| Server IP : 3.111.61.48 / Your IP : 216.73.216.67 Web Server : Apache System : Linux ip-10-0-5-176 6.8.0-1057-aws #60~22.04.1-Ubuntu SMP Wed May 27 08:16:59 UTC 2026 x86_64 User : ubuntu ( 1000) PHP Version : 8.2.31 Disable Function : exec,passthru,shell_exec,system MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /var/www/vhost/gyaniguru.org/admin/models/ |
Upload File : |
<?php
$ds = DIRECTORY_SEPARATOR;
$base_dir = realpath(dirname(__FILE__) . $ds . '..' . $ds . '..') . $ds;
$DatabaseMysql = "{$base_dir}inc{$ds}DatabaseMysql.class.php";
require_once($DatabaseMysql);
/**
* Subscribers Class
*/
class Subscribers
{
// DB stuff
private $conn;
private $database;
private $table = 'subscribers';
private $query_string;
private $query_parse;
private $ResultRecord;
private $row;
private $DeleteSubsId;
private $resMsg;
public function __construct()
{
// Instantiate DB & connect
$this->database = new DatabaseMysql();
$this->conn = $this->database->connect();
$this->ResultRecord = array();
$this->resMsg = 'error';
}
public function getData()
{
// Query String
$this->query_string = "SELECT * FROM ".$this->table." ORDER BY created_at DESC";
// Query execution
$this->query_parse = mysqli_query($this->conn, $this->query_string) or die(mysqli_error($this->conn));
while ($this->row = mysqli_fetch_object($this->query_parse)){
$this->ResultRecord[] = $this->row;
}
return $this->ResultRecord;
}
public function deleteData($postData)
{
$this->DeleteSubsId = isset($postData['DeleteSubsId']) ? (int) mysqli_escape_string($this->conn, trim($postData['DeleteSubsId'])) : null;
if ($this->DeleteSubsId > 0) {
// Query String
$this->query_string = "DELETE FROM ".$this->table." WHERE `id` = ".$this->DeleteSubsId;
// Query execution
$this->query_parse = mysqli_query($this->conn, $this->query_string) or die(mysqli_error($this->conn));
$this->resMsg = ($this->query_parse) ? 'success' : 'error';
}
return $this->resMsg;
}
}