$('body').on('beforeSubmit', ‘form#formId', function () {
var form = $(this);
// return false if form still have some validation errors
if (form.find('.has-error').length) {
return false;
}
// submit form
$.ajax({
url: form.attr('action'),
type: 'post',
data: form.serialize(),
success: function (response) {
// do something with response
}
});
return false;
});
/**
* Logs in the user using the given username and password in the model.
* @return boolean whether login is successful
*/
public function login($is_front = false)
{
if ($this->_identity === null) {
$this->_identity = new UserIdentity($this->username, $this->password);
$this->_identity->authenticate();
}
if ($this->_identity->errorCode === UserIdentity::ERROR_NONE) {
$duration = $this->rememberMe ? 3600 * 24 * 30 : 0; // 30 days
Yii::app()->user->login($this->_identity, $duration);
return true;
} else
return false;
}
SELECT t1.* FROM tbl t1
WHERE t1.col1 = 'text1'
AND EXISTS(SELECT 'x' FROM tbl t2 WHERE (t2.col2 = t1.col1 or t2.col1 = t1.col2) and t2.id <> t1.id)
Select DISTINCT t1.* from table as t1
join table as t2 on t1.col1 = t2.col2 and t1.col2 = t2.col1 and t1.col1="text1"
select what you need from table1 as t1
inner join table1 as t2 ON (t1.col1 = t2.col2 AND t1.col2 = t2.col1)
where t1.col1 = 'text'
SELECT
messages.*
FROM
messages
WHERE
messages.dialog_id = 3
AND
messages.id NOT IN (
SELECT deletes.message_id FROM deletes WHERE deletes.login = 'vasya'
)
<style>
.container{
background-color: green;
color: #ffffff;
float: left;
width: 100%;
}
.container:after {
display: block;
content: '';
clear: both;
}
.b {
font-weight: bold;
font-size: 20px;
}
.l {
font-size: 15px;
}
li {
float: left;
text-align: center;
width: 100px;
border-left: 1px solid #fff;
box-sizing: border-box;
}
li:last-child {
border-right: 1px solid #fff;
}
ul {
display: block;
margin: auto;
list-style-type: none;
width: 500px;
}
</style>
<div class="container">
<ul>
<li><p class="b">42</p><p class="l">Lorem</p></li>
<li><p class="b">125</p><p class="l">Lorem</p></li>
<li><p class="b">15</p><p class="l">Lorem</p></li>
<li><p class="b">99</p><p class="l">lorem</p></li>
<li><p class="b">25</p><p class="l">Lorem</p></li>
</ul>
</div>