当前位置: 首页>>代码示例>>PHP>>正文


PHP Dal\Helper类代码示例

本文整理汇总了PHP中Utill\Dal\Helper的典型用法代码示例。如果您正苦于以下问题:PHP Helper类的具体用法?PHP Helper怎么用?PHP Helper使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Helper类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: delete

 /**    
  * @author Okan CIRAN
  * @ sys_village tablosundan parametre olarak  gelen id kaydını siler. !!
  * @version v 1.0  07.12.2015
  * @param type $params
  * @return array
  * @throws \PDOException
  */
 public function delete($params = array())
 {
     try {
         $pdo = $this->slimApp->getServiceManager()->get('pgConnectFactory');
         $pdo->beginTransaction();
         $userId = $this->getUserId(array('pk' => $params['pk']));
         if (\Utill\Dal\Helper::haveRecord($userId)) {
             $userIdValue = $userId['resultSet'][0]['user_id'];
             $statement = $pdo->prepare(" \n                UPDATE sys_village\n                SET  deleted= 1 , active = 1 ,\n                     op_user_id = " . $userIdValue . "     \n                WHERE id = :id");
             //Execute our DELETE statement.
             $update = $statement->execute();
             $afterRows = $statement->rowCount();
             $errorInfo = $statement->errorInfo();
             if ($errorInfo[0] != "00000" && $errorInfo[1] != NULL && $errorInfo[2] != NULL) {
                 throw new \PDOException($errorInfo[0]);
             }
             $pdo->commit();
             return array("found" => true, "errorInfo" => $errorInfo, "affectedRowsCount" => $afterRows);
         } else {
             $errorInfo = '23502';
             /// 23502  not_null_violation
             $pdo->rollback();
             return array("found" => true, "errorInfo" => $errorInfo, "resultSet" => '');
         }
     } catch (\PDOException $e) {
         $pdo->rollback();
         return array("found" => false, "errorInfo" => $e->getMessage());
     }
 }
开发者ID:kuisatz,项目名称:Slim_UstalarMerkezi,代码行数:37,代码来源:SysVillage.php

示例2: insert

 /**   
  * @author Okan CIRAN
  * @ connection_log tablosuna yeni bir kayıt oluşturur.  !!
  * @version v 1.0  10.03.2016
  * @param type $params
  * @return array
  * @throws \PDOException
  */
 public function insert($params = array())
 {
     try {
         $pdo = $this->slimApp->getServiceManager()->get('pgConnectLogFactory');
         $pdo->beginTransaction();
         $userId = InfoUsers::getUserId(array('pk' => $params['pk']));
         if (\Utill\Dal\Helper::haveRecord($userId)) {
             $userIdValue = $userId['resultSet'][0]['user_id'];
             $addSql = " op_user_id,";
             $addSqlValue = " " . intval($userIdValue) . ", ";
         }
         $sql = "\n                INSERT INTO connection_log(\n                       pk, \n                       type_id,\n                       log_datetime,\n                       url, \n                       path, \n                       ip, \n                       params,\n                       " . $addSql . " \n                       method\n                       \n                       )\n                VALUES (\n                        :pk,\n                        :type_id,\n                        :log_datetime,\n                        :url, \n                        :path, \n                        :ip, \n                        :params,\n                        " . $addSqlValue . " \n                        :method                       \n                                             )   ";
         $statement = $pdo->prepare($sql);
         $statement->bindValue(':pk', $params['pk'], \PDO::PARAM_STR);
         $statement->bindValue(':type_id', $params['type_id'], \PDO::PARAM_INT);
         $statement->bindValue(':log_datetime', $params['log_datetime'], \PDO::PARAM_STR);
         $statement->bindValue(':url', $params['url'], \PDO::PARAM_STR);
         $statement->bindValue(':path', $params['path'], \PDO::PARAM_STR);
         $statement->bindValue(':ip', $params['ip'], \PDO::PARAM_STR);
         $statement->bindValue(':params', $params['params'], \PDO::PARAM_STR);
         $statement->bindValue(':method', $params['method'], \PDO::PARAM_STR);
         echo debugPDO($sql, $params);
         $result = $statement->execute();
         $insertID = $pdo->lastInsertId('connection_log_id_seq');
         $errorInfo = $statement->errorInfo();
         if ($errorInfo[0] != "00000" && $errorInfo[1] != NULL && $errorInfo[2] != NULL) {
             throw new \PDOException($errorInfo[0]);
         }
         $pdo->commit();
         return array("found" => true, "errorInfo" => $errorInfo, "lastInsertId" => $insertID);
     } catch (\PDOException $e) {
         $pdo->rollback();
         return array("found" => false, "errorInfo" => $e->getMessage());
     }
 }
开发者ID:kuisatz,项目名称:Slim_UstalarMerkezi,代码行数:43,代码来源:LogConnection.php

示例3: fillMachineToolGroupPropertyDefinitions

 /**
  * user interface fill operation   
  * @author Okan CIRAN
  * @ tree doldurmak için sys_machine_tool_property_definition tablosundan machine_tool_grup_id si
  * verilen kayıtları döndürür !! machine_tool_grup_id değeri boş yada bulunamazsa tüm kayıtları döndürür.
  * @version v 1.0  17.02.2016
  * @param array | null $args
  * @return array
  * @throws \PDOException
  */
 public function fillMachineToolGroupPropertyDefinitions($params = array())
 {
     try {
         $pdo = $this->getServiceLocator()->get('pgConnectFactory');
         $machineToolGrupId = 0;
         $whereSql = " WHERE a.deleted = 0 ";
         if (isset($params['machine_tool_grup_id']) && $params['machine_tool_grup_id'] != "") {
             $machineToolGrupId = $params['machine_tool_grup_id'];
             $whereSql .= " AND a.machine_tool_grup_id = " . $machineToolGrupId . "   ";
         } else {
             $whereSql .= "";
         }
         $languageId = SysLanguage::getLanguageId(array('language_code' => $params['language_code']));
         if (\Utill\Dal\Helper::haveRecord($languageId)) {
             $languageIdValue = $languageId['resultSet'][0]['id'];
         } else {
             $languageIdValue = 647;
         }
         $whereSql .= " AND a.language_id = " . intval($languageIdValue);
         $statement = $pdo->prepare("                \n                  SELECT                    \n                    a.id, \n                    COALESCE(NULLIF(a.property_name, ''), a.property_name_eng) AS name,            \n                    a.property_name_eng as name_eng,\n                    a.unit_grup_id,\n                    a.active ,                    \n                    'open' AS state_type,\n                    'false' AS root_type \n                FROM sys_machine_tool_property_definition a       \n                " . $whereSql . "    \n                ORDER BY name      \n                           \n                                 ");
         $statement->execute();
         $result = $statement->fetchAll(\PDO::FETCH_ASSOC);
         $errorInfo = $statement->errorInfo();
         if ($errorInfo[0] != "00000" && $errorInfo[1] != NULL && $errorInfo[2] != NULL) {
             throw new \PDOException($errorInfo[0]);
         }
         return array("found" => true, "errorInfo" => $errorInfo, "resultSet" => $result);
     } catch (\PDOException $e) {
         return array("found" => false, "errorInfo" => $e->getMessage());
     }
 }
开发者ID:corner82,项目名称:RabbitMQ_SanalFabrika,代码行数:41,代码来源:SysMachineToolPropertyDefinition.php

示例4: makeActiveOrPassive

 /**
  * @author Okan CIRAN
  * @ sys_osb_person tablosundan parametre olarak  gelen id kaydın aktifliğini
  *  0(aktif) ise 1 , 1 (pasif) ise 0  yapar. !!
  * @version v 1.0  29.08.2016
  * @param type $params
  * @return array
  * @throws \PDOException
  */
 public function makeActiveOrPassive($params = array())
 {
     try {
         $pdo = $this->slimApp->getServiceManager()->get('pgConnectFactory');
         $pdo->beginTransaction();
         $opUserId = InfoUsers::getUserId(array('pk' => $params['pk']));
         if (\Utill\Dal\Helper::haveRecord($opUserId)) {
             $opUserIdValue = $opUserId['resultSet'][0]['user_id'];
             if (isset($params['id']) && $params['id'] != "") {
                 $sql = "                 \n                UPDATE sys_osb_person\n                SET active = (  SELECT   \n                                CASE active\n                                    WHEN 0 THEN 1\n                                    ELSE 0\n                                END activex\n                                FROM sys_osb_person\n                                WHERE id = " . intval($params['id']) . "\n                ),\n                op_user_id = " . intval($opUserIdValue) . "\n                WHERE id = " . intval($params['id']);
                 $statement = $pdo->prepare($sql);
                 //  echo debugPDO($sql, $params);
                 $update = $statement->execute();
                 $afterRows = $statement->rowCount();
                 $errorInfo = $statement->errorInfo();
                 if ($errorInfo[0] != "00000" && $errorInfo[1] != NULL && $errorInfo[2] != NULL) {
                     throw new \PDOException($errorInfo[0]);
                 }
             }
             $xc = $this->makeActiveOrPassiveInfoUsers(array('id' => $params['id'], 'op_user_id' => $opUserIdValue));
             if ($xc['errorInfo'][0] != "00000" && $xc['errorInfo'][1] != NULL && $xc['errorInfo'][2] != NULL) {
                 throw new \PDOException($xc['errorInfo']);
             }
             $pdo->commit();
             return array("found" => true, "errorInfo" => $errorInfo, "affectedRowsCount" => $afterRows);
         } else {
             $errorInfo = '23502';
             // 23502  not_null_violation
             $errorInfoColumn = 'pk';
             $pdo->rollback();
             return array("found" => false, "errorInfo" => $errorInfo, "resultSet" => '', "errorInfoColumn" => $errorInfoColumn);
         }
     } catch (\PDOException $e) {
         $pdo->rollback();
         return array("found" => false, "errorInfo" => $e->getMessage());
     }
 }
开发者ID:corner82,项目名称:Slim_SanalFabrika,代码行数:46,代码来源:SysOsbPerson.php

示例5: getConsultantOperation

 /**
  * 
  * @author Okan CIRAN
  * @ public key e ait danışmanın gerçekleştirdiği operasyonları ve adetlerinin döndürür  !!
  * @version v 1.0  08.03.2016
  * @param array | null $args
  * @return array
  * @throws \PDOException
  */
 public function getConsultantOperation($params = array())
 {
     try {
         $pdo = $this->slimApp->getServiceManager()->get('pgConnectFactory');
         $opUserId = InfoUsers::getUserId(array('pk' => $params['pk']));
         if (\Utill\Dal\Helper::haveRecord($opUserId)) {
             $opUserIdValue = $opUserId['resultSet'][0]['user_id'];
             //// su anda kullanılmıyor.
             $sql = "     \n               SELECT count(a.id) AS adet , \n                    a.operation_type_id,\n                    op.operation_name as aciklama\n                FROM sys_activation_report a    \n                INNER JOIN sys_operation_types op ON op.parent_id = 2 AND op.id = a.operation_type_id  AND op.deleted =0 AND op.active =0\n                INNER JOIN sys_language l ON l.language_main_code = a.language_code AND l.deleted =0 AND l.active =0 \n                INNER JOIN info_users u ON u.id = a.op_user_id      \n                INNER JOIN sys_acl_roles acl ON acl.id = u.role_id  \n                WHERE \n                    a.op_user_id = " . intval($opUserIdValue) . "\n                GROUP BY a.operation_type_id, op.operation_name\n                ORDER BY op.operation_name\n                    ";
             $statement = $pdo->prepare($sql);
             // echo debugPDO($sql, $params);
             $statement->execute();
             $result = $statement->fetchAll(\PDO::FETCH_CLASS);
             $errorInfo = $statement->errorInfo();
             if ($errorInfo[0] != "00000" && $errorInfo[1] != NULL && $errorInfo[2] != NULL) {
                 throw new \PDOException($errorInfo[0]);
             }
             //return array("found" => true, "errorInfo" => $errorInfo, "resultSet" => $result);
             return json_encode($result);
         } else {
             $errorInfo = '23502';
             // 23502  not_null_violation
             $errorInfoColumn = 'pk';
             return array("found" => true, "errorInfo" => $errorInfo, "resultSet" => '', "errorInfoColumn" => $errorInfoColumn);
         }
     } catch (\PDOException $e) {
         //  $pdo->rollback();
         return array("found" => false, "errorInfo" => $e->getMessage());
     }
 }
开发者ID:kuisatz,项目名称:Slim_UstalarMerkezi,代码行数:39,代码来源:BlAdminActivationReport.php

示例6: deletedAct

 /**
  * @param type $id
  * @param type $params
  * @return array
  * @throws PDOException
  */
 public function deletedAct($params = array())
 {
     try {
         $pdo = $this->getServiceLocator()->get('pgConnectFactory');
         $pdo->beginTransaction();
         $userId = $this->getUserId(array('pk' => $params['pk']));
         if (\Utill\Dal\Helper::haveRecord($userId)) {
             $userIdValue = $userId['resultSet'][0]['user_id'];
             $this->setUserDetailsDisables(array('id' => $userIdValue));
             $this->makeUserDeleted(array('id' => $userIdValue));
             $sql = " \n                    INSERT INTO info_users_detail(\n                           profile_public,   \n                           f_check,\n                           s_date,\n                           c_date,\n                           operation_type_id, \n                           name,\n                           surname,                                                                        \n                           auth_email,  \n                           act_parent_id,\n                           auth_allow_id,\n                           cons_allow_id,\n                           language_code,\n                           language_id,\n                           root_id,\n                           op_user_id,\n                           language_id,\n                           password,                           \n                           active,\n                           deleted,\n                            ) \n                           SELECT \n                                profile_public,                           \n                                f_check,   \n                                s_date,                              \n                                timezone('Europe/Istanbul'::text, ('now'::text)::timestamp(0) with time zone) , \n                                3,\n                                name,\n                                surname,                                                                        \n                                auth_email,  \n                                act_parent_id,\n                                auth_allow_id,\n                                cons_allow_id,\n                                language_code,\n                                language_id,\n                                root_id,                               \n                                " . intval($userIdValue) . " AS op_user_id,\n                                language_id,\n                                password,   \n                               1,\n                               1\n                            FROM info_users_detail \n                            WHERE root_id  =" . intval($userIdValue) . " \n                                AND active =0 AND deleted =0 \n \n                    ";
             $insert_act_insert = $statement_act_insert->execute();
             $affectedRows = $statement_act_insert->rowCount();
             $errorInfo = $statement_act_insert->errorInfo();
             if ($errorInfo[0] != "00000" && $errorInfo[1] != NULL && $errorInfo[2] != NULL) {
                 throw new \PDOException($errorInfo[0]);
             }
             $pdo->commit();
             return array("found" => true, "errorInfo" => $errorInfo, "affectedRowsCount" => $affectedRows);
         } else {
             $errorInfo = '23502';
             /// 23502  not_null_violation
             $pdo->rollback();
             return array("found" => true, "errorInfo" => $errorInfo, "resultSet" => '');
         }
     } catch (\PDOException $e) {
         $pdo->rollback();
         return array("found" => false, "errorInfo" => $e->getMessage());
     }
 }
开发者ID:corner82,项目名称:RabbitMQ_SanalFabrika,代码行数:36,代码来源:InfoUsers.php

示例7: deletedActTemp

 /**
  * @author Okan CIRAN     
  * @ info_users_addresses tablosundan parametre olarak  gelen id kaydın active alanını 1 yapar ve 
  * yeni yeni kayıt oluşturarak deleted ve active = 1 olarak  yeni kayıt yapar. ! 
  * @version v 1.0  02.02.2016
  * @param array | null $args
  * @return array
  * @throws \PDOException
  */
 public function deletedActTemp($params = array())
 {
     try {
         $pdo = $this->getServiceLocator()->get('pgConnectFactory');
         $pdo->beginTransaction();
         $userId = InfoUsers::getUserIdTemp(array('pktemp' => $params['pktemp']));
         if (\Utill\Dal\Helper::haveRecord($userId)) {
             $userIdValue = $userId['resultSet'][0]['user_id'];
             $addSql = "";
             $addSqlValue = "";
             if (isset($params['act_parent_id'])) {
                 $act_parent_id = intval($params['act_parent_id']);
                 $addSql .= " act_parent_id, ";
                 if ($act_parent_id == 0) {
                     $act_parent_id = intval($params['id']);
                 }
                 $addSqlValue .= intval($act_parent_id) . ", ";
             }
             if (isset($params['operation_type_id'])) {
                 $addSql .= " operation_type_id, ";
                 $addSqlValue .= intval($params['operation_type_id']) . ", ";
             }
             $this->makePassive(array('id' => $params['id']));
             $statementInsert = $pdo->prepare(" \n                    INSERT INTO info_users_addresses (\n                        user_id,                        \n                        active, \n                        deleted,\n                        op_user_id, \n                        " . $addSql . "\n                        \n                        language_code, \n                        language_id,\n                        address_type_id, \n                        address1, \n                        address2, \n                        postal_code, \n                        country_id, \n                        city_id, \n                        borough_id, \n                        city_name, \n                        description, \n                        description_eng\n                        profile_public,\n                        \n                        f_check, \n                        consultant_id,\n                        consultant_confirm_type_id, \n                        confirm_id,                        \n                        language_parent_id ,\n                        history_parent_id,\n                        consultant_id,\n                        consultant_confirm_type_id,\n                        confirm_id,\n                        act_parent_id\n                        )    \n                        \n                    SELECT\n                        user_id,\n                        1 AS active,  \n                        1 AS deleted, \n                        " . intval($userIdValue) . " AS op_user_id,  \n                        " . $addSqlValue . " \n                            \n                        language_code, \n                        language_id,\n                        address_type_id, \n                        address1, \n                        address2, \n                        postal_code, \n                        country_id, \n                        city_id, \n                        borough_id, \n                        city_name, \n                        description, \n                        description_eng\n                        profile_public,    \n\n                        f_check,                \n                        consultant_id, \n                        consultant_confirm_type_id, \n                        confirm_id,                        \n                        language_parent_id ,\n                        history_parent_id,\n                        consultant_id,\n                        consultant_confirm_type_id,\n                        confirm_id,\n                        act_parent_id\n                    FROM info_users_addresses \n                    WHERE id  =" . intval($params['id']) . "    \n                    )");
             $insertAct = $statementInsert->execute();
             $affectedRows = $statementInsert->rowCount();
             $errorInfo = $statementInsert->errorInfo();
             if ($errorInfo[0] != "00000" && $errorInfo[1] != NULL && $errorInfo[2] != NULL) {
                 throw new \PDOException($errorInfo[0]);
             }
             $pdo->commit();
             return array("found" => true, "errorInfo" => $errorInfo, "affectedRowsCount" => $affectedRows);
         } else {
             $errorInfo = '23502';
             /// 23502  not_null_violation
             $errorInfoColumn = 'pk / op_user_id';
             $pdo->rollback();
             return array("found" => true, "errorInfo" => $errorInfo, "resultSet" => '', "errorInfoColumn" => $errorInfoColumn);
         }
     } catch (\PDOException $e) {
         $pdo->rollback();
         return array("found" => false, "errorInfo" => $e->getMessage());
     }
 }
开发者ID:corner82,项目名称:RabbitMQ_SanalFabrika,代码行数:53,代码来源:InfoUsersAddresses.php

示例8: update

 /**
  * @author Okan CIRAN
  * sys_acl_roles tablosuna parametre olarak gelen id deki kaydın bilgilerini günceller   !!
  * @version v 1.0  07.01.2016
  * @param type $params
  * @return array
  * @throws \PDOException
  */
 public function update($params = array())
 {
     try {
         $pdo = $this->slimApp->getServiceManager()->get('pgConnectFactory');
         $pdo->beginTransaction();
         $kontrol = $this->haveRecords($params);
         if (!\Utill\Dal\Helper::haveRecord($kontrol)) {
             $sql = "\n                UPDATE sys_acl_roles\n                SET   \n                    name = :name,                  \n                    user_id = :user_id                    \n                WHERE id = " . intval($params['id']);
             $statement = $pdo->prepare($sql);
             $statement->bindValue(':name', $params['name'], \PDO::PARAM_STR);
             $statement->bindValue(':user_id', $params['user_id'], \PDO::PARAM_INT);
             $update = $statement->execute();
             $affectedRows = $statement->rowCount();
             $errorInfo = $statement->errorInfo();
             if ($errorInfo[0] != "00000" && $errorInfo[1] != NULL && $errorInfo[2] != NULL) {
                 throw new \PDOException($errorInfo[0]);
             }
             $pdo->commit();
             return array("found" => true, "errorInfo" => $errorInfo, "affectedRowsCount" => $affectedRows);
         } else {
             // 23505 	unique_violation
             $errorInfo = '23505';
             // $kontrol ['resultSet'][0]['message'];
             $pdo->rollback();
             $result = $kontrol;
             return array("found" => true, "errorInfo" => $errorInfo, "resultSet" => '');
         }
     } catch (\PDOException $e) {
         $pdo->rollback();
         return array("found" => false, "errorInfo" => $e->getMessage());
     }
 }
开发者ID:kuisatz,项目名称:Slim_UstalarMerkezi,代码行数:40,代码来源:SysAclRoles.php

示例9: getConsWaitingForConfirm

 /**
  * 
  * @author Okan CIRAN
  * @ Danışmanın onay bekleyen firmalarının bilgilerini döndürür  !!
  * @version v 1.0  05.02.2016
  * @param array | null $args
  * @return array
  * @throws \PDOException
  */
 public function getConsWaitingForConfirm($params = array())
 {
     try {
         $pdo = $this->getServiceLocator()->get('pgConnectFactory');
         $opUserId = InfoUsers::getUserId(array('pk' => $params['pk']));
         if (\Utill\Dal\Helper::haveRecord($opUserId)) {
             $opUserIdValue = $opUserId['resultSet'][0]['user_id'];
             $sql = "                   \n               SELECT \n                    aciklama , \n                    CASE\n                        WHEN sure_int > 50000 THEN CAST(SUBSTRING(sure FROM 1 FOR POSITION(' ' IN sure )-1 ) AS integer)\n                    ELSE 0 \n                    END AS sure\n                FROM (\n                    SELECT a.id,\n                        EXTRACT(EPOCH FROM age(a.s_date)) AS sure_int,  \n\t\t\ta.firm_name AS aciklama, \n                       CAST(CURRENT_TIMESTAMP - a.s_date AS VARCHAR(20)) AS sure\n                    FROM  info_firm_profile a                 \n                    INNER JOIN info_users u ON u.id = a.consultant_id   \n                    INNER JOIN sys_operation_types op ON op.parent_id = 1 AND a.operation_type_id = op.id AND op.active = 0 AND op.deleted =0\n                    WHERE \n                        a.consultant_id = " . intval($opUserIdValue) . "                     \n                    ) AS asdasd\n                ORDER BY sure DESC\n                LIMIT 6\n  \n                    ";
             $statement = $pdo->prepare($sql);
             // echo debugPDO($sql, $params);
             $statement->execute();
             $result = $statement->fetchAll(\PDO::FETCH_CLASS);
             $errorInfo = $statement->errorInfo();
             if ($errorInfo[0] != "00000" && $errorInfo[1] != NULL && $errorInfo[2] != NULL) {
                 throw new \PDOException($errorInfo[0]);
             }
             //return array("found" => true, "errorInfo" => $errorInfo, "resultSet" => $result);
             return json_encode($result);
         } else {
             $errorInfo = '23502';
             // 23502  not_null_violation
             $errorInfoColumn = 'pk';
             return array("found" => true, "errorInfo" => $errorInfo, "resultSet" => '', "errorInfoColumn" => $errorInfoColumn);
         }
     } catch (\PDOException $e) {
         return array("found" => false, "errorInfo" => $e->getMessage());
     }
 }
开发者ID:corner82,项目名称:RabbitMQ_SanalFabrika,代码行数:37,代码来源:BlActivationReport.php

示例10: fillFirmWorkingPersonalListGridRtc


//.........这里部分代码省略.........
                 if ($std['value'] != null) {
                     switch (trim($std['field'])) {
                         case 'name':
                             $sorguExpression = ' ILIKE \'%' . $std['value'] . '%\' ';
                             $sorguStr .= " AND name" . $sorguExpression . ' ';
                             break;
                         case 'surname':
                             $sorguExpression = ' ILIKE \'%' . $std['value'] . '%\' ';
                             $sorguStr .= " AND surname" . $sorguExpression . ' ';
                             break;
                         case 'positions':
                             $sorguExpression = ' ILIKE \'%' . $std['value'] . '%\'  ';
                             $sorguStr .= " AND positions" . $sorguExpression . ' ';
                             break;
                         case 'positions_eng':
                             $sorguExpression = ' ILIKE \'%' . $std['value'] . '%\'  ';
                             $sorguStr .= " AND positions_eng" . $sorguExpression . ' ';
                             break;
                         case 'title':
                             $sorguExpression = ' ILIKE \'%' . $std['value'] . '%\'  ';
                             $sorguStr .= " AND title" . $sorguExpression . ' ';
                             break;
                         case 'title_eng':
                             $sorguExpression = ' ILIKE \'%' . $std['value'] . '%\'  ';
                             $sorguStr .= " AND title_eng" . $sorguExpression . ' ';
                             break;
                         case 'sex_name':
                             $sorguExpression = ' ILIKE \'%' . $std['value'] . '%\'  ';
                             $sorguStr .= " AND sex_name" . $sorguExpression . ' ';
                             break;
                         case 'op_user_name':
                             $sorguExpression = ' ILIKE \'%' . $std['value'] . '%\'  ';
                             $sorguStr .= " AND op_user_name" . $sorguExpression . ' ';
                             break;
                         case 'state_profile_public':
                             $sorguExpression = ' ILIKE \'%' . $std['value'] . '%\'  ';
                             $sorguStr .= " AND state_profile_public" . $sorguExpression . ' ';
                             break;
                         default:
                             break;
                     }
                 }
             }
         } else {
             $sorguStr = null;
             $filterRules = "";
             if (isset($params['name']) && $params['name'] != "") {
                 $sorguStr .= " AND a.name Like '%" . $params['name'] . "%'";
             }
             if (isset($params['surname']) && $params['surname'] != "") {
                 $sorguStr .= " AND surname Like '%" . $params['surname'] . "%'";
             }
             if (isset($params['positions']) && $params['positions'] != "") {
                 $sorguStr .= " AND positions Like '%" . $params['positions'] . "%'";
             }
             if (isset($params['positions_eng']) && $params['positions_eng'] != "") {
                 $sorguStr .= " AND positions_eng Like '%" . $params['positions_eng'] . "%'";
             }
             if (isset($params['title']) && $params['title'] != "") {
                 $sorguStr .= " AND title Like '%" . $params['title'] . "%'";
             }
             if (isset($params['title_eng']) && $params['title_eng'] != "") {
                 $sorguStr .= " AND title_eng Like '%" . $params['title_eng'] . "%'";
             }
             if (isset($params['sex_id']) && $params['sex_id'] != "") {
                 $sorguStr .= " AND sex_id = " . intval($params['sex_id']);
             }
             if (isset($params['profile_public']) && $params['profile_public'] != "") {
                 $sorguStr .= " AND profile_public = " . intval($params['profile_public']);
             }
             if (isset($params['active']) && $params['active'] != "") {
                 $sorguStr .= " AND active = " . intval($params['active']);
             }
             if (isset($params['op_user_name']) && $params['op_user_name'] != "") {
                 $sorguStr .= " AND op_user_name Like '%" . $params['op_user_name'] . "%'";
             }
         }
         $sorguStr = rtrim($sorguStr, "AND ");
         $languageId = NULL;
         $languageIdValue = 647;
         if (isset($params['language_code']) && $params['language_code'] != "") {
             $languageId = SysLanguage::getLanguageId(array('language_code' => $params['language_code']));
             if (\Utill\Dal\Helper::haveRecord($languageId)) {
                 $languageIdValue = $languageId['resultSet'][0]['id'];
             }
         }
         $sql = " \n                SELECT COUNT(id) AS count \n                FROM (               \n                   SELECT \n                        a.id,\n                        a.firm_id,\t\t\t\t\n\t\t\ta.name, \n\t\t\ta.surname, \t\t\t \n\t\t\tCOALESCE(NULLIF(ax.positions, ''), a.positions_eng) AS positions,\n\t\t\ta.positions_eng,\n\t\t\tCOALESCE(NULLIF(ax.title, ''), a.title_eng) AS title,\n\t\t\ta.title_eng,\n\t\t\ta.sex_id,\t\t\n\t\t\tCOALESCE(NULLIF(sd3x.description, ''), sd3.description_eng) AS sex_name,\n\t\t\ta.s_date,\n                        a.c_date,\n                        a.profile_public,\n                        COALESCE(NULLIF(sd19x.description, ''), sd19.description_eng) AS state_profile_public,\n                        a.operation_type_id,\n                        COALESCE(NULLIF(opx.operation_name, ''), op.operation_name_eng) AS operation_name,\n\t\t\ta.act_parent_id,\n                        COALESCE(NULLIF(lx.id, NULL), 385) AS language_id,\n\t\t        COALESCE(NULLIF(lx.language, ''), 'en') AS language_name,\n                        a.active,\n                        COALESCE(NULLIF(sd16x.description, ''), sd16.description_eng) AS state_active,\n                        a.deleted,\n\t\t\tCOALESCE(NULLIF(sd15x.description, ''), sd15.description_eng) AS state_deleted,\n                        a.op_user_id,\n                        u.username AS op_user_name,\n\t\t\ta.consultant_id, \n\t\t\ta.consultant_confirm_type_id, \n\t\t\ta.confirm_id,\n                        a.cons_allow_id,\n                        COALESCE(NULLIF(sd14x.description, ''), sd14.description_eng) AS cons_allow\n                    FROM info_firm_working_personnel a\n                    INNER JOIN info_users u ON u.id = a.op_user_id\n                    INNER JOIN info_firm_profile fp ON fp.act_parent_id = a.firm_id AND fp.active = 0 AND fp.deleted = 0 AND fp.language_parent_id =0\n                    INNER JOIN sys_language l ON l.id = fp.language_id AND l.deleted =0 AND l.active =0\n                    LEFT JOIN sys_language lx ON lx.id = " . intval($languageIdValue) . " AND lx.deleted =0 AND lx.active =0\n                    INNER JOIN info_firm_keys ifk ON fp.act_parent_id = ifk.firm_id  \n                    LEFT JOIN info_firm_working_personnel ax ON (ax.id = a.id OR ax.language_parent_id = a.id) and ax.language_id =lx.id  AND ax.deleted =0 AND ax.active =0\n\n\t\t    INNER JOIN sys_operation_types op ON op.id = a.operation_type_id AND op.deleted =0 AND op.active =0 AND op.language_parent_id =0\n                    LEFT JOIN sys_operation_types opx ON (opx.id = op.id OR opx.language_parent_id = op.id) and opx.language_id =lx.id  AND opx.deleted =0 AND opx.active =0\n                    \n\t\t    INNER JOIN sys_specific_definitions sd14 ON sd14.main_group = 14 AND a.cons_allow_id = sd14.first_group AND sd14.deleted =0 AND sd14.active =0 AND sd14.language_parent_id =0\n\t\t    INNER JOIN sys_specific_definitions sd15 ON sd15.main_group = 15 AND sd15.first_group= a.deleted AND sd15.deleted =0 AND sd15.active =0 AND sd15.language_parent_id =0\n\t\t    INNER JOIN sys_specific_definitions sd16 ON sd16.main_group = 16 AND sd16.first_group= a.active AND sd16.deleted = 0 AND sd16.active = 0 AND sd16.language_parent_id =0\n\t\t    INNER JOIN sys_specific_definitions sd19 ON sd19.main_group = 19 AND sd19.first_group= a.profile_public AND sd19.deleted = 0 AND sd19.active = 0 AND sd19.language_parent_id =0\n\t\t    INNER JOIN sys_specific_definitions sd3 ON sd3.main_group = 3 AND sd3.first_group= a.sex_id AND sd3.deleted = 0 AND sd3.active = 0 AND sd3.language_parent_id =0\n                  \n                    LEFT JOIN sys_specific_definitions sd14x ON sd14x.language_id = lx.id AND (sd14x.id = sd14.id OR sd14x.language_parent_id = sd14.id) AND sd14x.deleted =0 AND sd14x.active =0\n                    LEFT JOIN sys_specific_definitions sd15x ON sd15x.language_id =lx.id AND (sd15x.id = sd15.id OR sd15x.language_parent_id = sd15.id) AND sd15x.deleted =0 AND sd15x.active =0 \n                    LEFT JOIN sys_specific_definitions sd16x ON sd16x.language_id = lx.id AND (sd16x.id = sd16.id OR sd16x.language_parent_id = sd16.id) AND sd16x.deleted = 0 AND sd16x.active = 0\n                    LEFT JOIN sys_specific_definitions sd19x ON sd19x.language_id = lx.id AND (sd19x.id = sd19.id OR sd19x.language_parent_id = sd19.id) AND sd19x.deleted = 0 AND sd19x.active = 0\n                    LEFT JOIN sys_specific_definitions sd3x ON sd3x.language_id = lx.id AND (sd3x.id = sd3.id OR sd3x.language_parent_id = sd3.id) AND sd3x.deleted = 0 AND sd3x.active = 0\n                    WHERE a.deleted =0 AND a.c_date IS NULL AND a.language_parent_id =0\n                    ) AS xtable WHERE deleted =0  \n                        " . $sorguStr . "  \n                ";
         $statement = $pdo->prepare($sql);
         // echo debugPDO($sql, $params);
         $statement->execute();
         $result = $statement->fetchAll(\PDO::FETCH_ASSOC);
         $errorInfo = $statement->errorInfo();
         if ($errorInfo[0] != "00000" && $errorInfo[1] != NULL && $errorInfo[2] != NULL) {
             throw new \PDOException($errorInfo[0]);
         }
         return array("found" => true, "errorInfo" => $errorInfo, "resultSet" => $result);
     } catch (\PDOException $e) {
         return array("found" => false, "errorInfo" => $e->getMessage());
     }
 }
开发者ID:corner82,项目名称:Slim_SanalFabrika,代码行数:101,代码来源:InfoFirmWorkingPersonnel.php

示例11: fillUnspscCodesTreeRtc

 public function fillUnspscCodesTreeRtc($params = array())
 {
     try {
         $pdo = $this->slimApp->getServiceManager()->get('pgConnectFactory');
         $languageId = SysLanguage::getLanguageId(array('language_code' => $params['language_code']));
         if (\Utill\Dal\Helper::haveRecord($languageId)) {
             $languageIdValue = $languageId['resultSet'][0]['id'];
         } else {
             $languageIdValue = 647;
         }
         $whereSql = " WHERE a.active =0 AND a.deleted = 0 AND a.language_parent_id  = 0  ";
         if (isset($params['parent_id']) && $params['parent_id'] != "") {
             $whereSql .= " AND a.parent_id  = " . intval($params['parent_id']);
         } else {
             $whereSql .= " AND a.parent_id = 0 ";
         }
         $sql = "\n               SELECT \n                    COUNT(a.id ) as COUNT \n                FROM sys_unspsc_codes a                \n                INNER JOIN sys_language l ON l.id = a.language_id AND l.deleted =0 AND l.active =0  \n\t\tLEFT JOIN sys_language lx ON lx.id =" . intval($languageIdValue) . " AND lx.deleted =0 AND lx.active =0                      \t\t\n                LEFT JOIN sys_unspsc_codes su ON (su.id =a.id OR su.language_parent_id = a.id) AND su.deleted =0 AND su.active =0 AND lx.id = su.language_id                \n                " . $whereSql . "              \n                       \n                                 ";
         $statement = $pdo->prepare($sql);
         // echo debugPDO($sql, $params);
         $statement->execute();
         $result = $statement->fetchAll(\PDO::FETCH_ASSOC);
         $errorInfo = $statement->errorInfo();
         if ($errorInfo[0] != "00000" && $errorInfo[1] != NULL && $errorInfo[2] != NULL) {
             throw new \PDOException($errorInfo[0]);
         }
         return array("found" => true, "errorInfo" => $errorInfo, "resultSet" => $result);
     } catch (\PDOException $e) {
         return array("found" => false, "errorInfo" => $e->getMessage());
     }
 }
开发者ID:corner82,项目名称:Slim_SanalFabrika,代码行数:30,代码来源:SysUnspscCodes.php

示例12: fillMachineToolFullPropertiesRtc

 /**
  * user interface datagrid fill operation get row count for widget
  * @author Okan CIRAN
  * @ Gridi doldurmak için sys_machine_tool_properties tablosundan çekilen kayıtlarının kaç tane olduğunu döndürür   !!
  * @version v 1.0  17.02.2016
  * @param array | null $args
  * @return array
  * @throws \PDOException
  */
 public function fillMachineToolFullPropertiesRtc($params = array())
 {
     try {
         $pdo = $this->slimApp->getServiceManager()->get('pgConnectFactory');
         $languageId = SysLanguage::getLanguageId(array('language_code' => $params['language_code']));
         if (\Utill\Dal\Helper::haveRecord($languageId)) {
             $languageIdValue = $languageId['resultSet'][0]['id'];
         } else {
             $languageIdValue = 647;
         }
         $parentId = 0;
         if (isset($params['id']) && $params['id'] != "") {
             $parentId = $params['id'];
         }
         $whereSql = " WHERE \n                                a.deleted =0 AND \n                                a.active = 0 AND\n                                a.language_parent_id = 0 AND \n                                a.parent_id = " . intval($parentId) . " AND \n                                a.language_id = " . intval($languageIdValue);
         $sql = "\n                 SELECT \n                     COUNT(a.id) AS COUNT               \n                FROM sys_machine_tool_property_definition  a\n                INNER JOIN sys_language l ON l.id = a.language_id AND l.deleted =0 AND l.active =0  \t                                \n                " . $whereSql . "\n                             \n                    ";
         $statement = $pdo->prepare($sql);
         // echo debugPDO($sql, $params);
         $statement->execute();
         $result = $statement->fetchAll(\PDO::FETCH_ASSOC);
         $errorInfo = $statement->errorInfo();
         if ($errorInfo[0] != "00000" && $errorInfo[1] != NULL && $errorInfo[2] != NULL) {
             throw new \PDOException($errorInfo[0]);
         }
         return array("found" => true, "errorInfo" => $errorInfo, "resultSet" => $result);
     } catch (\PDOException $e) {
         //$debugSQLParams = $statement->debugDumpParams();
         return array("found" => false, "errorInfo" => $e->getMessage());
     }
 }
开发者ID:kuisatz,项目名称:Slim_UstalarMerkezi,代码行数:39,代码来源:SysMachineToolProperties.php

示例13: fillGridAllianceListRtc

 /**
  * @author Okan CIRAN
  * @ Gridi doldurmak için sys_osb_clusters_alliance tablosundan döndürülen kayıtların adedini döndürür !!
  * @version v 1.0  27.06.2016
  * @param array | null $args
  * @return array
  * @throws \PDOException
  */
 public function fillGridAllianceListRtc($args = array())
 {
     $languageId = NULL;
     $languageIdValue = 647;
     if (isset($args['language_code']) && $args['language_code'] != "") {
         $languageId = SysLanguage::getLanguageId(array('language_code' => $args['language_code']));
         if (\Utill\Dal\Helper::haveRecord($languageId)) {
             $languageIdValue = $languageId['resultSet'][0]['id'];
         }
     }
     $sorguStr = null;
     if (isset($params['filterRules']) && $params['filterRules'] != "") {
         $filterRules = trim($params['filterRules']);
         $jsonFilter = json_decode($filterRules, true);
         $sorguExpression = null;
         foreach ($jsonFilter as $std) {
             if ($std['value'] != null) {
                 switch (trim($std['field'])) {
                     case 'osb':
                         $sorguExpression = ' ILIKE \'%' . $std['value'] . '%\' ';
                         $sorguStr .= " AND osb" . $sorguExpression . ' ';
                         break;
                     case 'clusters':
                         $sorguExpression = ' ILIKE \'%' . $std['value'] . '%\'  ';
                         $sorguStr .= " AND clusters" . $sorguExpression . ' ';
                         break;
                     case 'alliance_type_name':
                         $sorguExpression = ' ILIKE \'%' . $std['value'] . '%\'  ';
                         $sorguStr .= " AND alliance_type_name" . $sorguExpression . ' ';
                         break;
                     case 'alliance_name':
                         $sorguExpression = ' ILIKE \'%' . $std['value'] . '%\'  ';
                         $sorguStr .= " AND alliance_name" . $sorguExpression . ' ';
                         break;
                     case 'country_name':
                         $sorguExpression = ' ILIKE \'%' . $std['value'] . '%\'  ';
                         $sorguStr .= " AND country_name" . $sorguExpression . ' ';
                         break;
                     case 'city_name':
                         $sorguExpression = ' ILIKE \'%' . $std['value'] . '%\'  ';
                         $sorguStr .= " AND city_name" . $sorguExpression . ' ';
                         break;
                     case 'borough_name':
                         $sorguExpression = ' ILIKE \'%' . $std['value'] . '%\'  ';
                         $sorguStr .= " AND borough_name" . $sorguExpression . ' ';
                         break;
                     default:
                         break;
                 }
             }
         }
     } else {
         $sorguStr = null;
         $filterRules = "";
         if (isset($params['osb_id']) && $params['osb_id'] != "") {
             $sorguStr .= " AND osb_id = " . $params['osb_id'];
         }
         if (isset($params['clusters_id']) && $params['clusters_id'] != "") {
             $sorguStr .= " AND a.osb_clusters_id " . $params['clusters_id'];
         }
         if (isset($params['alliance_type_id']) && $params['alliance_type_id'] != "") {
             $sorguStr .= " AND alliance_type_id = " . $params['alliance_type_id'];
         }
         if (isset($params['alliance_name']) && $params['alliance_name'] != "") {
             $sorguStr .= " AND alliance_name Like '%" . $params['unitcode_eng'] . "%'";
         }
         if (isset($params['country_id']) && $params['country_id'] != "") {
             $sorguStr .= " AND country_id = " . $params['country_id'];
         }
         if (isset($params['city_id']) && $params['city_id'] != "") {
             $sorguStr .= " AND city_id = " . $params['city_id'];
         }
         if (isset($params['borough_id']) && $params['borough_id'] != "") {
             $sorguStr .= " AND borough_id = " . $params['borough_id'];
         }
     }
     $sorguStr = rtrim($sorguStr, "AND ");
     try {
         $pdo = $this->slimApp->getServiceManager()->get('pgConnectFactory');
         $sql = "\n                SELECT COUNT(id) AS count FROM (\n                SELECT  id,osb_id,osb,clusters,\n                        alliance_type_id,alliance_type_name,alliance_name,\n                        country_id,country_name,city_id,\n                        city_name,borough_id,borough_name \n                FROM (\n                    SELECT \n                        a.id,\n                        soc.osb_id,\n                        COALESCE(NULLIF(sox.name, ''), so.name_eng) AS osb,\n                        COALESCE(NULLIF(scx.name, ''), sc.name_eng) AS clusters, \n\t\t\ta.alliance_type_id, \n\t\t\tCOALESCE(NULLIF(sd20x.description , ''), sd20.description_eng) AS alliance_type_name,\n\t\t\tCASE \n\t\t\t       a.alliance_type_id  \n\t\t\t\tWHEN 1 THEN (SELECT c.firm_name FROM info_firm_profile c WHERE c.act_parent_id = a.alliance_id AND c.active =0 AND c.deleted =0) \n\t\t\t\tWHEN 2 THEN (SELECT concat(d.name, ' ',  surname) FROM info_users_detail d WHERE d.root_id = a.alliance_id AND d.active =0 AND d.deleted =0) \n\t\t\t\tELSE NULL \n\t\t\tEND AS alliance_name,                        \n                        so.country_id,\n                        co.name AS country_name,\n\t\t\tso.city_id, \n\t\t\tct.name AS city_name,\n\t\t\tso.borough_id, \n\t\t\tbo.name AS borough_name\n                FROM sys_osb_clusters_alliance a                \n                INNER JOIN sys_osb_clusters soc ON soc.id = a.osb_clusters_id AND soc.active =0 AND soc.deleted =0 \n                INNER JOIN sys_osb so ON so.id = soc.osb_id AND so.deleted =0 AND so.active =0 AND so.language_parent_id =0 \n                INNER JOIN sys_language l ON l.id = so.language_id AND l.deleted =0 AND l.active = 0 \n                LEFT JOIN sys_language lx ON lx.id = " . intval($languageIdValue) . " AND lx.deleted =0 AND lx.active =0\n                LEFT JOIN sys_osb sox ON (sox.id = so.id OR sox.language_parent_id = so.id) AND sox.deleted =0 AND sox.active =0 AND lx.id = sox.language_id\n\t\tINNER JOIN sys_clusters sc ON sc.id = soc.clusters_id AND sc.deleted =0 AND sc.active =0 AND l.id = sc.language_id\n                LEFT JOIN sys_clusters scx ON (scx.id = sc.id OR scx.language_parent_id = sc.id) AND scx.deleted =0 AND scx.active =0 AND lx.id = scx.language_id\t\t\n\t\tLEFT JOIN sys_countrys co ON co.id = so.country_id AND co.deleted = 0 AND co.active = 0 AND co.language_id = so.language_id                               \n\t\tLEFT JOIN sys_city ct ON ct.id = so.city_id AND ct.deleted = 0 AND ct.active = 0 AND ct.language_id = so.language_id                               \n\t \tLEFT JOIN sys_borough bo ON bo.boroughs_id = so.borough_id AND bo.city_id = so.city_id AND bo.deleted = 0 AND bo.active = 0 AND bo.language_id = so.language_id                 \n\n\t \tINNER JOIN sys_specific_definitions sd20 ON sd20.main_group = 20 AND sd20.first_group= a.alliance_type_id AND sd20.language_id = so.language_id AND sd20.deleted = 0 \n\t \tLEFT JOIN sys_specific_definitions sd20x ON (sd20x.id = sd20.id OR sd20x.language_parent_id = sd20.id ) AND sd20x.language_id = lx.id AND sd20x.deleted = 0 AND sd20x.active = 0\n                WHERE a.deleted =0 AND a.active =0   \n\t\t) AS tempxx                \n                " . $sorguStr . "                \n                 ";
         $statement = $pdo->prepare($sql);
         //   echo debugPDO($sql, $parameters);
         $statement->execute();
         $result = $statement->fetchAll(\PDO::FETCH_ASSOC);
         $errorInfo = $statement->errorInfo();
         if ($errorInfo[0] != "00000" && $errorInfo[1] != NULL && $errorInfo[2] != NULL) {
             throw new \PDOException($errorInfo[0]);
         }
         return array("found" => true, "errorInfo" => $errorInfo, "resultSet" => $result);
     } catch (\PDOException $e) {
         //$debugSQLParams = $statement->debugDumpParams();
         return array("found" => false, "errorInfo" => $e->getMessage());
//.........这里部分代码省略.........
开发者ID:corner82,项目名称:Slim_SanalFabrika,代码行数:101,代码来源:SysOsbClustersAlliance.php

示例14: transferRolesActionPrivilege

 /**
  * @author Okan CIRAN
  * @ sys_acl_action_rrp tablosuna yeni bir kayıt oluşturur.  !!
  * @version v 1.0  13.08.2016
  * @param type $params
  * @return array
  * @throws \PDOException
  */
 public function transferRolesActionPrivilege($params = array())
 {
     try {
         $pdo = $this->slimApp->getServiceManager()->get('pgConnectFactory');
         $pdo->beginTransaction();
         $opUserId = InfoUsers::getUserId(array('pk' => $params['pk']));
         if (\Utill\Dal\Helper::haveRecord($opUserId)) {
             $opUserIdValue = $opUserId['resultSet'][0]['user_id'];
             $sql = "  \n               INSERT INTO sys_acl_action_rrp(\n                        role_id, \n                        resource_id, \n                        privilege_id,\n                        op_user_id\n                        )\n                VALUES (\n                        " . intval($params['role_id']) . ", \n                        " . intval($params['resource_id']) . ",\n                        " . intval($params['privilege_id']) . ",\n                        " . intval($opUserIdValue) . "\n                    )";
             $statement = $pdo->prepare($sql);
             //  echo debugPDO($sql, $params);
             $result = $statement->execute();
             $insertID = $pdo->lastInsertId('sys_acl_action_rrp_id_seq');
             $errorInfo = $statement->errorInfo();
             if ($errorInfo[0] != "00000" && $errorInfo[1] != NULL && $errorInfo[2] != NULL) {
                 throw new \PDOException($errorInfo[0]);
             }
             $pdo->commit();
             return array("found" => true, "errorInfo" => $errorInfo, "lastInsertId" => $insertID);
         } else {
             $errorInfo = '23502';
             // 23502  not_null_violation
             $errorInfoColumn = 'pk';
             $pdo->rollback();
             return array("found" => false, "errorInfo" => $errorInfo, "resultSet" => '', "errorInfoColumn" => $errorInfoColumn);
         }
     } catch (\PDOException $e) {
         $pdo->rollback();
         return array("found" => false, "errorInfo" => $e->getMessage());
     }
 }
开发者ID:corner82,项目名称:Slim_SanalFabrika,代码行数:39,代码来源:SysAclActionRrp.php

示例15: fillCertificationsDdList

 /** 
  * @author Okan CIRAN
  * @  dropdown ya da tree ye doldurmak için sys_language tablosundan kayıtları döndürür !!
  * @version v 1.0  25.07.2016
  * @param array | null $args
  * @return array
  * @throws \PDOException 
  */
 public function fillCertificationsDdList($params = array())
 {
     try {
         $pdo = $this->slimApp->getServiceManager()->get('pgConnectFactory');
         $languageId = NULL;
         $languageIdValue = 647;
         if (isset($params['language_code']) && $params['language_code'] != "") {
             $languageId = SysLanguage::getLanguageId(array('language_code' => $params['language_code']));
             if (\Utill\Dal\Helper::haveRecord($languageId)) {
                 $languageIdValue = $languageId['resultSet'][0]['id'];
             }
         }
         $statement = $pdo->prepare("\n                SELECT \n                    a.id,\n                    COALESCE(NULLIF(su.certificate, ''), a.certificate_eng) AS certificate_name,  \n                    a.certificate_eng AS certificate_name_eng,\n\t\t    COALESCE(NULLIF(su.certificate_short, ''), a.certificate_short_eng) AS certificate_shorts,  \n                    a.certificate_short_eng,\n\t\t    COALESCE(NULLIF(su.description, ''), a.description_eng) AS descriptions,  \n                    a.description_eng,\n                    a.active,\n                    COALESCE(NULLIF(sd16x.description, ''), sd16.description_eng) AS state_active,\n\t\t    CASE COALESCE(NULLIF(a.logo, ''),'-')\n                        WHEN '-' THEN CONCAT(COALESCE(NULLIF(concat(sps.folder_road,'/'), '/'),''),sps.logos_folder,'/' ,COALESCE(NULLIF(a.logo, ''),'image_not_found.png'))\n                        ELSE CONCAT(COALESCE(NULLIF(concat(sps.folder_road,'/'), '/'),''),sps.logos_folder,'/' ,COALESCE(NULLIF(a.logo, ''),'image_not_found.png')) END AS logo\t\n                FROM sys_certifications a\n                INNER JOIN sys_project_settings sps ON sps.op_project_id = 1 AND sps.active =0 AND sps.deleted =0\n                INNER JOIN sys_language l ON l.id = a.language_id AND l.deleted =0 AND l.active =0  \n\t\tLEFT JOIN sys_language lx ON lx.id = " . intval($languageIdValue) . " AND lx.deleted =0 AND lx.active =0\n                INNER JOIN sys_specific_definitions sd16 ON sd16.main_group = 16 AND sd16.first_group= a.active AND sd16.language_id = l.id  AND sd16.deleted = 0 AND sd16.active = 0\n\t\tLEFT JOIN sys_specific_definitions sd16x ON (sd16x.id = sd16.id OR sd16x.language_parent_id = sd16.id) AND sd16x.deleted =0 AND sd16x.active =0 AND lx.id = sd16x.language_id\n                LEFT JOIN sys_certifications su ON (su.id =a.id OR su.language_parent_id = a.id) AND su.deleted =0 AND su.active =0 AND lx.id = su.language_id \n                WHERE a.language_parent_id = 0 AND a.active =0 AND a.deleted =0 \n                ORDER BY a.priority, certificate_name\n\n                                 ");
         $statement->execute();
         $result = $statement->fetchAll(\PDO::FETCH_ASSOC);
         $errorInfo = $statement->errorInfo();
         if ($errorInfo[0] != "00000" && $errorInfo[1] != NULL && $errorInfo[2] != NULL) {
             throw new \PDOException($errorInfo[0]);
         }
         return array("found" => true, "errorInfo" => $errorInfo, "resultSet" => $result);
     } catch (\PDOException $e) {
         return array("found" => false, "errorInfo" => $e->getMessage());
     }
 }
开发者ID:corner82,项目名称:Slim_SanalFabrika,代码行数:32,代码来源:SysCertifications.php


注:本文中的Utill\Dal\Helper类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。