public interface PagedListInterface
{
//..
PageIndex
PageSize
TotalCount
TotalPages
//..
}
class PagedList implements PagedListInterface
{
//тут вся логика листалки
}
public interface NewsInterface
{
//Различные методы
//И среди прочих
PagedListInterface GetNewsList()
}
class News implements NewsInterface
{
public PagedListInterface GetNewsList()
}
SELECT fcl.site, year(fcl.date) as year, month(fcl.date) as month, day(fcl.date) as day, hour(fcl.date) as hour, COUNT(fo.id) AS orders, SUM(fcl.w_init) as w_init, SUM(fcl.w_unique) as w_unique, SUM(fcl.w_close) as w_close
FROM `f_click_log` AS fcl
INNER JOIN `f_orders` AS fo ON fcl.site = fo.client
WHERE fcl.site='".$_val['name']."' AND fcl.date>='".$date_start." 00:00:00' AND fcl.date<='".$date_end." 23:59:59'
GROUP BY fcl.year, fcl.month, fcl.site
mydomain1\.com.*|site.ru.*|superdomen\.org\.ru.*
SELECT * FROM books
INNER JOIN books_authors ON books.id = books_authors.booksid
INNER JOIN authors ON books_authors.authorid = authors.id
@[^"]([0-9a-zа-я\.-]{2,}\.(?:ru|com|net)(?:\/[^\s]*)?)[^"]@miu
INSERT INTO dateplan
(id_tas_dat, date_dat)
VALUES
(16, '2015-09-14'),
(7, '2015-09-14'),
(8, '2015-09-14'),
(10, '2015-09-14'),
(11, '2015-09-14')
$inserts = '';
$date = $_POST['data_oper_tas'];
for ($i = 0, $i < count($_POST['check_func']); $i++)
{
$inserts .= '('. $_POST['check_func'][$i] .','. $date .'),';
}
$insertQuery = 'INSERT INTO dateplan (id_tas_dat, date_dat) VALUES ';
$mysqli = new mysqli('localhost', 'my_user', 'my_password', 'world');
/* check connection */
if (mysqli_connect_errno()) {
printf("Connect failed: %s\n", mysqli_connect_error());
exit();
}
$stmt = $mysqli->prepare($insertQuery . rtrim($inserts, ','));
$stmt->execute();
$stmt->close();
<form name="loginForm" id="loginForm" action="<?php echo esc_url(get_admin_url() . 'admin-post.php') ?>" method="post">
<input type="hidden" name="action" value="login-form" />
<?php wp_nonce_field('process_login_form_action','login_form_sec_field'); ?>
add_action('admin_post_submit-form', 'process_mail_form_action'); // для залогинненых пользователей
add_action('admin_post_nopriv_submit-form', 'process_mail_form_action'); // для незалогинненых пользователей один и тот же обработчик
function process_mail_form_action()
{
// тут читаете из $_POST
}
SELECT CURDATE() - INTERVAL CASE WHEN DAYOFWEEK(CURDATE()) = 1 THEN 13 ELSE DAYOFWEEK(CURDATE()) + 5 END DAY -- start of the previous week
SELECT CURDATE() - INTERVAL CASE WHEN DAYOFWEEK(CURDATE()) = 1 THEN 6 ELSE DAYOFWEEK(CURDATE()) - 1 END DAY -- end of the previous week
SELECT DATE_ADD(CURDATE(), INTERVAL - DAYOFMONTH(CURDATE()) DAY) -- end of the previous month
SELECT DATE_ADD(DATE_ADD(CURDATE(), INTERVAL - DAYOFMONTH(CURDATE()) DAY), INTERVAL - DAYOFMONTH(DATE_ADD(CURDATE(), INTERVAL - DAYOFMONTH(CURDATE()) DAY)) + 1 DAY) -- start of the previous month