Skip to content

Instantly share code, notes, and snippets.

View cezar62882's full-sized avatar
🎯
Focusing

Vitaly Gorbunov cezar62882

🎯
Focusing
View GitHub Profile
public function create(Order $order, EntityManagerInterface $em, Request $request): Response
{
$shipment = new Shipment();
/** @var OrderProduct[] $products */
$products = $em->getRepository('App:OrderProduct')->findAllNotShippedByOrder($order);
foreach ($products as $product) {
$shipmentProduct = new ShipmentProduct();
$shipmentProduct->setQuantity($product->getQuantity());
$shipmentProduct->setOrderProduct($product);
public function deleteExpiredPasswords() {
$user_ids = $this->getUserIdsWithAlreadyExpiredPassword();
if (!$user_ids) {
return [];
}
// Выставляем флаг сброса пароля админом
foreach ($user_ids as $user_id) {
$user = User::model()->findByPk($user_id);
if ($user !== null) {
<?php
/**
* Class Eloquent_base_model
*
* @property Illuminate\Database\Query\Builder $queryBuilder
*/
class Eloquent_base_model
{
protected $_table;
public function add_to_orders($fromCabinet = FALSE, $itemSum = 0)
{
try
{
$this->load->library('form_validation');
$this->form_validation->set_rules('url', 'Ссылка на товар', 'trim|htmlspecialchars|xss_clean');
$this->form_validation->set_rules('name', 'Название товара', 'trim|htmlspecialchars|xss_clean');
$this->form_validation->set_rules('color', 'Цвет', 'trim|htmlspecialchars|xss_clean');
$this->form_validation->set_rules('size', 'Размер', 'trim|htmlspecialchars|xss_clean');
$this->form_validation->set_rules('picture', 'Фото', 'trim|htmlspecialchars|xss_clean');
public function add_to_orders($fromCabinet = FALSE, $itemSum = 0)
{
try
{
$this->load->library('form_validation');
$this->form_validation->set_rules('url', 'Ссылка на товар', 'trim|htmlspecialchars|xss_clean');
$this->form_validation->set_rules('name', 'Название товара', 'trim|htmlspecialchars|xss_clean');
$this->form_validation->set_rules('color', 'Цвет', 'trim|htmlspecialchars|xss_clean');
$this->form_validation->set_rules('size', 'Размер', 'trim|htmlspecialchars|xss_clean');
$this->form_validation->set_rules('picture', 'Фото', 'trim|htmlspecialchars|xss_clean');
public function add_to_orders($fromCabinet = FALSE, $itemSum = 0)
{
try
{
$this->load->library('form_validation');
$this->form_validation->set_rules('url', 'Ссылка на товар', 'trim|htmlspecialchars|xss_clean');
$this->form_validation->set_rules('name', 'Название товара', 'trim|htmlspecialchars|xss_clean');
$this->form_validation->set_rules('color', 'Цвет', 'trim|htmlspecialchars|xss_clean');
$this->form_validation->set_rules('size', 'Размер', 'trim|htmlspecialchars|xss_clean');
$this->form_validation->set_rules('picture', 'Фото', 'trim|htmlspecialchars|xss_clean');
<?php
/**
* Class Base_Model
*
* Базовая модель
* @property CI_DB_active_record $db
*/
class Base_Model extends CI_Model
{
// Название таблицы
<div class="account-caption-wrap">
<div class="account-caption-box-stock">
<p class="account-caption">Ниже вы видите товары, которые мы выкупили и доставили на наш склад. Отметьте нужные товары и сформируйте из них посылку для отправки на ваш почтовый адрес. Обратите внимание, что на этой странице вы также можете заказать услугу проверки товара, если не сделали этого ранее.</p>
<span class="icon"></span>
</div>
</div>
<br />
<h3>Купленные товары, доставленные на наш склад</h3>
<form method="post" action="<?php echo site_url("client/orders/addtoorder/{$country}"); ?>">
<input type="hidden" name="<?php echo $this->security->get_csrf_token_name();?>" value="<?php echo $this->security->get_csrf_hash();?>" />
<?php echo
(isset($report['our_earnings_lots']['russia']) ? $report['our_earnings_lots']['russia'] : 0) +
+ (isset($report['partner_earnings_lots']['all']) ? $report['partner_earnings_lots']['all'] : 0)
+ (isset($report['our_earnings_shops']['russia']) ? $report['our_earnings_shops']['russia'] : 0)
+ (isset($report['partner_earnings_shops']['all']) ? $report['partner_earnings_shops']['all'] : 0)
+ (isset($report['our_earnings_forwarding']['russia']) ? $report['our_earnings_forwarding']['russia'] : 0)
+ (isset($report['partner_earnings_forwarding']['all']) ? $report['partner_earnings_forwarding']['all'] : 0)
+ (isset($report['our_earnings_delivery']['russia']) ? $report['our_earnings_delivery']['russia'] : 0)
+ (isset($report['partner_earnings_delivery']['all']) ? $report['partner_earnings_delivery']['all'] : 0)
+ (isset($report['additional_earnings']['russia']) ? $report['additional_earnings']['russia'] : 0)
<?php
$fruits = array(
"apple" => "yummy",
"orange" => "ah ya, nice",
"grape" => "wow, I love it!",
"plum" => "nah, not me"
);
$obj = new ArrayObject( $fruits );
$it = $obj->getIterator();