Exemple #1
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");
Exemple #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/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");
Exemple #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('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;
Exemple #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('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;
Exemple #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('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;
Exemple #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('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;
Exemple #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();
$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;
        }
    }
Exemple #8
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;
Exemple #9
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;
Exemple #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/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;
Exemple #11
0
require_once '../../../API/libCore/restler.php';
require_once '../../../API/phpClass/Utils.php';
require_once '../../../API/phpClass/Master.php';
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();
Exemple #12
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();
$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;
Exemple #13
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;
Exemple #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();
$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;
        }
    }
Exemple #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();
//$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;
}
Exemple #16
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;
Exemple #17
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();
$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();
$urlMeasure = "http://" . $_SESSION['Server'] . "/API/measure/findall.json?oQtd=10&oOrdem=Measure_ID";
$requestMeasure = $client->get($urlMeasure)->send();
$dataMeasure = $requestMeasure->json();
$urlProductValue = "http://" . $_SESSION['Server'] . "/API/productvalue/findall.json?oQtd=10&oOrdem=Measure_ID";
$requestProductValue = $client->get($urlProductValue)->send();
$dataProductValue = $requestProductValue->json();
$url = "http://" . $_SESSION['Server'] . "/API/product/findall.json?oQtd=10&oOrdem=Product_ID";
$request = $client->get($url)->send();
$data = $request->json();
Exemple #18
0
 /**
  * This method is used for create a Representative
  *
  * @url GET representative/{RepresentativeID}/{ClientID}/{ProviderID}/{name}/{email}/{phone}/{cphone}/{ref}
  */
 public function representative($RepresentativeID, $ClientID, $ProviderID, $name, $email = "null", $phone = "null", $cphone = "null", $ref = "null")
 {
     $Utils = new Utils();
     $Client = new Client();
     $Provider = new Provider();
     if ($Client->findClient($ClientID) && $Provider->findProvider($ProviderID)) {
         $Representative = new Representative();
         /* Formantando Telefone */
         if (strpos($phone, '(') !== false && strpos($phone, ')') !== false && strpos($phone, ' ') !== false && strpos($phone, '-') !== false) {
             $phoneArr = $Utils->phoneFormatMysql($phone);
             $phone = $phoneArr['DDD'] . $phoneArr['Phone'];
         }
         if (strpos($cphone, '(') !== false && strpos($cphone, ')') !== false && strpos($cphone, ' ') !== false && strpos($cphone, '-') !== false) {
             $cphoneArr = $Utils->phoneFormatMysql($cphone);
             $cphone = $cphoneArr['DDD'] . $cphoneArr['Phone'];
         }
         $Representative->Representative_ID = $RepresentativeID;
         $Representative->Client_ID = $Client->Client_ID;
         $Representative->Provider_ID = $Provider->Provider_ID;
         $Representative->Name = $name;
         $Representative->Email = $email;
         $Representative->Phone = $phone;
         $Representative->CPhone = $cphone;
         $Representative->Ref = $ref;
         if ($Representative->gravarDados()) {
             return array('Success' => true, "Msg" => "Representative has been alter");
         }
         return array('Success' => false, "Msg" => "Can't alter representative");
     }
     return array('Success' => false, "Msg" => "Client Or Provider not found");
 }
Exemple #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/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;
Exemple #20
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;
Exemple #21
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();
$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);
Exemple #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();
//$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;
}
Exemple #23
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;