$app->get("/pkGetConsPendingFirmProfile_sysOsbConsultants/", function () use($app) {
    $BLL = $app->getBLLManager()->get('sysOsbConsultantsBLL');
    $headerParams = $app->request()->headers();
    $sort = null;
    if (isset($_GET['sort'])) {
        $sort = $_GET['sort'];
    }
    $order = null;
    if (isset($_GET['order'])) {
        $order = $_GET['order'];
    }
    $rows = 10;
    if (isset($_GET['rows'])) {
        $rows = $_GET['rows'];
    }
    $page = 1;
    if (isset($_GET['page'])) {
        $page = $_GET['page'];
    }
    $filterRules = null;
    if (isset($_GET['filterRules'])) {
        $filterRules = $_GET['filterRules'];
    }
    if (!isset($headerParams['X-Public'])) {
        throw new Exception('rest api "pkGetConsPendingFirmProfile_sysOsbConsultants" end point, X-Public variable not found');
    }
    $pk = $headerParams['X-Public'];
    $resDataGrid = $BLL->getConsPendingFirmProfile(array('page' => $page, 'rows' => $rows, 'sort' => $sort, 'order' => $order, 'pk' => $pk, 'filterRules' => $filterRules));
    $resTotalRowCount = $BLL->getConsPendingFirmProfilertc(array('pk' => $pk));
    //print_r($resTotalRowCount);
    //print_r($resDataGrid['resultSet']);
    $flows = array();
    foreach ($resDataGrid['resultSet'] as $flow) {
        $flows[] = array("company_name" => $flow["company_name"], "username" => $flow["username"], "s_date" => $flow["s_date"], "id" => $flow["id"]);
    }
    $app->response()->header("Content-Type", "application/json");
    $resultArray = array();
    $resultArray['total'] = $resTotalRowCount['resultSet'][0]['count'];
    $resultArray['rows'] = $flows;
    /* $app->contentType('application/json');
       $app->halt(302, '{"error":"Something went wrong"}');
       $app->stop(); */
    $app->response()->body(json_encode($resultArray));
});
$app->get("/pkFillClustersAllianceLists_sysOsbClustersAlliance/", function () use($app) {
    $stripper = $app->getServiceManager()->get('filterChainerCustom');
    $stripChainerFactory = new \Services\Filter\Helper\FilterChainerFactory();
    $BLL = $app->getBLLManager()->get('sysOsbClustersAllianceBLL');
    $headerParams = $app->request()->headers();
    $componentType = 'ddslick';
    if (isset($_GET['component_type'])) {
        $componentType = strtolower(trim($_GET['component_type']));
    }
    if (!isset($headerParams['X-Public'])) {
        throw new Exception('rest api "pkFillClustersAllianceLists_sysOsbClustersAlliance" end point, X-Public variable not found');
    }
    $pk = $headerParams['X-Public'];
    $vLanguageCode = 'tr';
    if (isset($_GET['language_code'])) {
        $stripper->offsetSet('language_code', $stripChainerFactory->get(stripChainers::FILTER_ONLY_LANGUAGE_CODE, $app, $_GET['language_code']));
    }
    $vOsbId = NULL;
    if (isset($_GET['osb_id'])) {
        $stripper->offsetSet('osb_id', $stripChainerFactory->get(stripChainers::FILTER_PARANOID_LEVEL2, $app, $_GET['osb_id']));
    }
    $vClustersId = NULL;
    if (isset($_GET['clusters_id'])) {
        $stripper->offsetSet('clusters_id', $stripChainerFactory->get(stripChainers::FILTER_PARANOID_LEVEL2, $app, $_GET['clusters_id']));
    }
    $stripper->strip();
    if ($stripper->offsetExists('language_code')) {
        $vLanguageCode = $stripper->offsetGet('language_code')->getFilterValue();
    }
    if ($stripper->offsetExists('osb_id')) {
        $vOsbId = $stripper->offsetGet('osb_id')->getFilterValue();
    }
    if ($stripper->offsetExists('clusters_id')) {
        $vClustersId = $stripper->offsetGet('clusters_id')->getFilterValue();
    }
    $resData = $BLL->fillClustersAllianceLists(array('language_code' => $vLanguageCode, 'pk' => $pk, 'osb_id' => $vOsbId, 'clusters_id' => $vClustersId));
    $menus = array();
    $menus[] = array("text" => "Lütfen Seçiniz", "value" => 0, "selected" => true, "imageSrc" => "", "description" => "Lütfen Seçiniz");
    if ($componentType == 'bootstrap') {
        $menus = array();
        foreach ($resData as $menu) {
            $menus[] = array("id" => $menu["id"], "text" => $menu["alliance_name"], "state" => $menu["state_type"], "checked" => false, "attributes" => array("notroot" => true, "active" => $menu["active"], "alliance_type_name" => $menu["alliance_type_name"]));
        }
    } else {
        if ($componentType == 'ddslick') {
            foreach ($resData as $menu) {
                $menus[] = array("text" => $menu["alliance_name"], "value" => intval($menu["id"]), "selected" => false, "description" => $menu["alliance_type_name"]);
            }
        }
    }
    $app->response()->header("Content-Type", "application/json");
    $resultArray = array();
    // $resultArray['total'] = $resTotalRowCount[0]['count'];
    $resultArray['rows'] = $menus;
    if ($componentType == 'bootstrap') {
        $app->response()->body(json_encode($resultArray));
    } else {
        if ($componentType == 'ddslick') {
            $app->response()->body(json_encode($menus));
        }
    }
});
 * @since 25-01-2016
 */
$app->get("/fillMainDefinitions_sysSpecificDefinitions/", function () use($app) {
    $BLL = $app->getBLLManager()->get('sysSpecificDefinitionsBLL');
    $languageCode = 'tr';
    if (isset($_GET['language_code'])) {
        $languageCode = strtolower(trim($_GET['language_code']));
    }
    $componentType = 'ddslick';
    if (isset($_GET['component_type'])) {
        $componentType = strtolower(trim($_GET['component_type']));
    }
    $resCombobox = $BLL->fillMainDefinitions(array('language_code' => $languageCode));
    $menus = array();
    $menus[] = array("text" => "Lütfen Seçiniz", "value" => 0, "selected" => true, "imageSrc" => "", "description" => "Lütfen Seçiniz");
    if ($componentType == 'bootstrap') {
        foreach ($resCombobox as $menu) {
            $menus[] = array("id" => $menu["id"], "text" => $menu["name"], "state" => $menu["state_type"], "checked" => false, "attributes" => array("notroot" => true, "active" => $menu["active"]));
        }
    } else {
        if ($componentType == 'ddslick') {
            foreach ($resCombobox as $menu) {
                $menus[] = array("text" => $menu["name"], "value" => intval($menu["id"]), "selected" => false, "description" => $menu["name_eng"]);
            }
        }
    }
    $app->response()->header("Content-Type", "application/json");
    $app->response()->body(json_encode($menus));
});
/**
 *  * Okan CIRAN
$app->get("/pkInsert_infoUsersVerbal/", function () use($app) {
    $stripper = $app->getServiceManager()->get('filterChainerCustom');
    $stripChainerFactory = new \Services\Filter\Helper\FilterChainerFactory();
    $BLL = $app->getBLLManager()->get('infoUsersVerbalBLL');
    //  $BLLProfile = $app->getBLLManager()->get('infoUsersVerbalBLL');
    $headerParams = $app->request()->headers();
    if (!isset($headerParams['X-Public'])) {
        throw new Exception('rest api "pkInsert_infoUsersVerbal" end point, X-Public variable not found');
    }
    $pk = $headerParams['X-Public'];
    $vLanguageCode = 'tr';
    if (isset($_GET['language_code'])) {
        $stripper->offsetSet('language_code', $stripChainerFactory->get(stripChainers::FILTER_ONLY_LANGUAGE_CODE, $app, $_GET['language_code']));
    }
    $vProfilePublic = 0;
    if (isset($_GET['profile_public'])) {
        $stripper->offsetSet('profile_public', $stripChainerFactory->get(stripChainers::FILTER_ONLY_NUMBER_ALLOWED, $app, $_GET['profile_public']));
    }
    /* $vCountryId = 91;
       if (isset($_GET['country_id'])) {
           $stripper->offsetSet('country_id', $stripChainerFactory->get(stripChainers::FILTER_ONLY_NUMBER_ALLOWED,
                                                   $app,
                                                   $_GET['country_id']));
       } 
       $vCpk = NULL;
       if (isset($_GET['cpk'])) {
           $stripper->offsetSet('cpk', $stripChainerFactory->get(stripChainers::FILTER_PARANOID_LEVEL2, 
                                                           $app, 
                                                           $_GET['cpk']));
       }    
       * 
       */
    $vAbout = NULL;
    if (isset($_GET['about'])) {
        $stripper->offsetSet('about', $stripChainerFactory->get(stripChainers::FILTER_PARANOID_LEVEL2, $app, $_GET['about']));
    }
    $vAboutEng = NULL;
    if (isset($_GET['about_eng'])) {
        $stripper->offsetSet('about_eng', $stripChainerFactory->get(stripChainers::FILTER_PARANOID_LEVEL2, $app, $_GET['about_eng']));
    }
    $vVerbal1Title = NULL;
    if (isset($_GET['verbal1_title'])) {
        $stripper->offsetSet('verbal1_title', $stripChainerFactory->get(stripChainers::FILTER_PARANOID_LEVEL2, $app, $_GET['verbal1_title']));
    }
    $vVerbal1 = NULL;
    if (isset($_GET['verbal1'])) {
        $stripper->offsetSet('verbal1', $stripChainerFactory->get(stripChainers::FILTER_PARANOID_LEVEL2, $app, $_GET['verbal1']));
    }
    $vVerbal2Title = NULL;
    if (isset($_GET['verbal2_title'])) {
        $stripper->offsetSet('verbal2_title', $stripChainerFactory->get(stripChainers::FILTER_PARANOID_LEVEL2, $app, $_GET['verbal2_title']));
    }
    $vVerbal2 = NULL;
    if (isset($_GET['verbal2'])) {
        $stripper->offsetSet('verbal2', $stripChainerFactory->get(stripChainers::FILTER_PARANOID_LEVEL2, $app, $_GET['verbal2']));
    }
    $vVerbal3Title = NULL;
    if (isset($_GET['verbal3_title'])) {
        $stripper->offsetSet('verbal3_title', $stripChainerFactory->get(stripChainers::FILTER_PARANOID_LEVEL2, $app, $_GET['verbal3_title']));
    }
    $vVerbal3 = NULL;
    if (isset($_GET['verbal3'])) {
        $stripper->offsetSet('verbal3', $stripChainerFactory->get(stripChainers::FILTER_PARANOID_LEVEL2, $app, $_GET['verbal3']));
    }
    $vVerbal1TitleEng = NULL;
    if (isset($_GET['verbal1_title_eng'])) {
        $stripper->offsetSet('verbal1_title_eng', $stripChainerFactory->get(stripChainers::FILTER_PARANOID_LEVEL2, $app, $_GET['verbal1_title_eng']));
    }
    $vVerbal1Eng = NULL;
    if (isset($_GET['verbal1_eng'])) {
        $stripper->offsetSet('verbal1_eng', $stripChainerFactory->get(stripChainers::FILTER_PARANOID_LEVEL2, $app, $_GET['verbal1_eng']));
    }
    $vVerbal2TitleEng = NULL;
    if (isset($_GET['verbal2_title_eng'])) {
        $stripper->offsetSet('verbal2_title_eng', $stripChainerFactory->get(stripChainers::FILTER_PARANOID_LEVEL2, $app, $_GET['verbal2_title_eng']));
    }
    $vVerbal2Eng = NULL;
    if (isset($_GET['verbal2_eng'])) {
        $stripper->offsetSet('verbal2_eng', $stripChainerFactory->get(stripChainers::FILTER_PARANOID_LEVEL2, $app, $_GET['verbal2_eng']));
    }
    $vVerbal3TitleEng = NULL;
    if (isset($_GET['verbal3_title_eng'])) {
        $stripper->offsetSet('verbal3_title_eng', $stripChainerFactory->get(stripChainers::FILTER_PARANOID_LEVEL2, $app, $_GET['verbal3_title_eng']));
    }
    $vVerbal3Eng = NULL;
    if (isset($_GET['verbal3_eng'])) {
        $stripper->offsetSet('verbal3_eng', $stripChainerFactory->get(stripChainers::FILTER_PARANOID_LEVEL2, $app, $_GET['verbal3_eng']));
    }
    /*
        $vFoundationYearx = NULL;
        if (isset($_GET['foundation_yearx'])) {
       $stripper->offsetSet('foundation_yearx', $stripChainerFactory->get(stripChainers::FILTER_ONLY_NUMBER_ALLOWED,
                                               $app,
                                               $_GET['foundation_yearx']));
        } 
        $vTaxOffice = NULL;
        if (isset($_GET['tax_office'])) {
        $stripper->offsetSet('tax_office',$stripChainerFactory->get(stripChainers::FILTER_PARANOID_LEVEL2,
                                               $app,
                                               $_GET['tax_office']));
        } 
        $vTaxNo = NULL;
        if (isset($_GET['tax_no'])) {
        $stripper->offsetSet('tax_no',$stripChainerFactory->get(stripChainers::FILTER_PARANOID_LEVEL2,
                                               $app,
                                               $_GET['tax_no']));
        }
        $vFirmName = NULL;
        if (isset($_GET['firm_name'])) {
        $stripper->offsetSet('firm_name',$stripChainerFactory->get(stripChainers::FILTER_PARANOID_LEVEL2,
                                               $app,
                                               $_GET['firm_name']));
        }
        $vFirmNameEng = NULL;
        if (isset($_GET['firm_name_eng'])) {
        $stripper->offsetSet('firm_name_eng',$stripChainerFactory->get(stripChainers::FILTER_PARANOID_LEVEL2,
                                               $app,
                                               $_GET['firm_name_eng']));
        }
        $vFirmNameShort = NULL;
        if (isset($_GET['firm_name_short'])) {
        $stripper->offsetSet('firm_name_short',$stripChainerFactory->get(stripChainers::FILTER_PARANOID_LEVEL2,
                                               $app,
                                               $_GET['firm_name_short']));
        }
        $vFirmNameShortEng = NULL;
        if (isset($_GET['firm_name_short_eng'])) {
        $stripper->offsetSet('firm_name_short_eng',$stripChainerFactory->get(stripChainers::FILTER_PARANOID_LEVEL2,
                                               $app,
                                               $_GET['firm_name_short_eng']));
        }
        $vDescription = NULL;
        if (isset($_GET['description'])) {
        $stripper->offsetSet('description',$stripChainerFactory->get(stripChainers::FILTER_PARANOID_LEVEL2,
                                               $app,
                                               $_GET['description']));
        }
        $vDescriptionEng = NULL;
        if (isset($_GET['description_eng'])) {
        $stripper->offsetSet('description_eng',$stripChainerFactory->get(stripChainers::FILTER_PARANOID_LEVEL2,
                                               $app,
                                               $_GET['description_eng']));
        }
        $vDunsNumber = NULL;
        if (isset($_GET['duns_number'])) {
        $stripper->offsetSet('duns_number',$stripChainerFactory->get(stripChainers::FILTER_PARANOID_LEVEL2,
                                               $app,
                                               $_GET['duns_number']));
        }
        $vSgkSicilNo = NULL;
        if (isset($_GET['sgk_sicil_no'])) {
        $stripper->offsetSet('sgk_sicil_no',$stripChainerFactory->get(stripChainers::FILTER_PARANOID_LEVEL2,
                                               $app,
                                               $_GET['sgk_sicil_no']));
        }
        $vWebAddress = NULL;
        if (isset($_GET['web_address'])) {
        $stripper->offsetSet('web_address',$stripChainerFactory->get(stripChainers::FILTER_PARANOID_LEVEL2,
                                               $app,
                                               $_GET['web_address']));
        }
        $vLogo = NULL;
        if (isset($_GET['logo'])) {
        $stripper->offsetSet('logo',$stripChainerFactory->get(stripChainers::FILTER_PARANOID_LEVEL2,
                                               $app,
                                               $_GET['logo']));
        }
    * 
    */
    $stripper->strip();
    if ($stripper->offsetExists('language_code')) {
        $vLanguageCode = $stripper->offsetGet('language_code')->getFilterValue();
    }
    /*
        if ($stripper->offsetExists('cpk')) {
       $vCpk = $stripper->offsetGet('cpk')->getFilterValue();
        }  
    * 
    */
    if ($stripper->offsetExists('profile_public')) {
        $vProfilePublic = $stripper->offsetGet('profile_public')->getFilterValue();
    }
    if ($stripper->offsetExists('about')) {
        $vAbout = $stripper->offsetGet('about')->getFilterValue();
    }
    if ($stripper->offsetExists('about_eng')) {
        $vAboutEng = $stripper->offsetGet('about_eng')->getFilterValue();
    }
    if ($stripper->offsetExists('verbal1_title')) {
        $vVerbal1Title = $stripper->offsetGet('verbal1_title')->getFilterValue();
    }
    if ($stripper->offsetExists('verbal1')) {
        $vVerbal1 = $stripper->offsetGet('verbal1')->getFilterValue();
    }
    if ($stripper->offsetExists('verbal2_title')) {
        $vVerbal2Title = $stripper->offsetGet('verbal2_title')->getFilterValue();
    }
    if ($stripper->offsetExists('verbal2')) {
        $vVerbal2 = $stripper->offsetGet('verbal2')->getFilterValue();
    }
    if ($stripper->offsetExists('verbal3_title')) {
        $vVerbal3Title = $stripper->offsetGet('verbal3_title')->getFilterValue();
    }
    if ($stripper->offsetExists('verbal3')) {
        $vVerbal3 = $stripper->offsetGet('verbal3')->getFilterValue();
    }
    if ($stripper->offsetExists('verbal1_title_eng')) {
        $vVerbal1TitleEng = $stripper->offsetGet('verbal1_title_eng')->getFilterValue();
    }
    if ($stripper->offsetExists('verbal1_eng')) {
        $vVerbal1Eng = $stripper->offsetGet('verbal1_eng')->getFilterValue();
    }
    if ($stripper->offsetExists('verbal2_title_eng')) {
        $vVerbal2TitleEng = $stripper->offsetGet('verbal2_title_eng')->getFilterValue();
    }
    if ($stripper->offsetExists('verbal2_eng')) {
        $vVerbal2Eng = $stripper->offsetGet('verbal2_eng')->getFilterValue();
    }
    if ($stripper->offsetExists('verbal3_title_eng')) {
        $vVerbal3TitleEng = $stripper->offsetGet('verbal3_title_eng')->getFilterValue();
    }
    if ($stripper->offsetExists('verbal3_eng')) {
        $vVerbal3Eng = $stripper->offsetGet('verbal3_eng')->getFilterValue();
    }
    /*
        if ($stripper->offsetExists('foundation_yearx')) {
       $vFoundationYearx = $stripper->offsetGet('foundation_yearx')->getFilterValue();
        }  
        if ($stripper->offsetExists('tax_office')) {
       $vTaxOffice = $stripper->offsetGet('tax_office')->getFilterValue();
        }  
        if ($stripper->offsetExists('tax_no')) {
       $vTaxNo = $stripper->offsetGet('tax_no')->getFilterValue();
        }  
        if ($stripper->offsetExists('firm_name')) {
       $vFirmName = $stripper->offsetGet('firm_name')->getFilterValue();
        }
        if ($stripper->offsetExists('firm_name_eng')) {
       $vFirmNameEng = $stripper->offsetGet('firm_name_eng')->getFilterValue();
        }
        if ($stripper->offsetExists('firm_name_short')) {
       $vFirmNameShort = $stripper->offsetGet('firm_name_short')->getFilterValue();
        }
        if ($stripper->offsetExists('firm_name_short_eng')) {
       $vFirmNameShortEng = $stripper->offsetGet('firm_name_short_eng')->getFilterValue();
        }
        if ($stripper->offsetExists('country_id')) {
       $vCountryId = $stripper->offsetGet('country_id')->getFilterValue();
        }
        if ($stripper->offsetExists('description')) {
       $vDescription = $stripper->offsetGet('description')->getFilterValue();
        }
        if ($stripper->offsetExists('description_eng')) {
       $vDescriptionEng = $stripper->offsetGet('description_eng')->getFilterValue();
        }
        if ($stripper->offsetExists('duns_number')) {
       $vDunsNumber = $stripper->offsetGet('duns_number')->getFilterValue();
        }
        if ($stripper->offsetExists('sgk_sicil_no')) {
       $vDunsNumber = $stripper->offsetGet('sgk_sicil_no')->getFilterValue();
        }
        if ($stripper->offsetExists('web_address')) {
       $vWebAddress = $stripper->offsetGet('web_address')->getFilterValue();
        }
        if ($stripper->offsetExists('logo')) {
       $vLogo = $stripper->offsetGet('logo')->getFilterValue();
        } 
    * 
    */
    $resDataInsert = $BLL->insert(array('language_code' => $vLanguageCode, 'cpk' => $vCpk, 'profile_public' => $vProfilePublic, 'about' => $vAbout, 'about_eng' => $vAboutEng, 'verbal1_title' => $vVerbal1Title, 'verbal1' => $vVerbal1, 'verbal2_title' => $vVerbal2Title, 'verbal2' => $vVerbal2, 'verbal3_title' => $vVerbal3Title, 'verbal3' => $vVerbal3, 'verbal1_title_eng' => $vVerbal1TitleEng, 'verbal1_eng' => $vVerbal1Eng, 'verbal2_title_eng' => $vVerbal2TitleEng, 'verbal2_eng' => $vVerbal2Eng, 'verbal3_title_eng' => $vVerbal3TitleEng, 'verbal3_eng' => $vVerbal3Eng, 'pk' => $pk));
    $app->response()->header("Content-Type", "application/json");
    $app->response()->body(json_encode($resDataInsert));
});
Exemplo n.º 5
0
$app->add(new \Slim\Middleware\MiddlewareMQManager());
$app->add(new \Slim\Middleware\MiddlewareBLLManager());
$app->add(new \Slim\Middleware\MiddlewareDalManager());
$app->add(new \Slim\Middleware\MiddlewareServiceManager());
$app->add(new \Slim\Middleware\MiddlewareMQManager());
/**
 *  * Okan CIRAN
 * @since 26-07-2016
 *  rest servislere eklendi
 */
$app->get("/pkFillInfoTablesDdList_pgClass/", function () use($app) {
    $BLL = $app->getBLLManager()->get('pgClassBLL');
    $componentType = 'ddslick';
    if (isset($_GET['component_type'])) {
        $componentType = strtolower(trim($_GET['component_type']));
    }
    $headerParams = $app->request()->headers();
    if (!isset($headerParams['X-Public'])) {
        throw new Exception('rest api "pkFillInfoTablesDdList_pgClass" end point, X-Public variable not found');
    }
    //$pk = $headerParams['X-Public'];
    $resCombobox = $BLL->fillInfoTablesDdList();
    $flows = array();
    $flows[] = array("text" => "Lütfen Seçiniz", "value" => 0, "selected" => true, "imageSrc" => "", "description" => "Lütfen Seçiniz");
    foreach ($resCombobox as $flow) {
        $flows[] = array("text" => html_entity_decode($flow["name"]), "value" => intval($flow["id"]), "selected" => false, "description" => html_entity_decode($flow["description"]), "attributes" => array("active" => $flow["active"]));
    }
    $app->response()->header("Content-Type", "application/json");
    $app->response()->body(json_encode($flows));
});
$app->run();
$app->add(new \Slim\Middleware\MiddlewareBLLManager());
$app->add(new \Slim\Middleware\MiddlewareDalManager());
$app->add(new \Slim\Middleware\MiddlewareServiceManager());
$app->add(new \Slim\Middleware\MiddlewareMQManager());
/**
 *  * Okan CIRAN
 * @since 10-02-2016
 */
$app->get("/pkFillConsultantOperationsDropDown_sysOperationTypes/", function () use($app) {
    $BLL = $app->getBLLManager()->get('sysOperationTypesBLL');
    $headerParams = $app->request()->headers();
    $vPk = $headerParams['X-Public'];
    $fPk = $vPk;
    $vLanguageCode = 'tr';
    if (isset($_GET['language_code'])) {
        $vLanguageCode = strtolower(trim($_GET['language_code']));
    }
    if (isset($_GET['main_group'])) {
        $resCombobox = $BLL->fillConsultantOperations(array('language_code' => $vLanguageCode, 'main_group' => $_GET['main_group'], 'pk' => $fPk));
    } else {
        $resCombobox = $BLL->fillConsultantOperations(array('language_code' => $vLanguageCode, 'pk' => $fPk));
    }
    $menus = array();
    $menus[] = array("text" => "Lütfen Bir Operasyon Tipi Seçiniz", "value" => -1, "selected" => true);
    foreach ($resCombobox as $menu) {
        $menus[] = array("text" => $menu["name"], "value" => $menu["id"], "selected" => false, "description" => $menu["name_eng"], "imageSrc" => "");
    }
    $app->response()->header("Content-Type", "application/json");
    $app->response()->body(json_encode($menus));
});
$app->run();
//$app->add(new \Slim\Middleware\MiddlewareTest());
$app->add(new \Slim\Middleware\MiddlewareBLLManager());
$app->add(new \Slim\Middleware\MiddlewareDalManager());
$app->add(new \Slim\Middleware\MiddlewareServiceManager());
$app->add(new \Slim\Middleware\MiddlewareMQManager());
$app->add(new \Slim\Middleware\MiddlewareHMAC());
/**
 *  *  
 *  * zeynel dağlı
 * @since 11-09-2014
 */
$app->get("/fillComboBox_sysvillage/", function () use($app) {
    $BLL = $app->getBLLManager()->get('sysVillageBLL');
    // Filters are called from service manager
    //$filterHtmlAdvanced = $app->getServiceManager()->get(\Services\Filter\FilterServiceNames::FILTER_HTML_TAGS_ADVANCED);
    //  $filterHexadecimalBase = $app->getServiceManager()->get(\Services\Filter\FilterServiceNames::FILTER_HEXADECIMAL_ADVANCED );
    //$filterHexadecimalAdvanced = $app->getServiceManager()->get(\Services\Filter\FilterServiceNames::FILTER_HEXADECIMAL_ADVANCED);
    //  print_r('--****************get parent--' .$_GET['country_id'] );
    $resCombobox = $BLL->fillComboBox(array('country_id' => $_GET['country_id'], 'city_id' => $_GET['city_id'], 'boroughs_id' => $_GET['boroughs_id'], 'language_id' => $_GET['language_id']));
    //print_r($resDataMenu);
    $menus = array();
    foreach ($resCombobox as $menu) {
        $menus[] = array("id" => $menu["id"], "name" => $menu["name"]);
    }
    $app->response()->header("Content-Type", "application/json");
    /*$app->contentType('application/json');
      $app->halt(302, '{"error":"Something went wrong"}');
      $app->stop();*/
    $app->response()->body(json_encode($menus));
});
$app->run();
Exemplo n.º 8
0
$app->add(new \Slim\Middleware\MiddlewareServiceManager());
$app->add(new \Slim\Middleware\MiddlewareMQManager());
$pdo = new PDO('pgsql:dbname=ecoman_01_10;host=88.249.18.205;user=postgres;password=1q2w3e4r');
\Slim\Route::setDefaultConditions(array('firstName' => '[a-zA-Z]{3,}', 'page' => '[0-9]{1,}'));
/**
 *  * Okan CIRAN
 * @since 07-01-2016
 */
$app->get("/pkFillComboBoxMainRoles_sysAclRoles/", function () use($app) {
    $BLL = $app->getBLLManager()->get('sysAclRolesBLL');
    //print_r('--****************get parent--' );
    $resCombobox = $BLL->fillComboBoxMainRoles();
    //print_r($resDataMenu);
    $flows = array();
    foreach ($resCombobox as $flow) {
        $flows[] = array("id" => $flow["id"], "text" => $flow["name"], "state" => 'open', "checked" => false, "attributes" => array("notroot" => true, "active" => $flow["active"], "deleted" => $flow["deleted"]));
    }
    //   print_r($flows);
    $app->response()->header("Content-Type", "application/json");
    /* $app->contentType('application/json');
       $app->halt(302, '{"error":"Something went wrong"}');
       $app->stop(); */
    $app->response()->body(json_encode($flows));
});
/**
 *  * Okan CIRAN
 * @since 07-01-2016
 */
$app->get("/pkFillComboBoxFullRoles_sysAclRoles/", function () use($app) {
    $BLL = $app->getBLLManager()->get('sysAclRolesBLL');
    if (isset($_GET['id']) && $_GET['id'] != "") {
        $resCombobox = $BLL->fillComboBoxFullRoles(array('id' => $_GET["id"]));
 *  * Okan CIRAN
 * @since 15-02-2016
 */
$app->get("/pkFillMachineToolGroupPropertyDefinitions_sysMachineToolPropertyDefinition/", function () use($app) {
    $BLL = $app->getBLLManager()->get('sysMachineToolPropertyDefinitionBLL');
    $vLanguageCode = 'tr';
    if (isset($_GET['language_code'])) {
        $vLanguageCode = strtolower(trim($_GET['language_code']));
    }
    $componentType = 'ddslick';
    if (isset($_GET['component_type'])) {
        $componentType = strtolower(trim($_GET['component_type']));
    }
    if (isset($_GET['machine_tool_grup_id']) && $_GET['machine_tool_grup_id'] != "") {
        $resCombobox = $BLL->fillMachineToolGroupPropertyDefinitions(array('machine_tool_grup_id' => $_GET["machine_tool_grup_id"], 'language_code' => $vLanguageCode));
    } else {
        $resCombobox = $BLL->fillMachineToolGroupPropertyDefinitions(array('language_code' => $vLanguageCode));
    }
    $flows = array();
    foreach ($resCombobox as $flow) {
        $flows[] = array("id" => $flow["id"], "text" => $flow["name"], "state" => $flow["state_type"], "checked" => false, "icon_class" => "icon_class", "attributes" => array("root" => $flow["root_type"], "active" => $flow["active"]));
    }
    $app->response()->header("Content-Type", "application/json");
    /* $app->contentType('application/json');
       $app->halt(302, '{"error":"Something went wrong"}');
       $app->stop(); */
    $app->response()->body(json_encode($flows));
});
/**
 *  * Okan CIRAN
 * @since 15-02-2016
$app->get("/pkFillMachineToolGroupPropertyDefinitions_sysMachineToolPropertyDefinition/", function () use($app) {
    $stripper = $app->getServiceManager()->get('filterChainerCustom');
    $stripChainerFactory = new \Services\Filter\Helper\FilterChainerFactory();
    $BLL = $app->getBLLManager()->get('sysMachineToolPropertyDefinitionBLL');
    $componentType = 'ddslick';
    if (isset($_GET['component_type'])) {
        $componentType = strtolower(trim($_GET['component_type']));
    }
    $headerParams = $app->request()->headers();
    if (!isset($headerParams['X-Public'])) {
        throw new Exception('rest api "pkGetConsConfirmationProcessDetails_sysOsbConsultants" end point, X-Public variable not found');
    }
    //$pk = $headerParams['X-Public'];
    $vLanguageCode = 'tr';
    if (isset($_GET['language_code'])) {
        $stripper->offsetSet('language_code', $stripChainerFactory->get(stripChainers::FILTER_ONLY_LANGUAGE_CODE, $app, $_GET['language_code']));
    }
    $vMachineGrupId = NULL;
    if (isset($_GET['machine_grup_id'])) {
        $stripper->offsetSet('machine_grup_id', $stripChainerFactory->get(stripChainers::FILTER_ONLY_NUMBER_ALLOWED, $app, $_GET['machine_grup_id']));
    }
    $vUnitGrupId = NULL;
    if (isset($_GET['unit_grup_id'])) {
        $stripper->offsetSet('unit_grup_id', $stripChainerFactory->get(stripChainers::FILTER_ONLY_NUMBER_ALLOWED, $app, $_GET['unit_grup_id']));
    }
    $stripper->strip();
    if ($stripper->offsetExists('language_code')) {
        $vLanguageCode = $stripper->offsetGet('language_code')->getFilterValue();
    }
    if ($stripper->offsetExists('machine_grup_id')) {
        $vMachineGrupId = $stripper->offsetGet('machine_grup_id')->getFilterValue();
    }
    if ($stripper->offsetExists('unit_grup_id')) {
        $vUnitGrupId = $stripper->offsetGet('unit_grup_id')->getFilterValue();
    }
    $resCombobox = $BLL->fillMachineToolGroupPropertyDefinitions(array('machine_grup_id' => $vMachineGrupId, 'unit_grup_id' => $vUnitGrupId, 'language_code' => $vLanguageCode));
    $flows = array();
    foreach ($resCombobox as $flow) {
        $flows[] = array("id" => $flow["id"], "text" => html_entity_decode($flow["property_name"]), "state" => $flow["state_type"], "checked" => false, "icon_class" => "icon_class", "attributes" => array("root" => $flow["root_type"], "active" => $flow["active"], "machinegroup" => html_entity_decode($flow["machinegroup"]), "unitgroup" => html_entity_decode($flow["unitgroup"]), "text_eng" => html_entity_decode($flow["property_name_eng"])));
    }
    $app->response()->header("Content-Type", "application/json");
    $app->response()->body(json_encode($flows));
});
$app->add(new \Slim\Middleware\MiddlewareSecurity());
$app->add(new \Slim\Middleware\MiddlewareMQManager());
$app->add(new \Slim\Middleware\MiddlewareBLLManager());
$app->add(new \Slim\Middleware\MiddlewareDalManager());
$app->add(new \Slim\Middleware\MiddlewareServiceManager());
$app->add(new \Slim\Middleware\MiddlewareMQManager());
/**
 * Okan CIRAN
 * @since 11-03-2016
 */
$app->get("/pkGetAll_infoFirmReferences/", function () use($app) {
    $BLL = $app->getBLLManager()->get('infoFirmReferencesBLL');
    $headerParams = $app->request()->headers();
    $pk = $headerParams['X-Public'];
    $resDataMenu = $BLL->pkGetLeftMenu(array('language_code' => $_GET['language_code'], 'pk' => $pk));
    $menus = array();
    foreach ($resDataMenu as $menu) {
        $menus[] = array("id" => $menu["id"], "firm_name" => $menu["firm_names"], "ref_name" => $menu["ref_names"], "deleted" => $menu["deleted"], "state_deleted" => $menu["state_deleted"], "active" => $menu["active"], "state_active" => $menu["state_active"], "language_id" => $menu["language_id"], "language_name" => $menu["language_names"], "op_user_id" => $menu["op_user_id"], "op_username" => $menu["op_username"], "operation_type_id" => $menu["operation_type_id"], "operation_name" => $menu["operation_name"], "s_date" => $menu["s_date"], "c_date" => $menu["c_date"], "consultant_id" => $menu["consultant_id"], "consultant_confirm_type_id" => $menu["consultant_confirm_type_id"], "operation_name" => $menu["consultant_confirm_type"], "confirm_id" => $menu["confirm_id"], "network_key" => $menu["Ref_network_key"]);
    }
    $app->response()->header("Content-Type", "application/json");
    $app->response()->body(json_encode($menus));
});
/**
 *  * Okan CIRAN
 * @since 11-03-2016
 */
$app->get("/pkFillWithReference_infoFirmReferences/", function () use($app) {
    $stripper = $app->getServiceManager()->get('filterChainerCustom');
    $stripChainerFactory = new \Services\Filter\Helper\FilterChainerFactory();
    $BLL = $app->getBLLManager()->get('infoFirmReferencesBLL');
    $headerParams = $app->request()->headers();
    if (!isset($headerParams['X-Public'])) {
Exemplo n.º 12
0
$app->add(new \Slim\Middleware\MiddlewareHMAC());
$app->add(new \Slim\Middleware\MiddlewareSecurity());
$app->add(new \Slim\Middleware\MiddlewareMQManager());
$app->add(new \Slim\Middleware\MiddlewareBLLManager());
$app->add(new \Slim\Middleware\MiddlewareDalManager());
$app->add(new \Slim\Middleware\MiddlewareServiceManager());
$app->add(new \Slim\Middleware\MiddlewareMQManager());
/**
 *  * OKAN CIRAN
 * @since 05-01-2016
 */
$app->get("/pkSessionControl_blLoginLogout/", function () use($app) {
    $BLL = $app->getBLLManager()->get('blLoginLogoutBLL');
    // Filters are called from service manager
    //$filterHtmlAdvanced = $app->getServiceManager()->get(\Services\Filter\FilterServiceNames::FILTER_HTML_TAGS_ADVANCED);
    //  $filterHexadecimalBase = $app->getServiceManager()->get(\Services\Filter\FilterServiceNames::FILTER_HEXADECIMAL_ADVANCED );
    //$filterHexadecimalAdvanced = $app->getServiceManager()->get(\Services\Filter\FilterServiceNames::FILTER_HEXADECIMAL_ADVANCED);
    // print_r( $app->request()->headers());
    $resDataMenu = $BLL->pkSessionControl(array('pk' => $_GET['pk']));
    // print_r($resDataMenu);
    $menus = array();
    foreach ($resDataMenu as $menu) {
        $menus[] = array("id" => $menu["id"], "name" => $menu["name"], "data" => $menu["data"], "lifetime" => $menu["lifetime"], "c_date" => $menu["c_date"], "modified" => $menu["modified"], "public_key" => $menu["public_key"], "u_name" => $menu["u_name"], "u_surname" => $menu["u_surname"], "username" => $menu["username"]);
    }
    $app->response()->header("Content-Type", "application/json");
    /*$app->contentType('application/json');
      $app->halt(302, '{"error":"Something went wrong"}');
      $app->stop();*/
    $app->response()->body(json_encode($menus));
});
$app->run();
$app->add(new \Slim\Middleware\MiddlewareMQManager());
/**x
 *  * Okan CIRAN
 * @since 23-08-2016
 */
$app->get("/pkDeletedAct_infoFirmConsultants/", function () use($app) {
    $stripper = $app->getServiceManager()->get('filterChainerCustom');
    $stripChainerFactory = new \Services\Filter\Helper\FilterChainerFactory();
    $BLL = $app->getBLLManager()->get('infoFirmConsultantsBLL');
    $headerParams = $app->request()->headers();
    if (!isset($headerParams['X-Public'])) {
        throw new Exception('rest api "pkDeletedAct_infoFirmConsultants" end point, X-Public variable not found');
    }
    $pk = $headerParams['X-Public'];
    $vId = NULL;
    if (isset($_GET['id'])) {
        $stripper->offsetSet('id', $stripChainerFactory->get(stripChainers::FILTER_ONLY_NUMBER_ALLOWED, $app, $_GET['id']));
    }
    $stripper->strip();
    if ($stripper->offsetExists('id')) {
        $vId = $stripper->offsetGet('id')->getFilterValue();
    }
    $resDataDeleted = $BLL->DeletedAct(array('id' => $vId, 'pk' => $pk));
    $app->response()->header("Content-Type", "application/json");
    $app->response()->body(json_encode($resDataDeleted));
});
/**x
 *  * Okan CIRAN
 * @since 23-08-2016
 */
$app->get("/pkUpdate_infoFirmConsultants/", function () use($app) {
Exemplo n.º 14
0
$app->add(new \Slim\Middleware\MiddlewareSecurity());
$app->add(new \Slim\Middleware\MiddlewareMQManager());
$app->add(new \Slim\Middleware\MiddlewareBLLManager());
$app->add(new \Slim\Middleware\MiddlewareDalManager());
$app->add(new \Slim\Middleware\MiddlewareServiceManager());
$app->add(new \Slim\Middleware\MiddlewareMQManager());
/**
 *  * zeynel dağlı
 * @since 11-09-2014
 */
$app->get("/pkFillGrid_syssectors/", function () use($app) {
    $BLL = $app->getBLLManager()->get('sysSectorsBLL');
    $resTotalRowCount = $BLL->fillGridRowTotalCount();
    $resultArray = array();
    $resultArray['total'] = $resTotalRowCount[0]['toplam'];
    // print_r(' row sayımız =' . $resultArray['total'] );
    $app->response()->header("Content-Type", "application/json");
    /* $app->contentType('application/json');
       $app->halt(302, '{"error":"Something went wrong"}');
       $app->stop(); */
    $app->response()->body(json_encode($resultArray));
});
/**
 *  Okan CIRAN
 * @since 09-06-2016
 */
$app->get("/pkGetSectors_syssectors/", function () use($app) {
    $stripper = $app->getServiceManager()->get('filterChainerCustom');
    $stripChainerFactory = new \Services\Filter\Helper\FilterChainerFactory();
    $BLL = $app->getBLLManager()->get('sysSectorsBLL');
    $headerParams = $app->request()->headers();
    if (!isset($headerParams['X-Public'])) {
$app->get("/pkInsert_sysOperationTypesRrp/", function () use($app) {
    $stripper = $app->getServiceManager()->get('filterChainerCustom');
    $stripChainerFactory = new \Services\Filter\Helper\FilterChainerFactory();
    $BLL = $app->getBLLManager()->get('sysOperationTypesRrpBLL');
    $headerParams = $app->request()->headers();
    if (!isset($headerParams['X-Public'])) {
        throw new Exception('rest api "pkInsert_sysOperationTypesRrp" end point, X-Public variable not found');
    }
    $pk = $headerParams['X-Public'];
    $vRrpRestServiceId = NULL;
    if (isset($_GET['rrp_restservice_id'])) {
        $stripper->offsetSet('rrp_restservice_id', $stripChainerFactory->get(stripChainers::FILTER_ONLY_NUMBER_ALLOWED, $app, $_GET['rrp_restservice_id']));
    }
    $vTableOid = NULL;
    if (isset($_GET['table_oid'])) {
        $stripper->offsetSet('table_oid', $stripChainerFactory->get(stripChainers::FILTER_ONLY_NUMBER_ALLOWED, $app, $_GET['table_oid']));
    }
    $vAssignDefinitionId = NULL;
    if (isset($_GET['assign_definition_id'])) {
        $stripper->offsetSet('assign_definition_id', $stripChainerFactory->get(stripChainers::FILTER_ONLY_NUMBER_ALLOWED, $app, $_GET['assign_definition_id']));
    }
    $vOperationName = NULL;
    if (isset($_GET['operation_name'])) {
        $stripper->offsetSet('operation_name', $stripChainerFactory->get(stripChainers::FILTER_PARANOID_LEVEL2, $app, $_GET['operation_name']));
    }
    $vOperationNameEng = NULL;
    if (isset($_GET['operation_name_eng'])) {
        $stripper->offsetSet('operation_name_eng', $stripChainerFactory->get(stripChainers::FILTER_PARANOID_LEVEL2, $app, $_GET['operation_name_eng']));
    }
    $vDescription = NULL;
    if (isset($_GET['description'])) {
        $stripper->offsetSet('description', $stripChainerFactory->get(stripChainers::FILTER_PARANOID_LEVEL2, $app, $_GET['description']));
    }
    $vDescriptionEng = NULL;
    if (isset($_GET['description_eng'])) {
        $stripper->offsetSet('description_eng', $stripChainerFactory->get(stripChainers::FILTER_PARANOID_LEVEL2, $app, $_GET['description_eng']));
    }
    $stripper->strip();
    if ($stripper->offsetExists('rrp_restservice_id')) {
        $vRrpRestServiceId = $stripper->offsetGet('rrp_restservice_id')->getFilterValue();
    }
    if ($stripper->offsetExists('table_oid')) {
        $vTableOid = $stripper->offsetGet('table_oid')->getFilterValue();
    }
    if ($stripper->offsetExists('assign_definition_id')) {
        $vAssignDefinitionId = $stripper->offsetGet('assign_definition_id')->getFilterValue();
    }
    if ($stripper->offsetExists('operation_name')) {
        $vOperationName = $stripper->offsetGet('operation_name')->getFilterValue();
    }
    if ($stripper->offsetExists('operation_name_eng')) {
        $vOperationNameEng = $stripper->offsetGet('operation_name_eng')->getFilterValue();
    }
    if ($stripper->offsetExists('description')) {
        $vDescription = $stripper->offsetGet('description')->getFilterValue();
    }
    if ($stripper->offsetExists('description_eng')) {
        $vDescriptionEng = $stripper->offsetGet('description_eng')->getFilterValue();
    }
    $resDataInsert = $BLL->insert(array('rrp_restservice_id' => $vRrpRestServiceId, 'table_oid' => $vTableOid, 'assign_definition_id' => $vAssignDefinitionId, 'operation_name' => $vOperationName, 'operation_name_eng' => $vOperationNameEng, 'description' => $vDescription, 'description_eng' => $vDescriptionEng, 'pk' => $pk));
    $app->response()->header("Content-Type", "application/json");
    $app->response()->body(json_encode($resDataInsert));
});
$app->get("/pkInsert_sysAclRestservices/", function () use($app) {
    $stripper = $app->getServiceManager()->get('filterChainerCustom');
    $stripChainerFactory = new \Services\Filter\Helper\FilterChainerFactory();
    $BLL = $app->getBLLManager()->get('sysAclRestservicesBLL');
    $headerParams = $app->request()->headers();
    if (!isset($headerParams['X-Public'])) {
        throw new Exception('rest api "pkInsert_sysAclRestservices" end point, X-Public variable not found');
    }
    $pk = $headerParams['X-Public'];
    $vName = NULL;
    if (isset($_GET['name'])) {
        $stripper->offsetSet('name', $stripChainerFactory->get(stripChainers::FILTER_DEFAULT, $app, $_GET['name']));
    }
    $vDescription = NULL;
    if (isset($_GET['description'])) {
        $stripper->offsetSet('description', $stripChainerFactory->get(stripChainers::FILTER_PARANOID_LEVEL2, $app, $_GET['description']));
    }
    $vServicesGroupId = NULL;
    if (isset($_GET['services_group_id'])) {
        $stripper->offsetSet('services_group_id', $stripChainerFactory->get(stripChainers::FILTER_ONLY_NUMBER_ALLOWED, $app, $_GET['services_group_id']));
    }
    $stripper->strip();
    if ($stripper->offsetExists('name')) {
        $vName = $stripper->offsetGet('name')->getFilterValue();
    }
    if ($stripper->offsetExists('description')) {
        $vDescription = $stripper->offsetGet('description')->getFilterValue();
    }
    if ($stripper->offsetExists('services_group_id')) {
        $vServicesGroupId = $stripper->offsetGet('services_group_id')->getFilterValue();
    }
    $resDataInsert = $BLL->insert(array('name' => $vName, 'services_group_id' => $vServicesGroupId, 'description' => $vDescription, 'pk' => $pk));
    $app->response()->header("Content-Type", "application/json");
    $app->response()->body(json_encode($resDataInsert));
});
Exemplo n.º 17
0
$app->add(new \Slim\Middleware\MiddlewareSecurity());
$app->add(new \Slim\Middleware\MiddlewareBLLManager());
$app->add(new \Slim\Middleware\MiddlewareDalManager());
$app->add(new \Slim\Middleware\MiddlewareServiceManager());
$app->add(new \Slim\Middleware\MiddlewareMQManager());
/**
 *  * Okan CIRAN
 * @since 13-01-2016
 */
$app->get("/pkFillComboBoxMainResources_sysAclResources/", function () use($app) {
    $BLL = $app->getBLLManager()->get('sysAclResourcesBLL');
    $resCombobox = $BLL->fillComboBoxMainResources();
    $flows = array();
    foreach ($resCombobox as $flow) {
        $flows[] = array("id" => $flow["id"], "text" => $flow["name"], "state" => 'open', "checked" => false, "attributes" => array("notroot" => true, "active" => $flow["active"], "deleted" => $flow["deleted"]));
    }
    $app->response()->header("Content-Type", "application/json");
    /* $app->contentType('application/json');
       $app->halt(302, '{"error":"Something went wrong"}');
       $app->stop(); */
    $app->response()->body(json_encode($flows));
});
/**
 *  * Okan CIRAN
 * @since 13-01-2016
 */
$app->get("/pkFillComboBoxFullResources_sysAclResources/", function () use($app) {
    $BLL = $app->getBLLManager()->get('sysAclResourcesBLL');
    $resCombobox = $BLL->fillComboBoxFullResources();
    $flows = array();
    foreach ($resCombobox as $flow) {
$app->get("/pkFillGrid_sysProductionTypes/", function () use($app) {
    $stripper = $app->getServiceManager()->get('filterChainerCustom');
    $stripChainerFactory = new \Services\Filter\Helper\FilterChainerFactory();
    $BLL = $app->getBLLManager()->get('sysProductionTypesBLL');
    $headerParams = $app->request()->headers();
    $vPk = $headerParams['X-Public'];
    $vLanguageCode = 'tr';
    if (isset($_GET['language_code'])) {
        $stripper->offsetSet('language_code', $stripChainerFactory->get(stripChainers::FILTER_ONLY_LANGUAGE_CODE, $app, $_GET['language_code']));
    }
    $vPage = NULL;
    if (isset($_GET['page'])) {
        $stripper->offsetSet('page', $stripChainerFactory->get(stripChainers::FILTER_ONLY_NUMBER_ALLOWED, $app, $_GET['page']));
    }
    $vRows = NULL;
    if (isset($_GET['rows'])) {
        $stripper->offsetSet('rows', $stripChainerFactory->get(stripChainers::FILTER_ONLY_NUMBER_ALLOWED, $app, $_GET['rows']));
    }
    $vSort = NULL;
    if (isset($_GET['sort'])) {
        $stripper->offsetSet('sort', $stripChainerFactory->get(stripChainers::FILTER_PARANOID_LEVEL2, $app, $_GET['sort']));
    }
    $vOrder = NULL;
    if (isset($_GET['order'])) {
        $stripper->offsetSet('order', $stripChainerFactory->get(stripChainers::FILTER_ONLY_ORDER, $app, $_GET['order']));
    }
    if ($stripper->offsetExists('language_code')) {
        $vLanguageCode = $stripper->offsetGet('language_code')->getFilterValue();
    }
    if ($stripper->offsetExists('page')) {
        $vPage = $stripper->offsetGet('page')->getFilterValue();
    }
    if ($stripper->offsetExists('rows')) {
        $vRows = $stripper->offsetGet('rows')->getFilterValue();
    }
    if ($stripper->offsetExists('sort')) {
        $vSort = $stripper->offsetGet('sort')->getFilterValue();
    }
    if ($stripper->offsetExists('order')) {
        $vOrder = $stripper->offsetGet('order')->getFilterValue();
    }
    $resDataGrid = $BLL->fillGrid(array('page' => $vPage, 'rows' => $vRows, 'sort' => $vSort, 'order' => $vOrder, 'language_code' => $vLanguageCode));
    $resTotalRowCount = $BLL->fillGridRowTotalCount(array('language_code' => $vLanguageCode));
    $flows = array();
    foreach ($resDataGrid as $flow) {
        $flows[] = array("id" => $flow["id"], "name" => $flow["name"], "name_eng" => $flow["name_eng"], "logo" => $flow["logo"], "deleted" => $flow["deleted"], "state_deleted" => $flow["state_deleted"], "active" => $flow["active"], "state_active" => $flow["state_active"], "language_id" => $flow["language_id"], "language_name" => $flow["language_name"], "language_parent_id" => $flow["language_parent_id"], "op_user_id" => $flow["op_user_id"], "op_user_name" => $flow["op_user_name"], "attributes" => array("notroot" => false, "active" => $flow["active"]));
    }
    $app->response()->header("Content-Type", "application/json");
    $resultArray = array();
    $resultArray['total'] = $resTotalRowCount[0]['count'];
    $resultArray['rows'] = $flows;
    /* $app->contentType('application/json');
       $app->halt(302, '{"error":"Something went wrong"}');
       $app->stop(); */
    $app->response()->body(json_encode($resultArray));
});
Exemplo n.º 19
0
$app->get("/pkGetUnspscCodes_sysUnspscCodes/", function () use($app) {
    $stripper = $app->getServiceManager()->get('filterChainerCustom');
    $stripChainerFactory = new \Services\Filter\Helper\FilterChainerFactory();
    $BLL = $app->getBLLManager()->get('sysUnspscCodesBLL');
    $componentType = 'bootstrap';
    if (isset($_GET['component_type'])) {
        $componentType = strtolower(trim($_GET['component_type']));
    }
    $vLanguageCode = 'tr';
    if (isset($_GET['language_code'])) {
        $stripper->offsetSet('language_code', $stripChainerFactory->get(stripChainers::FILTER_ONLY_LANGUAGE_CODE, $app, $_GET['language_code']));
    }
    $vParentId = 0;
    if (isset($_GET['id'])) {
        $stripper->offsetSet('id', $stripChainerFactory->get(stripChainers::FILTER_ONLY_NUMBER_ALLOWED, $app, $_GET['id']));
    }
    $stripper->strip();
    if ($stripper->offsetExists('language_code')) {
        $vLanguageCode = $stripper->offsetGet('language_code')->getFilterValue();
    }
    if ($stripper->offsetExists('id')) {
        $vParentId = $stripper->offsetGet('id')->getFilterValue();
    }
    if (isset($_GET['id']) && $_GET['id'] != "") {
        $resCombobox = $BLL->getUnspscCodes(array('parent_id' => $vParentId, 'language_code' => $vLanguageCode));
    } else {
        $resCombobox = $BLL->getUnspscCodes(array('language_code' => $vLanguageCode));
    }
    $menus = array();
    $menus[] = array("text" => "Lütfen Seçiniz", "value" => -1, "selected" => true);
    if (isset($_GET['id']) && $_GET['id'] != "") {
        if ($componentType == 'bootstrap') {
            foreach ($resCombobox as $menu) {
                $menus[] = array("id" => $menu["id"], "text" => $menu["unspsc_names"], "state" => 'closed', "checked" => false, "attributes" => array("notroot" => true, "active" => $menu["active"], "text_eng" => $menu["unspsc_name_eng"]));
            }
        } else {
            if ($componentType == 'ddslick') {
                foreach ($resCombobox as $menu) {
                    $menus[] = array("text" => $menu["unspsc_names"], "value" => $menu["id"], "selected" => false, "description" => $menu["unspsc_name_eng"], "imageSrc" => "");
                }
            }
        }
    } else {
        if ($componentType == 'bootstrap') {
            foreach ($resCombobox as $menu) {
                $menus[] = array("id" => $menu["id"], "text" => $menu["unspsc_names"], "state" => 'closed', "checked" => false, "attributes" => array("notroot" => true, "active" => $menu["active"], "text_eng" => $menu["unspsc_name_eng"]));
            }
        } else {
            if ($componentType == 'ddslick') {
                foreach ($resCombobox as $menu) {
                    $menus[] = array("text" => $menu["unspsc_names"], "value" => $menu["id"], "selected" => false, "description" => $menu["unspsc_name_eng"], "imageSrc" => "");
                }
            }
        }
    }
    $app->response()->header("Content-Type", "application/json");
    $app->response()->body(json_encode($menus));
});
Exemplo n.º 20
0
 * @since 30-05-2016
 */
$app->get("/pkGetAll_infoFirmQuality/", function () use($app) {
    $stripper = $app->getServiceManager()->get('filterChainerCustom');
    $stripChainerFactory = new \Services\Filter\Helper\FilterChainerFactory();
    $BLL = $app->getBLLManager()->get('infoFirmQualityBLL');
    $headerParams = $app->request()->headers();
    if (!isset($headerParams['X-Public'])) {
        throw new Exception('rest api "pkGetAll_infoFirmQuality" end point, X-Public variable not found');
    }
    $pk = $headerParams['X-Public'];
    $vLanguageCode = 'tr';
    if (isset($_GET['language_code'])) {
        $stripper->offsetSet('language_code', $stripChainerFactory->get(stripChainers::FILTER_ONLY_LANGUAGE_CODE, $app, $_GET['language_code']));
    }
    $stripper->strip();
    if ($stripper->offsetExists('language_code')) {
        $vLanguageCode = $stripper->offsetGet('language_code')->getFilterValue();
    }
    $resDataMenu = $BLL->getAll(array('language_code' => $vLanguageCode, 'pk' => $pk));
    $menus = array();
    if (isset($resDataGrid['resultSet'][0]['id'])) {
        foreach ($resDataMenu as $menu) {
            $menus[] = array("id" => $menu["id"], "firm_id" => $menu["firm_id"], "certificate_id" => $menu["certificate_id"], "certificate" => $menu["certificate"], "certificate_short" => $menu["certificate_short"], "certificate_short_eng" => $menu["certificate_short_eng"], "consultant_id" => $menu["consultant_id"], "cons_allow_id" => $menu["cons_allow_id"], "cons_allow" => $menu["cons_allow"], "act_parent_id" => intval($flow["act_parent_id"]), "deleted" => $menu["deleted"], "state_deleted" => $menu["state_deleted"], "active" => $menu["active"], "state_active" => $menu["state_active"], "language_id" => $menu["language_id"], "language_name" => $menu["language_names"], "op_user_id" => $menu["op_user_id"], "op_username" => $menu["op_username"], "operation_type_id" => $menu["operation_type_id"], "operation_name" => $menu["operation_name"], "s_date" => $menu["s_date"], "c_date" => $menu["c_date"]);
        }
    }
    $app->response()->header("Content-Type", "application/json");
    $app->response()->body(json_encode($menus));
});
/**x
 *  * Okan CIRAN
Exemplo n.º 21
0
$app->add(new \Slim\Middleware\MiddlewareBLLManager());
$app->add(new \Slim\Middleware\MiddlewareDalManager());
$app->add(new \Slim\Middleware\MiddlewareServiceManager());
$app->add(new \Slim\Middleware\MiddlewareMQManager());
/**
 *  * Okan CIRAN
 * @since 10-03-2016
 */
$app->get("/pkFillGrid_logUser/", function () use($app) {
    $BLL = $app->getBLLManager()->get('logUserBLL');
    $headerParams = $app->request()->headers();
    $vPk = $headerParams['X-Public'];
    $resDataGrid = $BLL->fillGrid(array('page' => $_GET['page'], 'rows' => $_GET['rows'], 'sort' => $_GET['sort'], 'order' => $_GET['order']));
    $resTotalRowCount = $BLL->fillGridRowTotalCount();
    $flows = array();
    foreach ($resDataGrid as $flow) {
        $flows[] = array("id" => $flow["id"], "s_date" => $flow["s_date"], "pk" => $flow["pk"], "op_type_id" => $flow["op_type_id"], "operation_name" => $flow["operation_name"], "url" => $flow["url"], "path" => $flow["path"], "ip" => $flow["ip"], "params" => $flow["params"], "user_id" => $flow["user_id"], "username" => $flow["username"], "attributes" => array("notroot" => true));
    }
    $app->response()->header("Content-Type", "application/json");
    $resultArray = array();
    $resultArray['total'] = $resTotalRowCount[0]['count'];
    $resultArray['rows'] = $flows;
    $app->response()->body(json_encode($resultArray));
});
/**
 *  * Okan CIRAN
 * @since 10-03-2016
 */
$app->get("/pkInsert_logUser/", function () use($app) {
    $stripper = $app->getServiceManager()->get('filterChainerCustom');
    $stripChainerFactory = new \Services\Filter\Helper\FilterChainerFactory();
    $BLL = $app->getBLLManager()->get('logUserBLL');
Exemplo n.º 22
0
 */
$app->get("/pkFillOsbDdlist_sysOsb/", function () use($app) {
    $stripper = $app->getServiceManager()->get('filterChainerCustom');
    $stripChainerFactory = new \Services\Filter\Helper\FilterChainerFactory();
    $BLL = $app->getBLLManager()->get('sysOsbBLL');
    $componentType = 'ddslick';
    if (isset($_GET['component_type'])) {
        $componentType = strtolower(trim($_GET['component_type']));
    }
    $headerParams = $app->request()->headers();
    if (!isset($headerParams['X-Public'])) {
        throw new Exception('rest api "pkFillOsbDdlist_sysOsb" end point, X-Public variable not found');
    }
    //$pk = $headerParams['X-Public'];
    $vLanguageCode = 'tr';
    if (isset($_GET['language_code'])) {
        $stripper->offsetSet('language_code', $stripChainerFactory->get(stripChainers::FILTER_ONLY_LANGUAGE_CODE, $app, $_GET['language_code']));
    }
    $stripper->strip();
    if ($stripper->offsetExists('language_code')) {
        $vLanguageCode = $stripper->offsetGet('language_code')->getFilterValue();
    }
    $resCombobox = $BLL->fillOsbDdlist(array('language_code' => $vLanguageCode));
    $flows = array();
    $flows[] = array("text" => "Lütfen Seçiniz", "value" => 0, "selected" => true, "imageSrc" => "", "description" => "Lütfen Seçiniz");
    foreach ($resCombobox as $flow) {
        $flows[] = array("text" => html_entity_decode($flow["name"]), "value" => intval($flow["id"]), "selected" => false, "description" => html_entity_decode($flow["name_eng"]), "attributes" => array("active" => $flow["active"]));
    }
    $app->response()->header("Content-Type", "application/json");
    $app->response()->body(json_encode($flows));
});
/**
Exemplo n.º 23
0
 */
$app->get("/pkFillGrid_infoUsers/", function () use($app) {
    $stripper = $app->getServiceManager()->get('filterChainerCustom');
    $stripChainerFactory = new \Services\Filter\Helper\FilterChainerFactory();
    $BLL = $app->getBLLManager()->get('infoUsersBLL');
    $headerParams = $app->request()->headers();
    if (!isset($headerParams['X-Public'])) {
        throw new Exception('rest api "pkFillGrid_infoUsers" end point, X-Public variable not found');
    }
    $pk = $headerParams['X-Public'];
    $vLanguageCode = 'tr';
    if (isset($_GET['language_code'])) {
        $stripper->offsetSet('language_code', $stripChainerFactory->get(stripChainers::FILTER_ONLY_LANGUAGE_CODE, $app, $_GET['language_code']));
    }
    $stripper->strip();
    if ($stripper->offsetExists('language_code')) {
        $vLanguageCode = $stripper->offsetGet('language_code')->getFilterValue();
    }
    $resDataGrid = $BLL->fillGrid(array('page' => $_GET['page'], 'rows' => $_GET['rows'], 'sort' => $_GET['sort'], 'order' => $_GET['order'], 'language_code' => $vLanguageCode, 'pk' => $pk));
    $resTotalRowCount = $BLL->fillGridRowTotalCount(array('language_code' => $vLanguageCode));
    $flows = array();
    foreach ($resDataGrid as $flow) {
        $flows[] = array("id" => $flow["id"], "profile_public" => $flow["profile_public"], "state_profile_public" => $flow["state_profile_public"], "s_date" => $flow["s_date"], "c_date" => $flow["c_date"], "operation_type_id" => $flow["operation_type_id"], "operation_name" => $flow["operation_name"], "name" => $flow["name"], "surname" => $flow["surname"], "username" => $flow["username"], "auth_email" => $flow["auth_email"], "user_language" => $flow["user_language"], "language_name" => $flow["language_name"], "state_deleted" => $flow["state_deleted"], "active" => $flow["active"], "state_active" => $flow["state_active"], "deleted" => $flow["deleted"], "op_user_id" => $flow["op_user_id"], "op_user_name" => $flow["op_user_name"], "act_parent_id" => $flow["act_parent_id"], "auth_allow_id" => $flow["auth_allow_id"], "auth_alow" => $flow["auth_alow"], "cons_allow_id" => $flow["cons_allow_id"], "cons_allow" => $flow["cons_allow"], "consultant_id" => $flow["consultant_id"], "cons_name" => $flow["cons_name"], "cons_surname" => $flow["cons_surname"], "attributes" => array("notroot" => true, "active" => $flow["active"]));
    }
    $app->response()->header("Content-Type", "application/json");
    $resultArray = array();
    $resultArray['total'] = $resTotalRowCount[0]['count'];
    $resultArray['rows'] = $flows;
    $app->response()->body(json_encode($resultArray));
});
/**
$app->get("/pkInsert_sysMachineToolProperties/", function () use($app) {
    $stripper = $app->getServiceManager()->get('filterChainerCustom');
    $stripChainerFactory = new \Services\Filter\Helper\FilterChainerFactory();
    $BLL = $app->getBLLManager()->get('sysMachineToolPropertiesBLL');
    $headerParams = $app->request()->headers();
    if (!isset($headerParams['X-Public'])) {
        throw new Exception('rest api "pkInsert_sysMachineToolProperties" end point, X-Public variable not found');
    }
    $pk = $headerParams['X-Public'];
    $vLanguageCode = 'tr';
    if (isset($_GET['language_code'])) {
        $stripper->offsetSet('language_code', $stripChainerFactory->get(stripChainers::FILTER_ONLY_LANGUAGE_CODE, $app, $_GET['language_code']));
    }
    $vMachineToolId = NULL;
    if (isset($_GET['machine_tool_id'])) {
        $stripper->offsetSet('machine_tool_id', $stripChainerFactory->get(stripChainers::FILTER_ONLY_NUMBER_ALLOWED, $app, $_GET['machine_tool_id']));
    }
    $vMachineToolPropertyDefinitionId = NULL;
    if (isset($_GET['property_id'])) {
        $stripper->offsetSet('property_id', $stripChainerFactory->get(stripChainers::FILTER_ONLY_NUMBER_ALLOWED, $app, $_GET['property_id']));
    }
    $vUnitId = NULL;
    if (isset($_GET['unit_id'])) {
        $stripper->offsetSet('unit_id', $stripChainerFactory->get(stripChainers::FILTER_ONLY_NUMBER_ALLOWED, $app, $_GET['unit_id']));
    }
    $vPropertyValue = NULL;
    if (isset($_GET['property_value'])) {
        $stripper->offsetSet('property_value', $stripChainerFactory->get(stripChainers::FILTER_PARANOID_LEVEL1, $app, $_GET['property_value']));
    }
    $vPropertyStringValue = NULL;
    if (isset($_GET['property_string_value'])) {
        $stripper->offsetSet('property_string_value', $stripChainerFactory->get(stripChainers::FILTER_PARANOID_LEVEL1, $app, $_GET['property_string_value']));
    }
    $stripper->strip();
    if ($stripper->offsetExists('language_code')) {
        $vLanguageCode = $stripper->offsetGet('language_code')->getFilterValue();
    }
    if ($stripper->offsetExists('machine_tool_id')) {
        $vMachineToolId = $stripper->offsetGet('machine_tool_id')->getFilterValue();
    }
    if ($stripper->offsetExists('property_id')) {
        $vMachineToolPropertyDefinitionId = $stripper->offsetGet('property_id')->getFilterValue();
    }
    if ($stripper->offsetExists('property_value')) {
        $vPropertyValue = $stripper->offsetGet('property_value')->getFilterValue();
    }
    if ($stripper->offsetExists('property_string_value')) {
        $vPropertyStringValue = $stripper->offsetGet('property_string_value')->getFilterValue();
    }
    if ($stripper->offsetExists('unit_id')) {
        $vUnitId = $stripper->offsetGet('unit_id')->getFilterValue();
    }
    $resDataInsert = $BLL->insert(array('language_code' => $vLanguageCode, 'machine_tool_id' => $vMachineToolId, 'machine_tool_property_definition_id' => $vMachineToolPropertyDefinitionId, 'property_value' => $vPropertyValue, 'property_string_value' => $vPropertyStringValue, 'unit_id' => $vUnitId, 'pk' => $pk));
    $app->response()->header("Content-Type", "application/json");
    $app->response()->body(json_encode($resDataInsert));
});
/**
 * Okan CIRAN
 * @since 01-02-2016
 */
$app->get("/pkFillGridSingular_infoUsersCommunications/", function () use($app) {
    $BLL = $app->getBLLManager()->get('infoUsersCommunicationsBLL');
    $headerParams = $app->request()->headers();
    $vPk = $headerParams['X-Public'];
    $fPk = $vPk;
    $vlanguageCode = 'tr';
    if (isset($_GET['language_code'])) {
        $vlanguageCode = strtolower(trim($_GET['language_code']));
    }
    $resDataGrid = $BLL->fillGridSingular(array('pk' => $fPk, 'language_code' => $vlanguageCode));
    $resTotalRowCount = $BLL->fillGridSingularRowTotalCount(array('pk' => $fPk, 'language_code' => $vlanguageCode));
    $flows = array();
    foreach ($resDataGrid as $flow) {
        $flows[] = array("id" => $flow["id"], "profile_public" => $flow["profile_public"], "user_id" => $flow["user_id"], "s_date" => $flow["s_date"], "c_date" => $flow["c_date"], "name" => $flow["name"], "surname" => $flow["surname"], "deleted" => $flow["deleted"], "state_deleted" => $flow["state_deleted"], "active" => $flow["active"], "state_active" => $flow["state_active"], "language_code" => $flow["language_code"], "language_name" => $flow["language_name"], "language_parent_id" => $flow["language_parent_id"], "description" => $flow["description"], "description_eng" => $flow["description_eng"], "op_user_id" => $flow["op_user_id"], "op_username" => $flow["op_username"], "communications_type_id" => $flow["communications_type_id"], "comminication_type" => $flow["comminication_type"], "communications_no" => $flow["communications_no"], "consultant_id" => $flow["consultant_id"], "consultant_confirm_type_id" => $flow["consultant_confirm_type_id"], "consultant_confirm_type" => $flow["consultant_confirm_type"], "confirm_id" => $flow["confirm_id"], "operation_type_id" => $flow["operation_type_id"], "operation_name" => $flow["operation_name"], "default_communication_id" => $flow["default_communication_id"], "attributes" => array("notroot" => true, "active" => $flow["active"]));
    }
    $app->response()->header("Content-Type", "application/json");
    $resultArray = array();
    $resultArray['total'] = $resTotalRowCount[0]['count'];
    $resultArray['rows'] = $flows;
    /* $app->contentType('application/json');
       $app->halt(302, '{"error":"Something went wrong"}');
       $app->stop(); */
    $app->response()->body(json_encode($resultArray));
});
/**
 *  * Okan CIRAN
 * @since 01-02-2016
 */
Exemplo n.º 26
0
$app->add(new \Slim\Middleware\MiddlewareBLLManager());
$app->add(new \Slim\Middleware\MiddlewareDalManager());
$app->add(new \Slim\Middleware\MiddlewareServiceManager());
$app->add(new \Slim\Middleware\MiddlewareMQManager());
/**
 *  * Okan CIRAN
 * @since 26.07.2016
 */
$app->get("/pkFillComboBoxFullAction_sysAclActions/", function () use($app) {
    $BLL = $app->getBLLManager()->get('sysAclActionsBLL');
    $headerParams = $app->request()->headers();
    if (!isset($headerParams['X-Public'])) {
        throw new Exception('rest api "pkFillComboBoxFullAction_sysAclActions" end point, X-Public variable not found');
    }
    //$pk = $headerParams['X-Public'];
    $resCombobox = $BLL->fillComboBoxFullAction();
    $flows = array();
    foreach ($resCombobox as $flow) {
        $flows[] = array("id" => $flow["id"], "text" => html_entity_decode($flow["name"]), "state" => 'open', "checked" => false, "attributes" => array("notroot" => true, "active" => $flow["active"], "module_id" => $flow["module_id"], "module_name" => html_entity_decode($flow["module_name"])));
    }
    $app->response()->header("Content-Type", "application/json");
    $app->response()->body(json_encode($flows));
});
/**
 *  * Okan CIRAN
 * @since 26.07.2016
 */
$app->get("/pkInsert_sysAclActions/", function () use($app) {
    $stripper = $app->getServiceManager()->get('filterChainerCustom');
    $stripChainerFactory = new \Services\Filter\Helper\FilterChainerFactory();
    $BLL = $app->getBLLManager()->get('sysAclActionsBLL');
Exemplo n.º 27
0
 */
$app->get("/fillComboBox_sysborough/", function () use($app) {
    $BLL = $app->getBLLManager()->get('sysBoroughBLL');
    $vLanguageCode = 'tr';
    if (isset($_GET['language_code'])) {
        $vLanguageCode = strtolower(trim($_GET['language_code']));
    }
    $componentType = 'ddslick';
    if (isset($_GET['component_type'])) {
        $componentType = strtolower(trim($_GET['component_type']));
    }
    $resCombobox = $BLL->fillComboBox(array('country_id' => $_GET['country_id'], 'language_code' => $vLanguageCode, 'city_id' => $_GET['city_id']));
    $menus = array();
    if ($componentType == 'bootstrap') {
        foreach ($resCombobox as $menu) {
            $menus[] = array("id" => $menu["id"], "name" => $menu["name"]);
        }
    } else {
        if ($componentType == 'ddslick') {
            $menus[] = array("text" => "Lütfen Seçiniz", "value" => 0, "selected" => true, "imageSrc" => "", "description" => "Lütfen Seçiniz");
            foreach ($resCombobox as $menu) {
                $menus[] = array("text" => $menu["name"], "value" => intval($menu["id"]), "selected" => false, "description" => $menu["name_eng"]);
            }
        }
    }
    $app->response()->header("Content-Type", "application/json");
    /*$app->contentType('application/json');
      $app->halt(302, '{"error":"Something went wrong"}');
      $app->stop();*/
    $app->response()->body(json_encode($menus));
});
$app->run();
Exemplo n.º 28
0
$app->add(new \Slim\Middleware\MiddlewareServiceManager());
$app->add(new \Slim\Middleware\MiddlewareMQManager());
/**
 *  * Okan CIRAN
 * @since 25-01-2016
 */
$app->get("/pkFillGrid_infoUsers/", function () use($app) {
    $BLL = $app->getBLLManager()->get('infoUsersBLL');
    $headerParams = $app->request()->headers();
    $vPk = $headerParams['X-Public'];
    $vPkTemp = $headerParams['X-Public-Temp'];
    $resDataGrid = $BLL->fillGrid(array('page' => $_GET['page'], 'rows' => $_GET['rows'], 'sort' => $_GET['sort'], 'order' => $_GET['order'], 'search_name' => $vSearchName, 'pk' => $pk, 'pktemp' => $vPkTemp));
    $resTotalRowCount = $BLL->fillGridRowTotalCount(array('search_name' => $vSearchName));
    $flows = array();
    foreach ($resDataGrid as $flow) {
        $flows[] = array("id" => $flow["id"], "profile_public" => $flow["profile_public"], "f_check" => $flow["f_check"], "s_date" => $flow["s_date"], "c_date" => $flow["c_date"], "operation_type_id" => $flow["operation_type_id"], "operation_name" => $flow["operation_name"], "name" => $flow["name"], "surname" => $flow["surname"], "username" => $flow["username"], "auth_email" => $flow["auth_email"], "language_code" => $flow["language_code"], "language_name" => $flow["language_name"], "state_deleted" => $flow["state_deleted"], "active" => $flow["active"], "state_active" => $flow["state_active"], "deleted" => $flow["deleted"], "user_id" => $flow["user_id"], "username" => $flow["username"], "act_parent_id" => $flow["act_parent_id"], "auth_allow_id" => $flow["auth_allow_id"], "auth_alow" => $flow["auth_alow"], "cons_allow_id" => $flow["cons_allow_id"], "attributes" => array("notroot" => true, "active" => $flow["active"]));
    }
    $app->response()->header("Content-Type", "application/json");
    $resultArray = array();
    $resultArray['total'] = $resTotalRowCount[0]['count'];
    $resultArray['rows'] = $flows;
    /* $app->contentType('application/json');
       $app->halt(302, '{"error":"Something went wrong"}');
       $app->stop(); */
    $app->response()->body(json_encode($resultArray));
});
/**
 *  * Okan CIRAN
 * @since 25-01-2016
 */
$app->get("/pkInsert_infoUsers/", function () use($app) {
    $BLL = $app->getBLLManager()->get('infoUsersBLL');
$app->get("/pkFillSingularFirmMachineTools_infoFirmMachineTool/", function () use($app) {
    $BLL = $app->getBLLManager()->get('infoFirmMachineToolBLL');
    $headerParams = $app->request()->headers();
    $sort = null;
    if (isset($_GET['sort'])) {
        $sort = $_GET['sort'];
    }
    $order = null;
    if (isset($_GET['order'])) {
        $order = $_GET['order'];
    }
    $rows = 10;
    if (isset($_GET['rows'])) {
        $rows = $_GET['rows'];
    }
    $page = 1;
    if (isset($_GET['page'])) {
        $page = $_GET['page'];
    }
    $filterRules = null;
    if (isset($_GET['filterRules'])) {
        $filterRules = $_GET['filterRules'];
    }
    if (!isset($headerParams['X-Public'])) {
        throw new Exception('rest api "pkFillSingularFirmMachineTools_infoFirmMachineTool" end point, X-Public variable not found');
    }
    $pk = $headerParams['X-Public'];
    $vLanguageCode = 'tr';
    if (isset($_GET['language_code'])) {
        $vLanguageCode = strtolower(trim($_GET['language_code']));
    }
    $resDataGrid = $BLL->fillSingularFirmMachineTools(array('language_code' => $vLanguageCode, 'page' => $page, 'rows' => $rows, 'sort' => $sort, 'order' => $order, 'pk' => $pk, 'filterRules' => $filterRules));
    $resTotalRowCount = $BLL->fillSingularFirmMachineToolsRtc(array('pk' => $pk, 'language_code' => $vLanguageCode));
    $flows = array();
    foreach ($resDataGrid['resultSet'] as $flow) {
        $flows[] = array("id" => $flow["id"], "s_date" => $flow["s_date"], "c_date" => $flow["c_date"], "firm_id" => $flow["firm_id"], "firm_name" => $flow["firm_name"], "sys_machine_tool_id" => $flow["sys_machine_tool_id"], "machine_tool_names" => $flow["machine_tool_names"], "machine_tool_name_eng" => $flow["machine_tool_name_eng"], "profile_public" => $flow["profile_public"], "state_profile_public" => $flow["state_profile_public"], "operation_type_id" => $flow["operation_type_id"], "operation_name" => $flow["operation_name"], "act_parent_id" => $flow["act_parent_id"], "language_parent_id" => $flow["language_parent_id"], "owner_id" => $flow["owner_id"], "owner_username" => $flow["owner_username"], "cons_allow_id" => $flow["cons_allow_id"], "cons_allow" => $flow["cons_allow"], "availability_id" => $flow["availability_id"], "state_availability" => $flow["state_availability"], "deleted" => $flow["deleted"], "state_deleted" => $flow["state_deleted"], "active" => $flow["active"], "state_active" => $flow["state_active"], "language_code" => $flow["language_code"], "language_id" => $flow["language_id"], "language_name" => $flow["language_name"], "language_parent_id" => $flow["language_parent_id"], "op_user_id" => $flow["op_user_id"], "op_user_name" => $flow["op_user_name"], "attributes" => array("notroot" => true, "active" => $flow["active"]));
    }
    $app->response()->header("Content-Type", "application/json");
    $resultArray = array();
    $resultArray['total'] = $resTotalRowCount['resultSet'][0]['count'];
    $resultArray['rows'] = $flows;
    /* $app->contentType('application/json');
       $app->halt(302, '{"error":"Something went wrong"}');
       $app->stop(); */
    $app->response()->body(json_encode($resultArray));
});
Exemplo n.º 30
0
$app->get("/fillComboBox_syslanguage/", function () use($app) {
    $BLL = $app->getBLLManager()->get('sysLanguageBLL');
    $componentType = 'bootstrap';
    if (isset($_GET['component_type'])) {
        $componentType = strtolower(trim($_GET['component_type']));
    }
    $resCombobox = $BLL->fillComboBox();
    if ($componentType == 'bootstrap') {
        $menus = array();
        foreach ($resCombobox as $menu) {
            $menus[] = array("id" => $menu["id"], "language" => $menu["language"], "language_eng" => $menu["language_eng"], "language_main_code" => $menu["language_main_code"]);
        }
    } else {
        if ($componentType == 'ddslick') {
            $menus = array();
            $menus[] = array("text" => "Lütfen Bir Dil Seçiniz", "value" => -1, "selected" => true);
            foreach ($resCombobox as $menu) {
                $menus[] = array("text" => $menu["language"], "value" => $menu["id"], "selected" => false, "description" => $menu["language_eng"], "imageSrc" => "");
            }
        }
    }
    $app->response()->header("Content-Type", "application/json");
    if ($componentType == 'ddslick') {
        $app->response()->body(json_encode($menus));
    } else {
        if ($componentType == 'bootstrap') {
            $app->response()->body(json_encode($resCombobox));
        }
    }
    //$app->response()->body(json_encode($menus));
});