Displaying 41-50 of 274 results.
Resolved: Yii form dropDownList create and update support example with empty first option
posted by admin on January 22, 2016
I have form on yii. It is news form. I want to change news category by select box and in update form have selected option.Read more
Resolved: Yii2 showScriptName remove index.php Not Found apache
posted by admin on June 2, 2017
I tried to remove index.php from url by many ways, but without results.
My OS is Ubuntu Linux.
Server Apache.
In web.php in config directory

<?php
$config = [
'components' => [
'urlManager' => [
'class' => 'yii\web\UrlManager',
'enablePrettyUrl' => true,
'showScriptName' => false,
'rules' => [
'/' => 'site/index',
'login' => 'site/login',
'<controller:\w+>/<id:\d+>' => '<controller>/view',
'<controller:\w+>/<action:\w+>/<id:\d+>' => '<controller>/<action>',
'<controller:\w+>/<action:\w+>' => '<controller>/<action>',
],
],
]
]

Still not working
I try to created .htaccess in web direcory

RewriteEngine on
# If a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Otherwise forward it to index.php
RewriteRule . index.php

Still without result
In result
404 Not Found

Not Found

The requested URL /login was not found on this server.

Apache/2.4.18 (Ubuntu) Server at tracker.dev Port 80

Please help me to resolve problemRead more
Resolved: Odnoklassniki OK api apiok users.getInfo all fields without errors
posted by admin on April 17, 2017
I try to get all allowed fields from user by id, and got some error

{
error_code:100
error_msg:PARAM : Invalid parameter fields value : [accessible,age,allows_anonym_access,allows_messaging_only_for_friends,birthday,blocked,blocks,can_vcall,can_vmail,capabilities,common_friends_count,current_location,current_status,current_status_date,current_status_date_ms,current_status_id,current_status_track_id,email,feed_subscription,first_name,friend,friend_invitation,gender,has_email,has_service_invisible,invited_by_friend,is_activated,last_name,last_online,last_online_ms,location,login,modified_ms,name,notifications_subscription,online,photo_id,pic1024x768,pic128max,pic128x128,pic180min,pic190x190,pic224x224,pic240min,pic288x288,pic320min,pic50x50,pic600x600,pic640x480,pic_1,pic_2,pic_3,pic_4,pic_5,pic_base,pic_full,pic_max,premium,presents,private,ref,registered_date,registered_date_ms,relationship,show_lock,uid,url_chat,url_chat_mobile,url_profile,url_profile_mobile,vip]
error_data:null
}

All fields I got from apiok official page

[{
accessible:Boolean
age:Integer
allows_anonym_access:Boolean
allows_messaging_only_for_friends:Boolean
birthday:String
blocked:Boolean
blocks:Boolean
can_vcall:Boolean
can_vmail:Boolean
capabilities:String
common_friends_count:Integer
current_location:{
altitude:Float
cellId:Integer
city:String
country:String
ipAddress:String
latitude:Float
longitude:Float
}
current_status:String
current_status_date:Date
current_status_date_ms:Long
current_status_id:String
current_status_track_id:String
email:String
feed_subscription:Boolean
first_name:String
friend:Boolean
friend_invitation:Boolean
gender:String
has_email:Boolean
has_service_invisible:Boolean
invited_by_friend:Boolean
is_activated:Boolean
last_name:String
last_online:String
last_online_ms:Long
locale:String
location:{
city:String
country:String
countryCode:String
countryName:String
}
login:String
modified_ms:Long
name:String
notifications_subscription:Boolean
online:String
photo_id:String
pic1024x768:String
pic128max:String
pic128x128:String
pic180min:String
pic190x190:String
pic224x224:String
pic240min:String
pic288x288:String
pic320min:String
pic50x50:String
pic600x600:String
pic640x480:String
pic_1:String
pic_2:String
pic_3:String
pic_4:String
pic_5:String
pic_base:String
pic_full:String
pic_max:String
premium:Boolean
presents:[{}]
private:Boolean
ref:String
registered_date:Date
registered_date_ms:Long
relations:[{}]
relationship:{}
show_lock:Boolean
uid:String
url_chat:String
url_chat_mobile:String
url_profile:String
url_profile_mobile:String
vip:Boolean
}]
Read more
Resolved: MarkItUp emotions smileys click insert to editor javascript jquery
posted by admin on December 25, 2015
altHow to insert markitup smileys to markitup editor.

<div id="emoticons">
<a href="#" alt="EMOTION_CODE">
<img alt="EMOTION_CODE" src="EMOTION_IMG">
</a>
<a href="#" alt="EMOTION_CODE">
<img alt="EMOTION_CODE" src="EMOTION_IMG">
</a>
<a href="#" alt="EMOTION_CODE">
<img alt="EMOTION_CODE" src="EMOTION_IMG">
</a>
etc
</div>
Read more
Resolved: MySQL задание менеджер, продукт, заявки, продажы. Задача из собеседования - PHP разработчик
posted by admin on March 16, 2016
Даны следующие две таблицы:

--
-- Структура таблицы `claim`
--
CREATE TABLE IF NOT EXISTS `claim` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`manager_id` int(11) NOT NULL,
`created_at` datetime NOT NULL,
`sum` float NOT NULL,
PRIMARY KEY (`id`),
KEY `manager_id` (`manager_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=9 ;
--
-- Дамп данных таблицы `claim`
--

INSERT INTO `claim` (`id`, `manager_id`, `created_at`, `sum`) VALUES
(1, 1, '2013-07-18 10:23:08', 256.128),
(2, 3, '2013-07-18 13:29:49', 512.1),
(3, 4, '2013-07-19 16:29:07', 123),
(4, 4, '2013-07-18 17:35:53', 321),
(5, 4, '2013-06-19 15:31:46', 756),
(6, 1, '2013-06-05 10:47:26', 265),
(7, 2, '2013-05-31 20:27:38', 354),
(8, 4, '2013-07-17 15:48:20', 798.12);
----------------------------------------------------------

--
-- Структура таблицы `manager`
--
CREATE TABLE IF NOT EXISTS `manager` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`first_name` varchar(32) CHARACTER SET latin1 NOT NULL,
`last_name` varchar(32) CHARACTER SET latin1 NOT NULL,
`email` varchar(32) CHARACTER SET latin1 NOT NULL,
`chief_id` int(11) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `chief_id` (`chief_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=5 ;
--
-- Дамп данных таблицы `manager`
--
INSERT INTO `manager` (`id`, `first_name`, `last_name`, `email`, `chief_id`) VALUES
(1, 'Simple', 'Manager', '', 2),
(2, 'Super', 'Manager', '', NULL),
(3, 'Third ', 'Manager', '', 2),
(4, 'Just', 'Manager', '', NULL);

--
-- Ограничения внешнего ключа таблицы `claim`
--
ALTER TABLE `claim`
ADD CONSTRAINT `claim_ibfk_1` FOREIGN KEY (`manager_id`) REFERENCES `manager` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Ограничения внешнего ключа таблицы `manager`
--
ALTER TABLE `manager`
ADD CONSTRAINT `manager_ibfk_1` FOREIGN KEY (`chief_id`) REFERENCES `manager` (`id`) ON DELETE SET NULL ON UPDATE CASCADE;


Задача 1

Напишите sql-запрос, выбирающий информацию по каждому менеджеру, включая количество связанных с ним заявок и их общую сумму (в 2 дополнительных поля: claim_count, claim_total_sum).


Задача 2

Напишите запрос, который выведет двух менеджеров, у которых количество связанных заявок меньше, чем у остальных. При этом, объедините значения first_name и last_name в одно поле full_name.
Read more
Resolved: Yii 1.1: syntaxhighlighter extension CListView ajax pagination problem
posted by admin on December 25, 2015
CListView ajax pagination Can't find XML Brush etc.
First page working great, but when working ajax pagination, brushes not working, not finding any brushes.

My code:

<?php Yii::app()->syntaxhighlighter->addHighlighter(); ?>
Read more
Resolved: Yii admin module link url default
posted by admin on January 21, 2016
I create admin module, and try to open link http://localhost/test/admin , and get 404 error, object not found.Read more
Resolved: Yii 1 - Error 500 - include(DOMDocument.php): failed to open stream: No such file or directory
posted by admin on July 19, 2017
I move my Yii1 project from shared hosting to VDS VPS Ubuntu hosting and get some error

Error 500 - include(DOMDocument.php): failed to open stream: No such file or directory

In shared hosting my php version is 5.7, in new hosting my php version is 7.0.*Read more
Resolved: Yii get last parameter from current url without GET name getQuery
posted by admin on April 10, 2016
My controller

public function actionVideo()
{
//want to get last url parametr
}


My URL like

...video/12313213123/dubaivideos


I want to get dubaivideosRead more
Resolved: PHP fopen fwrite new line
posted by admin on April 18, 2017
I have code, where I create file and write string in that file
PHP:

$string = "Some text \n any text \r\n more text \n\r";
$handle = fopen($filename, 'w');
fwrite($handle, $string);
fclose($handle);

Output as same as I try create

$string = "Some text \n any text \r\n more text \n\r";

How to write text in file with new line?Read more