require_once(SITE_DIR."database/table.php");
class EduvendorsDatabaseTable extends DatabaseTable {
var $table='';
var $stable='';
function __construct(){
parent::__construct();
$this->table='eduvendors';
$this->stable='eduvendor';
}
function getRowById($ID)
{
return $this->getRow("SELECT * FROM $this->table WHERE id=".getCorrectInteger($ID));
}
function getImportUrls(){
return $this->getRows('SELECT * FROM '.$this->table.' WHERE importurl<>\'\'');
}
function getVendorByScraperClass($class){
return $this->getRow("SELECT * FROM $this->table WHERE specialscraper='".$this->quote($class)."'");
}
function getActiveVendors($smiple=false){
//get IDs of all vendors with visible courses
if($simple){
return $this->getRows('SELECT *,\'courses\' as providertype FROM '.$this->table.' WHERE isactive=\'y\' ORDER BY priority DESC,name');
}
return $this->getRows('SELECT v.*,count(c.id) as coursescount,count(c.id) as itemscount,\'courses\' as providertype FROM eduvendors as v JOIN courses as c ON (v.id=c.vendorid) WHERE v.isactive=\'y\' GROUP BY v.id ORDER BY v.priority DESC,v.name');
}
function getAllActiveVendors($smiple=false,$includecertification = true){
//get IDs of all vendors with visible courses
if($simple){
if ($includecertification) {
return $this->getRows('SELECT *,\'courses\' as providertype FROM eduvendors WHERE isactive=\'y\' ORDER BY priority DESC,name');
}
return $this->getRows('(SELECT *,\'courses\' as providertype FROM eduvendors WHERE isactive=\'y\' ) UNION '.
'(SELECT *,\'courses\' as providertype FROM certvendors WHERE isactive=\'y\' ) ORDER BY priority DESC,name');
}
if ($includecertification) {
return $this->getRows('SELECT v.*,count(c.id) as itemscount,\'courses\' as providertype FROM eduvendors as v JOIN courses as c ON (v.id=c.vendorid) WHERE v.isactive=\'y\' GROUP BY v.id ORDER BY priority DESC, name');
}
return $this->getRows('(SELECT v.*,count(c.id) as itemscount,\'courses\' as providertype FROM eduvendors as v JOIN courses as c ON (v.id=c.vendorid) WHERE v.isactive=\'y\' GROUP BY v.id) UNION '.
' (SELECT v.*,count(c.id) as itemscount,\'cert\' as providertype FROM certvendors as v JOIN exams as c ON (v.id=c.vendorid) WHERE v.isactive=\'y\' and c.visible=\'y\' GROUP BY v.id) ORDER BY priority DESC, name');
}
function createNewVendor($name,$website,$person,$email){
$sql="INSERT INTO $this->table SET ".
"name='".$this->quote($name)."',".
"website='".$this->quote($website)."',".
"contactperson='".$this->quote($person)."',".
"contactemail='".$this->quote($email)."',".
"isactive='n'";
$this->dbExecQuery($sql);
return $this->getLastInsertID();
}
function changeStatus($id,$active='y'){
$sql='UPDATE '.$this->table.' SET isactive=\''.$active.'\' WHERE id = '.$id;
$this->dbExecQuery($sql);
return true;
}
//return user account for the course or null if no manager
function getCourseManager($courseid){
}
function updateVendorData($id,$data){
if(!is_array($data)) return false;
$list=array();
foreach($data as $k=>$v){
$list[]=$k.'=\''.$this->quote($v).'\'';
}
$sql="UPDATE $this->table SET ".join(', ',$list)." WHERE id = ".$id;
$this->dbExecQuery($sql);
return true;
}
function createNewTempVendor($vendorname,$vendorsite){
$sql="INSERT INTO ".$this->table."_temp SET ".
"name='".$this->quote($vendorname)."',".
"website='".$this->quote($vendorsite)."'";
$this->dbExecQuery($sql);
return $this->getLastInsertID();
}
function getTempVendor($id){
return $this->getRow("SELECT * FROM ".$this->table."_temp WHERE id=$id");
}
function updateTempVendor($vendorid,$vendorname,$vendorsite){
$sql="UPDATE ".$this->table."_temp SET ".
"name='".$this->quote($vendorname)."',".
"website='".$this->quote($vendorsite)."' WHERE id=$vendorid";
$this->dbExecQuery($sql);
}
function deleteTempVendorIfNoCourses($vendorid){
$c=$this->getRow("SELECT count(id) as c FROM courses WHERE vendorid=$vendorid");
if($c['c']==0){
$sql="DELETE FROM ".$this->table."_temp WHERE id=$vendorid";
$this->dbExecQuery($sql);
}
return true;
}
function getVendorIdByAPIKey($apikey){
$ssql="SELECT * FROM vendoroptions WHERE apikey='".$this->quote($apikey)."'";
$r=$this->getRow($ssql);
if(isset($r['id'])) return $r['id'];
return 0;
}
function getVendorOptionsKeys(){
return array('apikey','package','upgradetopackage','subsprice','leadsonmep','certificcatestest','leadstest','credits');
}
function initUpgrade($vendorid,$plan){
$userdb=F::getDBObject('user');
$userdb->getVendorOptions($vendorid);
$sql="UPDATE vendoroptions SET upgradetopackage='".$this->quote($plan)."' WHERE id=".$vendorid;
$this->dbExecQuery($sql);
return true;
}
function completeUpgrade($userid,$newplan){
$sql="UPDATE vendoroptions SET package='".$this->quote($newplan)."',upgradetopackage='' WHERE id=$userid";
$this->dbExecQuery($sql);
return true;
}
function cancelInitedUpgrade($vendorid){
$sql="UPDATE vendoroptions SET upgradetopackage='' WHERE id=".$vendorid;
$this->dbExecQuery($sql);
return true;
}
function makePriority($vendorid,$searchpriority,$altpriority){
$sql='UPDATE '.$this->table.' SET priority='.$searchpriority.',altpriority='.$altpriority.' WHERE id = '.$vendorid;
$this->dbExecQuery($sql);
return true;
}
}
?>
Fatal error: Class 'EduvendorsDatabaseTable' not found in /home/myedu/domains/myeducationpath.com/html/include/factory.php on line 157
Unexpected error! |
Fatal Error: Class 'EduvendorsDatabaseTable' not found in line: 157 in the file: /home/myedu/domains/myeducationpath.com/html/include/factory.php. We are notified and will solve the problem as soon as possible. |
#0 [internal function]: Gelembjuk\Logger\ErrorScreen->fatalsHandler() #1 {main} |