Esempio n. 1
1
 public static function GetRentNumbers()
 {
     $arResult = array();
     $viHttp = new CVoxImplantHttp();
     $result = $viHttp->GetPhoneNumbers();
     if ($result && !empty($result->result)) {
         foreach ($result->result as $value) {
             $renewalDate = $renewalDateTs = '';
             if ($value->phone_next_renewal) {
                 $data = new Bitrix\Main\Type\DateTime($value->phone_next_renewal . ' 00:00:00', 'Y-m-d H:i:s');
                 $renewalDate = $data->format(Bitrix\Main\Type\Date::getFormat());
                 $renewalDateTs = $data->getTimestamp();
             }
             $unverifiedHoldDate = $unverifiedHoldDateTs = '';
             if ($value->verification_status != 'VERIFIED' && $value->unverified_hold_until) {
                 $data = new Bitrix\Main\Type\DateTime($value->unverified_hold_until . ' 00:00:00', 'Y-m-d H:i:s');
                 $unverifiedHoldDate = $data->format(Bitrix\Main\Type\Date::getFormat());
                 $unverifiedHoldDateTs = $data->getTimestamp();
             }
             $arResult[$value->phone_number] = array('ACTIVE' => $value->deactivated ? 'N' : 'Y', 'NUMBER' => '+' . $value->phone_number, 'PAID_BEFORE' => $renewalDate, 'PAID_BEFORE_TS' => $renewalDateTs, 'PRICE' => $value->phone_price, 'VERIFY_STATUS' => $value->verification_status, 'VERIFY_STATUS_NAME' => CVoxImplantDocuments::GetStatusName($value->verification_status), 'VERIFY_BEFORE' => $unverifiedHoldDate, 'VERIFY_BEFORE_TS' => $unverifiedHoldDateTs);
         }
     }
     return $arResult;
 }
Esempio n. 2
0
 /** @return \CDBResult */
 public function getData()
 {
     $groupId = $this->getFieldValue('GROUP_ID', null);
     $dateRegister = $this->getFieldValue('DATE_REGISTER', null);
     $active = $this->getFieldValue('ACTIVE', null);
     $filter = array();
     if ($groupId) {
         $filter['GROUP_ID'] = $groupId;
     }
     if (strlen($dateRegister) > 0) {
         if (\Bitrix\Main\Type\Date::isCorrect($dateRegister)) {
             $dateRegister = new \Bitrix\Main\Type\Date($dateRegister);
             $filter['><USER.DATE_REGISTER'] = array($dateRegister->toString(), $dateRegister->add('1 DAY')->toString());
         } else {
             $result = new \CDBResult();
             $result->InitFromArray(array());
             return $result;
         }
     }
     if ($active == 'Y') {
         $filter['USER.ACTIVE'] = $active;
     } elseif ($active == 'N') {
         $filter['USER.ACTIVE'] = $active;
     }
     $userDb = \Bitrix\Main\UserGroupTable::getList(array('select' => array('NAME' => 'USER.NAME', 'EMAIL' => 'USER.EMAIL', 'USER_ID'), 'filter' => $filter, 'group' => array('NAME', 'EMAIL', 'USER_ID'), 'order' => array('USER_ID' => 'ASC')));
     return new \CDBResult($userDb);
 }
Esempio n. 3
0
 public function GetStatus()
 {
     $ViHttp = new CVoxImplantHttp();
     $result = $ViHttp->GetDocumentStatus();
     if (!$result) {
         $this->error = new CVoxImplantError(__METHOD__, $ViHttp->GetError()->code, $ViHttp->GetError()->msg);
         return false;
     }
     $verifications = array();
     foreach ($result as $key => $verification) {
         $regionName = GetMessage('VI_DOCS_COUNTRY_' . $verification->REGION);
         $regionName = strlen($regionName) > 0 ? $regionName : $verification->REGION;
         $verifications[$key]['REGION'] = $verification->REGION;
         $verifications[$key]['REGION_NAME'] = $regionName;
         $verifications[$key]['STATUS'] = $verification->STATUS;
         $verifications[$key]['STATUS_NAME'] = GetMessage('VI_DOCS_STATUS_' . $verification->STATUS);
         if ($verification->STATUS != 'VERIFIED' && $verification->UNVERIFIED_HOLD_UNTIL) {
             $data = new Bitrix\Main\Type\DateTime($verification->UNVERIFIED_HOLD_UNTIL, 'Y-m-d H:i:s');
             $verifications[$key]['UNVERIFIED_HOLD_UNTIL'] = $data->format(Bitrix\Main\Type\Date::getFormat());
         } else {
             $verifications[$key]['UNVERIFIED_HOLD_UNTIL'] = '';
         }
         if (isset($verification->DOCUMENTS)) {
             foreach ($verification->DOCUMENTS as $document) {
                 $data = new Bitrix\Main\Type\DateTime($document->UPLOADED, 'Y-m-d H:i:s');
                 $verifications[$key]['DOCUMENTS'][] = array('UPLOADED' => $data->format(Bitrix\Main\Type\DateTime::getFormat()), 'DOCUMENT_ID' => $document->DOCUMENT_ID, 'DOCUMENT_STATUS' => $document->DOCUMENT_STATUS, 'DOCUMENT_STATUS_NAME' => GetMessage('VI_DOCS_DOCUMENT_STATUS_' . $document->DOCUMENT_STATUS), 'IS_INDIVIDUAL' => $document->IS_INDIVIDUAL, 'IS_INDIVIDUAL_NAME' => GetMessage('VI_DOCS_IS_INDIVIDUAL_' . $document->IS_INDIVIDUAL), 'REVIEWER_COMMENT' => $document->REVIEWER_COMMENT);
             }
         }
     }
     return $verifications;
 }
Esempio n. 4
0
 /**
  * Returns true if composite mode is allowed by checking update system parameters.
  *
  * @return boolean
  */
 public static function isLicenseExpired()
 {
     $finishDate = Option::get("main", "~support_finish_date", "");
     $composite = Option::get("main", "~PARAM_COMPOSITE", "N");
     if ($composite == "Y" || $finishDate == "") {
         return false;
     }
     $finishDate = new \Bitrix\Main\Type\Date($finishDate, "Y-m-d");
     return $finishDate->getTimestamp() < time();
 }
Esempio n. 5
0
        ?>
</span>
		</span>
		<?php 
    }
    ?>
		<?php 
    if ($abtest['STOP_DATE']) {
        ?>
		<span class="ab-test-info">
			<?php 
        echo getMessage('ABTEST_STOP_DATE');
        ?>
:
			<span><?php 
        echo $abtest['STOP_DATE']->format(Bitrix\Main\Type\Date::convertFormatToPhp($arLang['FORMAT_DATE']));
        ?>
</span>
		</span>
		<?php 
    }
    ?>
		<?php 
    if (!$abtest['START_DATE'] && !$abtest['STOP_DATE']) {
        ?>
		<span class="ab-test-info"><?php 
        echo getMessage('ABTEST_NEVER_LAUNCHED');
        ?>
</span>
		<?php 
    }
Esempio n. 6
0
     $status = '<table style="width: 100%; border-spacing: 0px; "><tr>';
     $status .= '<td style="width: 1px; padding: 0px; vertical-align: top; "><img src="/bitrix/images/abtest/ab-test-on.gif"></td>';
     $status .= '<td style="padding: 0px 10px; vertical-align: top; ">';
     $status .= '<span style="white-space: nowrap; color: #729e00; font-weight: bold; ">' . getMessage('ABTEST_STATE_STARTED') . '</span><br>';
     $status .= '<span style="white-space: nowrap; ">' . getMessage('ABTEST_START_DATE') . ': ' . $start_date . '</span><br>';
     if ($end_date) {
         $status .= '<span style="white-space: nowrap; ">' . getMessage('ABTEST_STOP_DATE2') . ': ' . $end_date . '</span><br>';
     }
     $status .= '<span style="white-space: nowrap; ">' . getMessage('ABTEST_STARTED_BY') . ': <a href="/bitrix/admin/user_edit.php?ID=' . $abtest['USER_ID'] . '&lang=' . LANG . '">' . $user_name . '</a></span>';
     $status .= '</td>';
     if ($isAdmin) {
         $status .= '<td style="width: 1px; padding: 0px; vertical-align: top; "><span class="adm-btn" onclick="if (confirm(\'' . CUtil::JSEscape(getMessage('ABTEST_STOP_CONFIRM')) . '\')) ' . $lAdmin->actionDoGroup($abtest['ID'], 'stop') . '">' . getMessage('ABTEST_BTN_STOP') . '</span></td>';
     }
     $status .= '</tr></table>';
 } else {
     $stop_date = $abtest['STOP_DATE'] ? $abtest['STOP_DATE']->format(Bitrix\Main\Type\Date::convertFormatToPhp($arLang['FORMAT_DATE'])) : false;
     $user_name = $abtest['USER_ID'] ? CUser::formatName(CSite::getNameFormat(), array('TITLE' => $abtest['USER_TITLE'], 'NAME' => $abtest['USER_NAME'], 'SECOND_NAME' => $abtest['USER_SECOND_NAME'], 'LAST_NAME' => $abtest['USER_LAST_NAME'], 'LOGIN' => $abtest['USER_LOGIN']), true, true) : false;
     $status = '<table style="width: 100%; border-spacing: 0px; "><tr>';
     $status .= '<td style="width: 1px; padding: 0px; vertical-align: top; "><img src="/bitrix/images/abtest/ab-test-off.gif"></td>';
     $status .= '<td style="padding: 0px 10px; vertical-align: top; ">';
     $status .= '<span style="white-space: nowrap; font-weight: bold; ">' . getMessage('ABTEST_STATE_STOPPED') . '</span><br>';
     if ($stop_date) {
         $status .= '<span style="white-space: nowrap; ">' . getMessage('ABTEST_STOP_DATE') . ': ' . $stop_date . '</span><br>';
     }
     if ($user_name) {
         $status .= '<span style="white-space: nowrap; ">' . getMessage('ABTEST_STOPPED_BY') . ': <a href="/bitrix/admin/user_edit.php?ID=' . $abtest['USER_ID'] . '&lang=' . LANG . '">' . $user_name . '</a></span>';
     }
     $status .= '</td>';
     if ($isAdmin) {
         if ($abtest['ENABLED'] == 'T') {
             $action = $lAdmin->actionRedirect('abtest_edit.php?ID=' . $abtest['ID'] . '&lang=' . LANG);