CAdvContract :: GetContractPermissions: Bitrix method

      
<?php 
//  CAdvContract :: GetContractPermissions()
//  /dist/bitrix/modules/advertising/classes/general/advertising.php:344

    
public static function GetContractPermissions($CONTRACT_ID)
    {
        
$err_mess = (CAdvContract_all::err_mess())."<br>Function: GetContractPermissions<br>Line: ";
        global 
$DB;
        
$arrPerm = array();
        
$CONTRACT_ID intval($CONTRACT_ID);
        if (
$CONTRACT_ID<=0) return false;
        
$strSql "
            SELECT
                CU.USER_ID,
                CU.PERMISSION,
                U.LOGIN,
                U.NAME,
                U.LAST_NAME,
                U.EMAIL
            FROM
                b_adv_contract_2_user CU,
                b_user U
            WHERE
                CU.CONTRACT_ID = 
$CONTRACT_ID
            and U.ID = CU.USER_ID
            ORDER BY CU.ID
            "
;
        
$rs $DB->Query($strSqlfalse$err_mess.__LINE__);
        while (
$ar $rs->Fetch())
        {
            
$arrPerm[$ar["PERMISSION"]][] = array(
                
"USER_ID"            => $ar["USER_ID"],
                
"USER_LOGIN"        => $ar["LOGIN"],
                
"USER_NAME"            => $ar["NAME"],
                
"USER_LAST_NAME"    => $ar["LAST_NAME"],
                
"USER_EMAIL"        => $ar["EMAIL"]
                );
        }

        return 
$arrPerm;
    }