/var/www/vhosts/nabawater/backend/models
Edit: /var/www/vhosts/nabawater/backend/models/WebpushNotification.php (4373B)
"function (attribute, value) {
return $('#webpushnotification-send_type-0').val() == '1';
}",
],*/
[
[
'field'
],
'email',
'message' => Yii::t('backend', 'Email ID cannot be blank'),
'whenClient' => "function (attribute, value) {
return ($('input:radio[name=\"WebpushNotification[send_type]\"]:checked').val() == 1) ? true : false;
}"
],
[
[
'field'
],
'match',
'pattern' => '/^[+][0-9]{7,15}$/',
'message' => Yii::t('backend', 'Mobile accept only 7 to 15 digit numbers'),
'skipOnEmpty' => true,
'skipOnError' => true,
'whenClient' => "function (attribute, value) {
return ($('input:radio[name=\"WebpushNotification[send_type]\"]:checked').val() == 2) ? true : false;
}"
],
[
[
'user_type'
],
'safe',
],
];
return $rules;
}
/**
* @inheritdoc
*/
public function attributeLabels()
{
$labels = [
'user_type' => Yii::t('backend', 'User Type'),
'app_type' => Yii::t('backend', 'App Type'),
'message' => Yii::t('backend', 'Message'),
'send_type' => Yii::t('backend', 'Type'),
'field' => Yii::t('backend', 'Email'),
];
return $labels;
}
public function getUserType($index = '')
{
$orderArray = [
1 => Yii::t('backend', 'App Installed Customer'),
2 => Yii::t('backend', 'All Customer'),
];
$orderArray = ($index == '') ? $orderArray : ArrayHelper::getValue($orderArray, $index);
return $orderArray;
}
public function getSendType($index = '')
{
$responseArray = [
1 => Yii::t('backend', 'Email'),
2 => Yii::t('backend', 'SMS'),
//3 => Yii::t('backend', 'Notification'),
];
$responseArray = ($index == '') ? $responseArray : ArrayHelper::getValue($responseArray, $index);
return $responseArray;
}
public function getSendTypeSms($index = '')
{
$responseArray = [
2 => Yii::t('backend', 'SMS'),
];
$responseArray = ($index == '') ? $responseArray : ArrayHelper::getValue($responseArray, $index);
return $responseArray;
}
public function getSendTypeEmail($index = '')
{
$responseArray = [
1 => Yii::t('backend', 'Email'),
];
$responseArray = ($index == '') ? $responseArray : ArrayHelper::getValue($responseArray, $index);
return $responseArray;
}
public function getAppType($index = '')
{
$orderArray = [
1 => Yii::t('backend', 'Android'),
2 => Yii::t('backend', 'IOS'),
0 => Yii::t('backend', 'All'),
];
$orderArray = ($index == '') ? $orderArray : ArrayHelper::getValue($orderArray, $index);
return $orderArray;
}
}