'0';");
if (mysqli_num_rows($res)>0) {
$row = mysqli_fetch_array($res);
return $row['usage_number'];
}
else {
return 0;
}
}
else {
return 0;
}
}
static public function input_partner_list($self_id) {
self::dbconnect();
global $conn;
$res = mysqli_query($conn,"SELECT * FROM sc_partners WHERE partner_id<>'".$self_id."' AND partner_status='1' ORDER BY partner_name ASC;");
$result = null;
if (mysqli_num_rows($res)>0) {
while ($row = mysqli_fetch_object($res)) {
$result[] = $row;
}
}
return $result;
}
static public function input_client_list($self_id) {
self::dbconnect();
global $conn;
$res = mysqli_query($conn,"SELECT * FROM sc_clients WHERE client_id<>'".$self_id."' ORDER BY client_name ASC;");
$result = null;
if (mysqli_num_rows($res)>0) {
while ($row = mysqli_fetch_object($res)) {
$result[] = $row;
}
}
return $result;
}
function get_partner_name_by_id($partner_id) {
self::dbconnect();
global $conn;
if ($partner_id!='') {
$partner = mysqli_query($conn,"select * from sc_partners where partner_id='".$partner_id."';");
if (mysqli_num_rows($partner)>0) {
$parter_data = mysqli_fetch_array($partner);
return $parter_data['partner_name'];
}
else {
return false;
}
}
else {
return false;
}
}
function get_client_name_by_id($client_id) {
self::dbconnect();
global $conn;
if ($client_id!='') {
$client = mysqli_query($conn,"select * from sc_clients where client_id='".$client_id."';");
if (mysqli_num_rows($client)>0) {
$client_data = mysqli_fetch_array($client);
return $client_data['client_name'];
}
else {
return false;
}
}
else {
return false;
}
}
function input_forras_list($selecteds=null) {
self::dbconnect();
global $conn;
$res = mysqli_query($conn,"SELECT * FROM sc_variants WHERE variant_group='forrasok' AND variant_status='1' order by variant_subgroup ASC;");
$result = '';
$subgroup = '';
if (mysqli_num_rows($res)>0) {
while ($row = mysqli_fetch_array($res)) {
if ($subgroup!=$row['variant_subgroup']) {
$subgroup = $row['variant_subgroup'];
if ($result!='') $result.= '';
$result.= '';
}
return $result;
}
function input_tipus_list($selected='',$section='',$colored=true) {
self::dbconnect();
global $conn;
$res = mysqli_query($conn,"SELECT * FROM sc_variants WHERE variant_group='forrasok' AND variant_status='1' order by variant_subgroup ASC;");
if (mysqli_num_rows($res)>0) {
while ($row = mysqli_fetch_array($res)) {
if ($colored==true) {
if ($section=='') {
if ($row['variant_subgroup']=='kiadás') {
$bg = '#31b0d5';
}
else {
$bg = '#ec971f';
}
}
}
else {
$bg = 'transparent';
}
if ($selected==$row['variant_id']) {
$result.= '';
}
else {
if ($section=='kiadás') {
if ($row['variant_subgroup']=='kiadás') $result.= '';
}
elseif ($section=='bevétel') {
if ($row['variant_subgroup']=='bevétel') $result.= '';
}
else {
$result.= '';
}
}
}
return $result;
}
else {
return false;
}
}
function input_kategoria_list($selected='') {
self::dbconnect();
global $conn;
$res = mysqli_query($conn,"SELECT * FROM sc_variants WHERE variant_group='kategoria' AND variant_status='1' order by variant_subgroup ASC;");
if (mysqli_num_rows($res)>0) {
while ($row = mysqli_fetch_array($res)) {
if ($selected==$row['variant_id']) {
$result.= '';
}
else {
$result.= '';
}
}
return $result;
}
else {
return false;
}
}
function input_ugyfel_list($selected='') {
self::dbconnect();
global $conn;
$res = mysqli_query($conn,"SELECT * FROM sc_clients WHERE client_status='1' order by client_name ASC;");
if (mysqli_num_rows($res)>0) {
while ($row = mysqli_fetch_array($res)) {
if ($selected==$row['client_id']) {
$result.= '';
}
else {
$result.= '';
}
}
return $result;
}
else {
return false;
}
}
function input_currency_list($valuta='') {
self::dbconnect();
global $conn;
$res = mysqli_query($conn,"SELECT * FROM sc_variants WHERE variant_group='valutanem' AND variant_status='1' ORDER BY variant_id ASC");
$result = '';
if (mysqli_num_rows($res)>0) {
while ($row = mysqli_fetch_array($res)) {
if ($row['variant_name']==$valuta) {
$result.= '';
}
else {
$result.= '';
}
}
}
return $result;
}
function get_type_name_by_id($type_id) {
self::dbconnect();
global $conn;
if ($type_id!='') {
$res = mysqli_query($conn,"SELECT * FROM sc_variants WHERE variant_id='".$type_id."' AND variant_status<>'0';");
if (mysqli_num_rows($res)>0) {
$sor = mysqli_fetch_array($res);
return $sor['variant_name'];
}
else {
return false;
}
}
else {
return false;
}
}
static function get_category($id) {
self::dbconnect();
global $conn;
$res = mysqli_query($conn,"SELECT * FROM sc_variants WHERE variant_id='".$id."';");
if (mysqli_num_rows($res)>0) {
$row = mysqli_fetch_array($res);
return $row['variant_name'];
}
else {
return false;
}
}
}