/var/www/myprog.com.ua/cashcontrol/libs
Edit: /var/www/myprog.com.ua/cashcontrol/libs/class.payment.php (1406B)
database = new database(DB_TYPE,DB_HOST,DB_NAME,DB_USER,DB_PASS,ENCODE);
$this->mail = new mail();
$this->count = 0;
}
final public function count ($where=''){
$sql = "SELECT count(p.id)
FROM `".DB_PREFIX."payments_pb` AS p
WHERE ".$where;
$sth= $this->database->prepare($sql);
$sth->execute();
if ($sth->rowCount() > 0) {
$row = $sth->fetch();
return $row['count(p.id)'];
}
return 0;
}
final public function select ($where=''){
$sql = "SELECT p.*
FROM `".DB_PREFIX."payments_pb` AS p
WHERE ".$where;
$sth= $this->database->prepare($sql);
$sth->execute();
if ($sth->rowCount() > 0) {
$this->setCount($sth->rowCount());
while($row = $sth->fetch(PDO::FETCH_ASSOC)){
$result[] = $row;
}
}else{
$result[] = array();
}
return $result;
}
final public function select_one ($where=''){
$res = $this->select($where);
return $res[0];
}
private function setCount($count){
$this->count = $count;
}
final public function getCount(){
return $this->count;
}
}