Warning: chmod(): Operation not permitted in /var/www/hopeinstoughton_www/wp-content/plugins/simple-universal-google-analytics/main.php on line 8 [0] in function chmod in /var/www/hopeinstoughton_www/wp-content/plugins/simple-universal-google-analytics/main.php on line 8 [1] in function include_once in /var/www/hopeinstoughton_www/wp-settings.php on line 560 [2] in function require_once in /var/www/hopeinstoughton_www/wp-config.php on line 85 [3] in function require_once in /var/www/hopeinstoughton_www/wp-load.php on line 50 [4] in function require_once in /var/www/hopeinstoughton_www/wp-blog-header.php on line 13 [5] in function require in /var/www/hopeinstoughton_www/index.php on line 17
| Server IP : 94.177.8.99 / Your IP : 216.73.217.165 Web Server : Apache/2.4.58 (Ubuntu) System : Linux aries 6.8.0-134-generic #134-Ubuntu SMP PREEMPT_DYNAMIC Fri Jun 26 18:43:11 UTC 2026 x86_64 User : www-data ( 33) PHP Version : 8.1.34 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /var/www/kjvdictionary_store/modules/storeAccount/model/ |
Upload File : |
<?php
class UserAccount_Model extends Database_Model {
protected $cancel_key;
protected $cancel_reason;
protected $cancel_detail;
protected $changed;
public function __construct() {
parent::__construct();
}
public function datatableOrderlist() {
return FALSE;
}
public function CancelKey() { // tablename:primarykey
if (func_num_args()) {
$old_key = $this->cancel_key;
$this->cancel_key = func_get_arg(0);
if ($this->cancel_key != $old_key) {
$this->Load();
}
return $this;
}
return $this->cancel_key;
}
public function CancelReason() {
if (func_num_args()) {
$this->cancel_reason = func_get_arg(0);
$this->changed['c_reason'] = $this->cancel_reason;
return $this;
}
return $this->cancel_reason;
}
public function CancelDetail() {
if (func_num_args()) {
$this->cancel_detail = func_get_arg(0);
$this->changed['c_details'] = $this->cancel_detail;
return $this;
}
return $this->cancel_detail;
}
protected function Load() {
$DATA = $this->Query('select * from `cancellation`')
->Where('c_key=%s', $this->cancel_key)
->First();
$this->LoadFromDataset($DATA);
}
public function LoadFromDataset($DATA, $key = NULL) {
if (!is_null($key)) $this->cancel_key = $DATA->c_key;
$this->changed = [];
$this->cancel_reason = $DATA->c_reason ?? '';
$this->cancel_detail = $DATA->c_details ?? '';
}
public function Update() {
if (count($this->changed)) {
$this->changed['c_modified'] = time();
$this->Tablename('cancellation')
->InsertOrUpdate([
'c_key' => $this->cancel_key,
], $this->changed
);
$this->changed = [];
}
}
public function generateAutocomplete($term) {
$rows = $this->Query('select user_id, name_first,name_last from `users`')
->Where('concat(name_first, " ", name_last) like %s', "%{$term}%")
->Get();
$result = [];
foreach($rows as $row) {
$name = $row->name_first . ' ' . $row->name_last;
$result[] = ['id' => $row->user_id, 'value' => "{$name} [{$row->user_id}]"];
}
return $result;
}
}