API code style tidy
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
require('../validate_api_key.php');
|
|
||||||
|
|
||||||
require('../require_post_method.php');
|
require_once('../validate_api_key.php');
|
||||||
|
require_once('../require_post_method.php');
|
||||||
|
|
||||||
// Parse info
|
// Parse info
|
||||||
|
|
||||||
@@ -88,7 +88,7 @@ if(isset($_POST['asset_network_id'])){
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Default
|
// Default
|
||||||
$insert_id = FALSE;
|
$insert_id = false;
|
||||||
|
|
||||||
if (!empty($name) && !empty($client_id)) {
|
if (!empty($name) && !empty($client_id)) {
|
||||||
// Insert into Database
|
// Insert into Database
|
||||||
@@ -104,4 +104,4 @@ if(!empty($name) && !empty($client_id)){
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Output
|
// Output
|
||||||
include('../create_output.php');
|
require_once('../create_output.php');
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
<?php
|
<?php
|
||||||
require('../validate_api_key.php');
|
require_once('../validate_api_key.php');
|
||||||
|
|
||||||
require('../require_post_method.php');
|
require_once('../require_post_method.php');
|
||||||
|
|
||||||
// Parse ID
|
// Parse ID
|
||||||
$asset_id = intval($_POST['asset_id']);
|
$asset_id = intval($_POST['asset_id']);
|
||||||
|
|
||||||
// Default
|
// Default
|
||||||
$delete_count = FALSE;
|
$delete_count = false;
|
||||||
|
|
||||||
if (!empty($asset_id)) {
|
if (!empty($asset_id)) {
|
||||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT * FROM assets WHERE asset_id = $asset_id AND asset_client_id = $client_id AND company_id = '$company_id' LIMIT 1"));
|
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT * FROM assets WHERE asset_id = $asset_id AND asset_client_id = $client_id AND company_id = '$company_id' LIMIT 1"));
|
||||||
@@ -25,4 +25,4 @@ if(!empty($asset_id)){
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Output
|
// Output
|
||||||
include('../delete_output.php');
|
require_once('../delete_output.php');
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
require('../validate_api_key.php');
|
|
||||||
|
|
||||||
require('../require_get_method.php');
|
require_once('../validate_api_key.php');
|
||||||
|
require_once('../require_get_method.php');
|
||||||
|
|
||||||
// Asset via ID (single)
|
// Asset via ID (single)
|
||||||
if (isset($_GET['asset_id'])) {
|
if (isset($_GET['asset_id'])) {
|
||||||
@@ -39,4 +39,4 @@ else{
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Output
|
// Output
|
||||||
include("../read_output.php");
|
require_once("../read_output.php");
|
||||||
@@ -1,13 +1,13 @@
|
|||||||
<?php
|
<?php
|
||||||
require('../validate_api_key.php');
|
|
||||||
|
|
||||||
require('../require_post_method.php');
|
require_once('../validate_api_key.php');
|
||||||
|
require_once('../require_post_method.php');
|
||||||
|
|
||||||
// Parse ID
|
// Parse ID
|
||||||
$asset_id = intval($_POST['asset_id']);
|
$asset_id = intval($_POST['asset_id']);
|
||||||
|
|
||||||
// Default
|
// Default
|
||||||
$update_count = FALSE;
|
$update_count = false;
|
||||||
|
|
||||||
if (!empty($asset_id)) {
|
if (!empty($asset_id)) {
|
||||||
|
|
||||||
@@ -113,4 +113,4 @@ if(!empty($asset_id)){
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Output
|
// Output
|
||||||
include('../update_output.php');
|
require_once('../update_output.php');
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
require('../validate_api_key.php');
|
|
||||||
|
|
||||||
require('../require_get_method.php');
|
require_once('../validate_api_key.php');
|
||||||
|
require_once('../require_get_method.php');
|
||||||
|
|
||||||
// Specific certificate via ID (single)
|
// Specific certificate via ID (single)
|
||||||
if (isset($_GET['certificate_id'])) {
|
if (isset($_GET['certificate_id'])) {
|
||||||
@@ -27,4 +27,4 @@ else{
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Output
|
// Output
|
||||||
include("../read_output.php");
|
require_once("../read_output.php");
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
require('../validate_api_key.php');
|
|
||||||
|
|
||||||
require('../require_get_method.php');
|
require_once('../validate_api_key.php');
|
||||||
|
require_once('../require_get_method.php');
|
||||||
|
|
||||||
// Specific client via ID (single)
|
// Specific client via ID (single)
|
||||||
if (isset($_GET['client_id'])) {
|
if (isset($_GET['client_id'])) {
|
||||||
@@ -21,4 +21,4 @@ else{
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Output
|
// Output
|
||||||
include("../read_output.php");
|
require_once("../read_output.php");
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
<?php
|
<?php
|
||||||
require('../validate_api_key.php');
|
|
||||||
|
|
||||||
require('../require_post_method.php');
|
require_once('../validate_api_key.php');
|
||||||
|
require_once('../require_post_method.php');
|
||||||
|
|
||||||
// Parse Info
|
// Parse Info
|
||||||
include('contact_model.php');
|
require_once('contact_model.php');
|
||||||
|
|
||||||
// Default
|
// Default
|
||||||
$insert_id = FALSE;
|
$insert_id = FALSE;
|
||||||
@@ -31,4 +31,4 @@ if(!empty($name) && !empty($email) && !empty($client_id)){
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Output
|
// Output
|
||||||
include('../create_output.php');
|
require_once('../create_output.php');
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
require('../validate_api_key.php');
|
|
||||||
|
|
||||||
require('../require_post_method.php');
|
require_once('../validate_api_key.php');
|
||||||
|
require_once('../require_post_method.php');
|
||||||
|
|
||||||
// Parse ID
|
// Parse ID
|
||||||
$contact_id = intval($_POST['contact_id']);
|
$contact_id = intval($_POST['contact_id']);
|
||||||
@@ -25,4 +25,4 @@ if(!empty($contact_id)){
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Output
|
// Output
|
||||||
include('../delete_output.php');
|
require_once('../delete_output.php');
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
require('../validate_api_key.php');
|
|
||||||
|
|
||||||
require('../require_get_method.php');
|
require_once('../validate_api_key.php');
|
||||||
|
require_once('../require_get_method.php');
|
||||||
|
|
||||||
// Specific contact via ID (single)
|
// Specific contact via ID (single)
|
||||||
if (isset($_GET['contact_id'])) {
|
if (isset($_GET['contact_id'])) {
|
||||||
@@ -21,4 +21,4 @@ else{
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Output
|
// Output
|
||||||
include("../read_output.php");
|
require_once("../read_output.php");
|
||||||
@@ -1,11 +1,11 @@
|
|||||||
<?php
|
<?php
|
||||||
require('../validate_api_key.php');
|
|
||||||
|
|
||||||
require('../require_post_method.php');
|
require_once('../validate_api_key.php');
|
||||||
|
require_once('../require_post_method.php');
|
||||||
|
|
||||||
// Parse Info
|
// Parse Info
|
||||||
$contact_id = intval($_POST['contact_id']);
|
$contact_id = intval($_POST['contact_id']);
|
||||||
include('contact_model.php');
|
require_once('contact_model.php');
|
||||||
|
|
||||||
// Default
|
// Default
|
||||||
$update_count = FALSE;
|
$update_count = FALSE;
|
||||||
@@ -25,4 +25,4 @@ if(!empty($name) && !empty($email)){
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Output
|
// Output
|
||||||
include('../update_output.php');
|
require_once('../update_output.php');
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
require('../validate_api_key.php');
|
|
||||||
|
|
||||||
require('../require_get_method.php');
|
require_once('../validate_api_key.php');
|
||||||
|
require_once('../require_get_method.php');
|
||||||
|
|
||||||
// Specific domain via ID (single)
|
// Specific domain via ID (single)
|
||||||
if (isset($_GET['domain_id'])) {
|
if (isset($_GET['domain_id'])) {
|
||||||
@@ -27,4 +27,4 @@ else{
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Output
|
// Output
|
||||||
include("../read_output.php");
|
require_once("../read_output.php");
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
require('../validate_api_key.php');
|
|
||||||
|
|
||||||
require('../require_get_method.php');
|
require_once('../validate_api_key.php');
|
||||||
|
require_once('../require_get_method.php');
|
||||||
|
|
||||||
// Specific network via ID (single)
|
// Specific network via ID (single)
|
||||||
if (isset($_GET['network_id'])) {
|
if (isset($_GET['network_id'])) {
|
||||||
@@ -27,4 +27,4 @@ else{
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Output
|
// Output
|
||||||
include("../read_output.php");
|
require_once("../read_output.php");
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
require('../validate_api_key.php');
|
|
||||||
|
|
||||||
require('../require_get_method.php');
|
require_once('../validate_api_key.php');
|
||||||
|
require_once('../require_get_method.php');
|
||||||
|
|
||||||
// Specific software via ID (single)
|
// Specific software via ID (single)
|
||||||
if (isset($_GET['software_id'])) {
|
if (isset($_GET['software_id'])) {
|
||||||
@@ -39,4 +39,4 @@ else{
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Output
|
// Output
|
||||||
include("../read_output.php");
|
require_once("../read_output.php");
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
require('../validate_api_key.php');
|
|
||||||
|
|
||||||
require('../require_get_method.php');
|
require_once('../validate_api_key.php');
|
||||||
|
require_once('../require_get_method.php');
|
||||||
|
|
||||||
// Specific ticket via ID (single)
|
// Specific ticket via ID (single)
|
||||||
if (isset($_GET['ticket_id'])) {
|
if (isset($_GET['ticket_id'])) {
|
||||||
@@ -15,4 +15,4 @@ else{
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Output
|
// Output
|
||||||
include("../read_output.php");
|
require_once("../read_output.php");
|
||||||
@@ -7,8 +7,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
// Includes
|
// Includes
|
||||||
include( __DIR__ . '../../../functions.php');
|
require_once( __DIR__ . '../../../functions.php');
|
||||||
include(__DIR__ . "../../../config.php");
|
require_once(__DIR__ . "../../../config.php");
|
||||||
|
|
||||||
// JSON header
|
// JSON header
|
||||||
header('Content-Type: application/json');
|
header('Content-Type: application/json');
|
||||||
|
|||||||
Reference in New Issue
Block a user