예제 #1
0
$u = new Utils();
$urlProvider = "http://" . $_SESSION['Server'] . "/API/provider/findall.json?oQtd=10&oOrdem=Provider_ID";
$requestProvider = $client->get($urlProvider)->send();
$dataProvider = $requestProvider->json();
$url = "http://" . $_SESSION['Server'] . "/API/representative/findall.json?oQtd=10&oOrdem=Representative_ID";
$request = $client->get($url)->send();
$data = $request->json();
$oData = array();
$listData = array();
$listaDataProvider = array();
if (count($data) > 0) {
    foreach ($data as $row) {
        if ($row['Client_ID'] == $_SESSION["ClientID"]) {
            $listData[] = $row;
        }
        if ($row['Representative_ID'] == $u->getForm("id")) {
            $oData = $row;
        }
    }
} else {
    $listData = array();
    $oData = 0;
}
if (count($dataProvider) > 0) {
    foreach ($dataProvider as $rowProvider) {
        if ($rowProvider['Client_ID'] == $_SESSION["ClientID"]) {
            $listaDataProvider[] = $rowProvider;
        }
    }
} else {
    $listaDataProvider = array();
예제 #2
0
<?php

namespace Admin;

include '../../check.php';
require_once '../../../API/libCore/restler.php';
require_once '../../../API/phpClass/Utils.php';
require_once '../../../API/libCore/guzzle/guzzle/src/Guzzle/Http/Client.php';
use Luracast\Restler\Restler;
use phpClass\Utils;
use Guzzle\Http\Client;
$client = new Client();
$u = new Utils();
if ($u->getForm('Client_ID') && $u->getForm('Client_ID') > 0 && $u->getForm('Client_ID') != "") {
    if ($u->getForm('id') && $u->getForm('id') > 0 && $u->getForm('id') != "") {
        $apiUrl = 'http://' . $_SESSION['Server'] . '/API/alter/operator.json/' . $u->getForm('id') . "/" . $u->getForm('Client_ID') . "/" . $u->getForm('Login') . "/" . $u->getForm('Password') . "/" . $u->getForm('Name') . "/" . $u->getForm('Phone') . "/" . $u->getForm('CPhone') . "/" . $u->getForm('Email');
    } else {
        $apiUrl = 'http://' . $_SESSION['Server'] . '/API/create/operator.json/' . $u->getForm('Client_ID') . "/" . $u->getForm('Login') . "/" . $u->getForm('Password') . "/" . $u->getForm('Name') . "/" . $u->getForm('Phone') . "/" . $u->getForm('CPhone') . "/" . $u->getForm('Email');
    }
    //var_dump($apiUrl);
    //die();
    $request = $client->get($apiUrl)->send();
    $data = $request->json();
    if ($data['Success']) {
        header("Location: index.php?suc=1");
        exit;
    }
    header("Location: index.php?suc=1");
    exit;
}
header("Location: index.php?suc=0");
예제 #3
0
<?php

namespace Admin;

include '../../check.php';
require_once '../../../API/libCore/restler.php';
require_once '../../../API/phpClass/Utils.php';
require_once '../../../API/libCore/guzzle/guzzle/src/Guzzle/Http/Client.php';
use Luracast\Restler\Restler;
use phpClass\Utils;
use Guzzle\Http\Client;
$client = new Client();
$u = new Utils();
if ($u->getForm('Client_ID') && $u->getForm('Client_ID') > 0 && $u->getForm('Client_ID') != "") {
    if ($u->getForm('id') && $u->getForm('id') > 0 && $u->getForm('id') != "") {
        $apiUrl = 'http://' . $_SESSION['Server'] . '/API/alter/product.json/' . $u->getForm('id') . "/" . $u->getForm('Client_ID') . "/" . $u->getForm('Lot_ID') . "/" . $u->getForm('Measure_ID') . "/" . $u->getForm('Category') . "/" . $u->getForm('Name') . "/" . $u->getForm('Quantity');
    } else {
        $apiUrl = 'http://' . $_SESSION['Server'] . '/API/create/product.json/' . $u->getForm('Client_ID') . "/" . $u->getForm('Lot_ID') . "/" . $u->getForm('Measure_ID') . "/" . $u->getForm('Category') . "/" . $u->getForm('Name') . "/" . $u->getForm('Quantity');
    }
    $request = $client->get($apiUrl)->send();
    $data = $request->json();
    if (!$u->getForm('price') || $u->getForm('price') != $u->getForm('oldPrice')) {
        $apiUrl2 = 'http://' . $_SESSION['Server'] . '/API/create/productvalue.json/' . $u->getForm('Client_ID') . "/" . $data['Product_ID'] . "/" . str_replace('R$ ', '', $u->getForm('price'));
        $request = $client->get($apiUrl2)->send();
        $data2 = $request->json();
    }
    if ($data['Success']) {
        header("Location: index.php?suc=1");
        exit;
    }
    header("Location: index.php?suc=1");
예제 #4
0
<?php

namespace Admin;

include '../../check.php';
require_once '../../../API/libCore/restler.php';
require_once '../../../API/phpClass/Utils.php';
require_once '../../../API/libCore/guzzle/guzzle/src/Guzzle/Http/Client.php';
use Luracast\Restler\Restler;
use phpClass\Utils;
use Guzzle\Http\Client;
$client = new Client();
$u = new Utils();
if ($u->getForm('id') && $u->getForm('id') > 0 && $u->getForm('id') != "") {
    $apiUrl = 'http://' . $_SESSION['Server'] . '/API/operator/deletaOperator.json/' . $u->getForm('id');
    $request = $client->get($apiUrl)->send();
    $data = $request->json();
}
if ($data) {
    header("Location: index.php?suc=2");
    exit;
}
header("Location: index.php?suc=3");
exit;
예제 #5
0
<?php

namespace Admin;

include '../../check.php';
require_once '../../../API/libCore/restler.php';
require_once '../../../API/phpClass/Utils.php';
require_once '../../../API/libCore/guzzle/guzzle/src/Guzzle/Http/Client.php';
use Luracast\Restler\Restler;
use phpClass\Utils;
use Guzzle\Http\Client;
$client = new Client();
$u = new Utils();
if ($u->getForm('Client_ID') && $u->getForm('Client_ID') > 0 && $u->getForm('Client_ID') != "") {
    $i = 0;
    while ($i < $u->getForm('Quantity')) {
        $apiUrl = 'http://' . $_SESSION['Server'] . '/API/create/inventory.json/' . $u->getForm('Client_ID') . "/" . $u->getForm('Product_ID') . "/" . $u->getForm('Codebar') . "/1";
        $request = $client->get($apiUrl)->send();
        $data = $request->json();
        if ($data['Success']) {
            //echo "Location: index.php?suc=1";
            //exit();
        }
        $i++;
    }
    echo "Success";
    exit;
}
echo "Error";
exit;
예제 #6
0
<?php

namespace Admin;

include '../../check.php';
require_once '../../../API/libCore/restler.php';
require_once '../../../API/phpClass/Utils.php';
require_once '../../../API/libCore/guzzle/guzzle/src/Guzzle/Http/Client.php';
use Luracast\Restler\Restler;
use phpClass\Utils;
use Guzzle\Http\Client;
$client = new Client();
$u = new Utils();
if ($u->getForm('id') && $u->getForm('id') > 0 && $u->getForm('id') != "") {
    $apiUrl = 'http://' . $_SESSION['Server'] . '/API/product/deletaProduct.json/' . $u->getForm('id');
    echo $apiUrl;
    $request = $client->get($apiUrl)->send();
    $data = $request->json();
}
if ($data) {
    header("Location: index.php?suc=2");
    exit;
}
header("Location: index.php?suc=3");
exit;
예제 #7
0
<?php

namespace Admin;

include '../../check.php';
require_once '../../../API/libCore/restler.php';
require_once '../../../API/phpClass/Utils.php';
require_once '../../../API/libCore/guzzle/guzzle/src/Guzzle/Http/Client.php';
use Luracast\Restler\Restler;
use phpClass\Utils;
use Guzzle\Http\Client;
$client = new Client();
$u = new Utils();
if ($u->getForm('Client_ID') && $u->getForm('Client_ID') > 0 && $u->getForm('Client_ID') != "") {
    if ($u->getForm('id') && $u->getForm('id') > 0 && $u->getForm('id') != "") {
        $apiUrl = 'http://' . $_SESSION['Server'] . '/API/alter/command.json/' . $u->getForm('id') . '/' . $u->getForm('Client_ID') . '/' . $u->getForm('Ref') . '/' . $u->getForm('Code') . '';
    } else {
        $apiUrl = 'http://' . $_SESSION['Server'] . '/API/create/command.json/' . $u->getForm('Client_ID') . '/' . $u->getForm('Ref') . '/' . $u->getForm('Code') . '';
    }
    $request = $client->get($apiUrl)->send();
    $data = $request->json();
    if ($data['Success']) {
        header("Location: index.php?suc=1");
        exit;
    }
    header("Location: index.php?suc=1");
    exit;
}
header("Location: index.php?suc=0");
exit;
예제 #8
0
$u = new Utils();
$urlProvider = "http://" . $_SESSION['Server'] . "/API/provider/findall.json?oQtd=10&oOrdem=Provider_ID";
$requestProvider = $client->get($urlProvider)->send();
$dataProvider = $requestProvider->json();
$url = "http://" . $_SESSION['Server'] . "/API/lot/findall.json?oQtd=10&oOrdem=Lot_ID";
$request = $client->get($url)->send();
$data = $request->json();
$oData = array();
$listData = array();
$listDataProvider = array();
if (count($data) > 0) {
    foreach ($data as $row) {
        if ($row['Client_ID'] == $_SESSION["ClientID"]) {
            $listData[] = $row;
        }
        if ($row['Lot_ID'] == $u->getForm("id")) {
            $oData = $row;
        }
    }
} else {
    $oData = 0;
}
if (count($dataProvider) > 0) {
    foreach ($dataProvider as $rowProvider) {
        if ($rowProvider['Client_ID'] == $_SESSION["ClientID"]) {
            $listaDataProvider[] = $rowProvider;
        }
    }
} else {
    $listaDataProvider = array();
}
예제 #9
0
include '../../check.php';
require_once '../../../API/libCore/restler.php';
require_once '../../../API/phpClass/Utils.php';
require_once '../../../API/libCore/guzzle/guzzle/src/Guzzle/Http/Client.php';
use Luracast\Restler\Restler;
use phpClass\Utils;
use Guzzle\Http\Client;
$client = new Client();
$u = new Utils();
//$url="http://imac.syconline.com.br/API/product/findall.json?oQtd=10&oOrdem=Product_ID";
$url = "http://" . $_SESSION['Server'] . "/API/provider/findall.json?oQtd=10&oOrdem=Provider_ID";
$request = $client->get($url)->send();
$data = $request->json();
$oData = array();
$listData = array();
if (count($data) > 0) {
    foreach ($data as $row) {
        if ($row['Client_ID'] == $_SESSION["ClientID"]) {
            $listData[] = $row;
        }
        if ($row['Provider_ID'] == $u->getForm("id")) {
            $oData = $row;
        }
    }
} else {
    $oData = 0;
}
unset($data);
$data = $listData;
$title = "SyCON | Fornecedor";
$module = "Fornecedores";
예제 #10
0
<?php

namespace Admin;

include '../../check.php';
require_once '../../../API/libCore/restler.php';
require_once '../../../API/phpClass/Utils.php';
require_once '../../../API/libCore/guzzle/guzzle/src/Guzzle/Http/Client.php';
use Luracast\Restler\Restler;
use phpClass\Utils;
use Guzzle\Http\Client;
$client = new Client();
$u = new Utils();
if ($u->getForm('Client_ID') && $u->getForm('Client_ID') > 0 && $u->getForm('Client_ID') != "") {
    if ($u->getForm('id') && $u->getForm('id') > 0 && $u->getForm('id') != "") {
        $apiUrl = 'http://' . $_SESSION['Server'] . '/API/alter/lot.json/' . $u->getForm('id') . "/" . $u->getForm('Client_ID') . "/" . $u->getForm('Provider_ID') . "/" . $u->getForm('Code') . "/" . $u->getForm('Date') . "/" . $u->getForm('Manufacture') . "/" . $u->getForm('Maturity');
    } else {
        $apiUrl = 'http://' . $_SESSION['Server'] . '/API/create/lot.json/' . $u->getForm('Client_ID') . "/" . $u->getForm('Provider_ID') . "/" . $u->getForm('Code') . "/" . $u->getForm('Date') . "/" . $u->getForm('Manufacture') . "/" . $u->getForm('Maturity');
    }
    $request = $client->get($apiUrl)->send();
    $data = $request->json();
    if ($data['Success']) {
        header("Location: index.php?suc=1");
        exit;
    }
    header("Location: index.php?suc=1");
    exit;
}
header("Location: index.php?suc=0");
exit;
예제 #11
0
<?php

namespace Admin;

include '../../check.php';
require_once '../../../API/libCore/restler.php';
require_once '../../../API/phpClass/Utils.php';
require_once '../../../API/libCore/guzzle/guzzle/src/Guzzle/Http/Client.php';
use Luracast\Restler\Restler;
use phpClass\Utils;
use Guzzle\Http\Client;
$client = new Client();
$u = new Utils();
if ($u->getForm('Client_ID') && $u->getForm('Client_ID') > 0 && $u->getForm('Client_ID') != "") {
    if ($u->getForm('id') && $u->getForm('id') > 0 && $u->getForm('id') != "") {
        $apiUrl = 'http://' . $_SESSION['Server'] . '/API/alter/customer.json/' . $u->getForm('id') . "/" . $u->getForm('Client_ID') . "/" . $u->getForm('Number') . "/" . $u->getForm('Category') . "/" . $u->getForm('Points') . "/" . $u->getForm('Name') . "/" . $u->getForm('Email') . "/" . $u->getForm('Phone') . "/" . $u->getForm('CPhone');
    } else {
        $apiUrl = 'http://' . $_SESSION['Server'] . '/API/create/customer.json/' . $u->getForm('Client_ID') . "/" . $u->getForm('Number') . "/" . $u->getForm('Category') . "/" . $u->getForm('Points') . "/" . $u->getForm('Name') . "/" . $u->getForm('Email') . "/" . $u->getForm('Phone') . "/" . $u->getForm('CPhone');
    }
    $request = $client->get($apiUrl)->send();
    $data = $request->json();
    if ($data['Success']) {
        header("Location: index.php?suc=1");
        exit;
    }
    header("Location: index.php?suc=1");
    exit;
}
header("Location: index.php?suc=0");
exit;
예제 #12
0
require_once '../../../API/phpClass/Recordset.php';
require_once '../../../API/phpClass/Generated/Inventory.php';
require_once '../../../API/phpClass/Generated/Category.php';
require_once '../../../API/libCore/guzzle/guzzle/src/Guzzle/Http/Client.php';
use Luracast\Restler\Restler;
use phpClass\Utils;
use phpClass\Master;
use phpClass\Recordset;
use phpClass\Generated\Inventory;
use phpClass\Generated\Category;
use Guzzle\Http\Client;
$client = new Client();
$u = new Utils();
$inv = new Inventory();
$cat = new Category();
if ($u->getForm('Product')) {
    header("Location: edit.php?id=" . $u->getForm('Product'));
    exit;
}
$urlInventory = "http://" . $_SESSION['Server'] . "/API/inventory/findall.json?oQtd=1000&oOrdem=Provider_ID";
$requestInventory = $client->get($urlInventory)->send();
$dataInventory = $requestInventory->json();
$urlCategory = "http://" . $_SESSION['Server'] . "/API/category/findall.json?oQtd=1000&oOrdem=Provider_ID";
$requestCategory = $client->get($urlCategory)->send();
$dataCategory = $requestCategory->json();
$urlProvider = "http://" . $_SESSION['Server'] . "/API/provider/findall.json?oQtd=1000&oOrdem=Provider_ID";
$requestProvider = $client->get($urlProvider)->send();
$dataProvider = $requestProvider->json();
$urlLot = "http://" . $_SESSION['Server'] . "/API/lot/findall.json?oQtd=1000&oOrdem=Lot_ID";
$requestLot = $client->get($urlLot)->send();
$dataLot = $requestLot->json();
예제 #13
0
namespace Admin;

include '../../check.php';
require_once '../../../API/libCore/restler.php';
require_once '../../../API/phpClass/Utils.php';
require_once '../../../API/libCore/guzzle/guzzle/src/Guzzle/Http/Client.php';
use Luracast\Restler\Restler;
use phpClass\Utils;
use Guzzle\Http\Client;
$client = new Client();
$u = new Utils();
$request = $client->get('http://' . $_SESSION['Server'] . '/API/commands/findall.json?oQtd=10&oOrdem=Commands_ID')->send();
$data = $request->json();
$oData = array();
$listData = array();
if (count($data) > 0) {
    foreach ($data as $row) {
        if ($row['Client_ID'] == $_SESSION["ClientID"]) {
            $listData[] = $row;
        }
        if ($row['Commands_ID'] == $u->getForm("id")) {
            $oData = $row;
        }
    }
} else {
    $oData = 0;
}
unset($data);
$data = $listData;
$title = "SyCON | Commands";
$module = "Commands";
예제 #14
0
<?php

namespace Admin;

include '../../check.php';
require_once '../../../API/libCore/restler.php';
require_once '../../../API/phpClass/Utils.php';
require_once '../../../API/libCore/guzzle/guzzle/src/Guzzle/Http/Client.php';
use Luracast\Restler\Restler;
use phpClass\Utils;
use Guzzle\Http\Client;
$client = new Client();
$u = new Utils();
if ($u->getForm('id') && $u->getForm('id') > 0 && $u->getForm('id') != "") {
    $apiUrl = 'http://' . $_SESSION['Server'] . '/API/commands/deletaCommands.json/' . $u->getForm('id');
    $request = $client->get($apiUrl)->send();
    $data = $request->json();
}
if ($data) {
    header("Location: index.php?suc=2");
    exit;
}
header("Location: index.php?suc=3");
exit;
예제 #15
0
<?php

namespace Admin;

include '../../check.php';
require_once '../../../API/libCore/restler.php';
require_once '../../../API/phpClass/Utils.php';
require_once '../../../API/libCore/guzzle/guzzle/src/Guzzle/Http/Client.php';
use Luracast\Restler\Restler;
use phpClass\Utils;
use Guzzle\Http\Client;
$client = new Client();
$u = new Utils();
if ($u->getForm('Client_ID') && $u->getForm('Client_ID') > 0 && $u->getForm('Client_ID') != "") {
    if ($u->getForm('id') && $u->getForm('id') > 0 && $u->getForm('id') != "") {
        $apiUrl = 'http://' . $_SESSION['Server'] . '/API/alter/representative.json/' . $u->getForm('id') . "/" . $u->getForm('Client_ID') . "/" . $u->getForm('Provider') . "/" . $u->getForm('Name') . "/" . $u->getForm('Email') . "/" . $u->getForm('Phone') . "/" . $u->getForm('CPhone') . "/" . $u->getForm('Ref');
    } else {
        $apiUrl = 'http://' . $_SESSION['Server'] . '/API/create/representative.json/' . $u->getForm('Client_ID') . "/" . $u->getForm('Provider') . "/" . $u->getForm('Name') . "/" . $u->getForm('Email') . "/" . $u->getForm('Phone') . "/" . $u->getForm('CPhone') . "/" . $u->getForm('Ref');
    }
    $request = $client->get($apiUrl)->send();
    $data = $request->json();
    if ($data['Success']) {
        header("Location: index.php?suc=1");
        exit;
    }
    header("Location: index.php?suc=1");
    exit;
}
header("Location: index.php?suc=0");
exit;
예제 #16
0
$url = "http://" . $_SESSION['Server'] . "/API/product/findall.json?oQtd=10&oOrdem=Product_ID";
$request = $client->get($url)->send();
$data = $request->json();
$oData = array();
$listData = array();
$listDataLot = array();
$listDataCategory = array();
$listDataProvider = array();
$homeProvider = 0;
$homeLot = 0;
if (count($data) > 0) {
    foreach ($data as $row) {
        if ($row['Client_ID'] == $_SESSION["ClientID"]) {
            $listData[] = $row;
        }
        if ($row['Product_ID'] == $u->getForm("id")) {
            $oData = $row;
        }
    }
} else {
    $oData = 0;
}
if (!empty($oData)) {
    foreach ($dataProductValue as $row) {
        if ($row['Product_ID'] == $oData['Product_ID']) {
            $oData['price'] = $row['Value'];
        }
    }
}
if (count($dataProvider) > 0) {
    foreach ($dataProvider as $rowProvider) {
예제 #17
0
<?php

namespace Admin;

require_once '../../API/libCore/restler.php';
require_once '../../API/phpClass/Utils.php';
require_once '../../API/libCore/guzzle/guzzle/src/Guzzle/Http/Client.php';
use Luracast\Restler\Restler;
use phpClass\Utils;
use Guzzle\Http\Client;
$client = new Client();
$u = new Utils();
// Issue a path using a relative URL to the client's base URL
// Sends to http://www.example.com/api/v1/key/***/users
if (!$u->getForm('login') || !$u->getForm('password')) {
    header("Location: ../login.html?err=1");
    exit;
}
$login = $_POST['login'];
$password = $_POST['password'];
$url = 'http://' . $_SERVER['SERVER_NAME'] . '/API/operator/logonOperator.json/' . $login . '/' . $password;
$request = $client->get($url)->send();
$data = $request->json();
if ($data['Success']) {
    session_start();
    $_SESSION["ClientID"] = $data['Client_ID'];
    $_SESSION["Operator"] = $data['Operator_ID'];
    $_SESSION["OperatorName"] = $data['Name'];
    $_SESSION['Server'] = $_SERVER['SERVER_NAME'];
    header("Location: ../home.php");
    exit;
예제 #18
0
<?php

namespace Admin;

include '../../check.php';
require_once '../../../API/libCore/restler.php';
require_once '../../../API/phpClass/Utils.php';
require_once '../../../API/libCore/guzzle/guzzle/src/Guzzle/Http/Client.php';
use Luracast\Restler\Restler;
use phpClass\Utils;
use Guzzle\Http\Client;
$client = new Client();
$u = new Utils();
if ($u->getForm('id') && $u->getForm('id') > 0 && $u->getForm('id') != "") {
    $apiUrl = 'http://' . $_SESSION['Server'] . '/API/representative/deletaRepresentative.json/' . $u->getForm('id');
    $request = $client->get($apiUrl)->send();
    $data = $request->json();
}
if ($data) {
    header("Location: index.php?suc=2");
    exit;
}
header("Location: index.php?suc=3");
exit;
예제 #19
0
<?php

namespace Admin;

include '../../check.php';
require_once '../../../API/libCore/restler.php';
require_once '../../../API/phpClass/Utils.php';
require_once '../../../API/libCore/guzzle/guzzle/src/Guzzle/Http/Client.php';
use Luracast\Restler\Restler;
use phpClass\Utils;
use Guzzle\Http\Client;
$client = new Client();
$u = new Utils();
if ($u->getForm('id') && $u->getForm('id') > 0 && $u->getForm('id') != "") {
    $apiUrl = 'http://' . $_SESSION['Server'] . '/API/customer/deletaCustomer.json/' . $u->getForm('id');
    $request = $client->get($apiUrl)->send();
    $data = $request->json();
}
if ($data) {
    header("Location: index.php?suc=2");
    exit;
}
header("Location: index.php?suc=3");
exit;
예제 #20
0
include '../../check.php';
require_once '../../../API/libCore/restler.php';
require_once '../../../API/phpClass/Utils.php';
require_once '../../../API/libCore/guzzle/guzzle/src/Guzzle/Http/Client.php';
use Luracast\Restler\Restler;
use phpClass\Utils;
use Guzzle\Http\Client;
$client = new Client();
$u = new Utils();
$url = "http://" . $_SESSION['Server'] . "/API/customer/findall.json?oQtd=10&oOrdem=Provider_ID";
$request = $client->get($url)->send();
$data = $request->json();
$oData = array();
$listData = array();
if (count($data) > 0) {
    foreach ($data as $row) {
        if ($row['Client_ID'] == $_SESSION["ClientID"]) {
            $listData[] = $row;
        }
        if ($row['Customer_ID'] == $u->getForm("id")) {
            $oData = $row;
        }
    }
} else {
    $oData = 0;
}
unset($data);
$data = $listData;
$title = "SyCON | Consumidor";
$module = "Consumidores";
예제 #21
0
include '../../check.php';
require_once '../../../API/libCore/restler.php';
require_once '../../../API/phpClass/Utils.php';
require_once '../../../API/libCore/guzzle/guzzle/src/Guzzle/Http/Client.php';
use Luracast\Restler\Restler;
use phpClass\Utils;
use Guzzle\Http\Client;
$client = new Client();
$u = new Utils();
//$url="http://imac.syconline.com.br/API/product/findall.json?oQtd=10&oOrdem=Product_ID";
$url = "http://" . $_SESSION['Server'] . "/API/operator/findall.json?oQtd=10&oOrdem=Operator_ID";
$request = $client->get($url)->send();
$data = $request->json();
$oData = array();
$listData = array();
if (count($data) > 0) {
    foreach ($data as $row) {
        if ($row['Client_ID'] == $_SESSION["ClientID"]) {
            $listData[] = $row;
        }
        if ($row['Operator_ID'] == $u->getForm("id")) {
            $oData = $row;
        }
    }
} else {
    $listData = 0;
}
unset($data);
$data = $listData;
$title = "SyCON | Operadores";
$module = "Operadores";
예제 #22
0
<?php

namespace Admin;

include '../../check.php';
require_once '../../../API/libCore/restler.php';
require_once '../../../API/phpClass/Utils.php';
require_once '../../../API/libCore/guzzle/guzzle/src/Guzzle/Http/Client.php';
use Luracast\Restler\Restler;
use phpClass\Utils;
use Guzzle\Http\Client;
$client = new Client();
$u = new Utils();
if ($u->getForm('Client_ID') && $u->getForm('Client_ID') > 0 && $u->getForm('Client_ID') != "") {
    if ($u->getForm('id') && $u->getForm('id') > 0 && $u->getForm('id') != "") {
        $apiUrl = 'http://' . $_SESSION['Server'] . '/API/alter/provider.json/' . $u->getForm('id') . "/" . $u->getForm('Client_ID') . "/" . $u->getForm('Name') . "/" . str_replace("/", "#", $u->getForm('Site')) . "/" . $u->getForm('Phone') . "/" . $u->getForm('CPhone') . "/" . $u->getForm('Address');
    } else {
        $apiUrl = 'http://' . $_SESSION['Server'] . '/API/create/provider.json/' . $u->getForm('Client_ID') . "/" . $u->getForm('Name') . "/" . str_replace("/", "#", $u->getForm('Site')) . "/" . $u->getForm('Phone') . "/" . $u->getForm('CPhone') . "/" . $u->getForm('Address');
    }
    $request = $client->get($apiUrl)->send();
    $data = $request->json();
    if ($data['Success']) {
        header("Location: index.php?suc=1");
        exit;
    }
    header("Location: index.php?suc=1");
    exit;
}
header("Location: index.php?suc=0");
exit;