www
/
wwwroot
/
itechgalaxy.ro
/
apps
➕ New
📤 Upload
✎ Editing:
api.php
← Back
<?php include('../config.php'); include("../includes/config.inc.php"); if(isset($_GET['api']) && $_GET['key'] == settings('api_key')){ if(isset($_GET['action']) && $_GET['action'] == 'items'){ $items = $database->select($_GET['data']); $item = array(); while($row = $database->fetch($items)){ $item[] = $row; } echo json_encode($item); }else if(isset($_GET['action']) && $_GET['action'] == 'items_cat'){ $cats = $database->select($_GET['data']); $cat = array(); while($row = $database->fetch($cats)){ $cat[] = $row; } echo json_encode($cat); }else if(isset($_GET['action']) && $_GET['action'] == 'get_users'){ $cats = $database->select($_GET['data']); $cat = array(); while($row = $database->fetch($cats)){ $cat[] = $row; } echo json_encode($cat); }else if(isset($_GET['action']) && $_GET['action'] == 'cart_get_item'){ $cats = $database->select($_GET['data']); $cat = array(); while($row = $database->fetch($cats)){ $cat[] = $row; } echo json_encode($cat); }else if(isset($_GET['action']) && $_GET['action'] == 'cart_check_exist'){ $cats = $database->select($_GET['data']); $cat = array(); while($row = $database->fetch($cats)){ $cat[] = $row; } echo json_encode($cat); }else if(isset($_GET['action']) && $_GET['action'] == 'add_to_cart'){ $cats = $database->execute($_GET['data']); $json = array(); if($cats['status'] == 1){ $json['status'] = 1; }else{ $json['status'] = 0; $json['error'] = $cats['error']; } echo json_encode($json); }else if(isset($_GET['action']) && $_GET['action'] == 'get_ticket_items'){ $cats = $database->select($_GET['data']); $cat = array(); while($row = $database->fetch($cats)){ $cat[] = $row; } echo json_encode($cat); }else if(isset($_GET['action']) && $_GET['action'] == 'valid_vat'){ require_once("../lib/itrackANAF/vendor/autoload.php"); $json = array(); // Get data about more CIF $anaf = new \Itrack\Anaf\Client(); if($anaf){ $anaf->addCif($_GET['vat']); $company = $anaf->first(); $json['name'] = $company->getName(); $json['cif'] = $company->getCIF(); $json['reg_com'] = $company->getRegCom(); $json['phone'] = $company->getPhone(); $json['address'] = $company->getAddress()->getCounty(); $json['country'] = $company->getAddress()->getCounty(); $json['city'] = $company->getAddress()->getCity(); $json['street'] = $company->getAddress()->getStreet(); $json['street_nr'] = $company->getAddress()->getStreetNumber(); } echo json_encode($json); } }
💾 Save Changes
Cancel
📤 Upload File
×
Select File
Upload
Cancel
➕ Create New
×
Type
📄 File
📁 Folder
Name
Create
Cancel
✎ Rename Item
×
Current Name
New Name
Rename
Cancel
🔐 Change Permissions
×
Target File
Permission (e.g., 0755, 0644)
0755
0644
0777
Apply
Cancel