<div class="box">
<div class="item" data-name="One"></div>
<div class="item" data-name="Two"></div>
<div class="item" data-name="Three"></div>
</div>
{
"11" : {
"name" : "One",
"cost" : 10000,
"description" : "Bla"
},
"22" : {
"name" : "Two",
"cost" : 11000,
"description" : "Bla Bla"
},
"33" : {
"name" : "Three",
"cost" : 12000,
"description" : "Bla Bla Bla"
},
"44" : {
"name" : "Four",
"cost" : 13000,
"description" : "Bla"
},
"55" : {
"name" : "Five",
"cost" : 14000,
"description" : "Bla Bla"
},
"66" : {
"name" : "Six",
"cost" : 15000,
"description" : "Bla Bla Bla"
}
}
<div class="box">
<div class="item" data-id="11"></div>
<div class="item" data-id="22"></div>
<div class="item" data-id="33"></div>
</div>
<div class="box-1">
<div class="item" data-id="44"></div>
<div class="item" data-id="55"></div>
<div class="item" data-id="66"></div>
</div>
const MAIL_TRANSPORT_SMTP = 1;
const MAIL_TRANSPORT_DAEMON = 2;
const MAIL_TRANSPORT_FAKE_SUCCESS = 3;
const MAIL_TRANSPORT_FAKE_ERROR = 4;
private static $connect = array('host' => 'smtp.mail.ru', 'port' => 465, 'login' => 'ЛОГИН', 'pass' => 'ПАРОЛЬ', 'fromru' => 'Mail');
private $data = array(
'to_email' => '', 'to_name' => '', 'from_name' => '', 'from_email' => '', 'as_plain' => false,
'reply_email' => '', 'reply_name' => '', 'text' => '', 'subject' => '',
'transport' => self::MAIL_TRANSPORT_DAEMON
);
public function setTransport($transport) {
$this->data['transport'] = $transport;
return $this;
}
switch ($this->data['transport']) {
case self::MAIL_TRANSPORT_DAEMON: $result = $this->sendDaemon();
break;
case self::MAIL_TRANSPORT_SMTP: $result = $this->sendSMTP();
break;
case self::MAIL_TRANSPORT_FAKE_SUCCESS: $result = true;
break;
case self::MAIL_TRANSPORT_FAKE_ERROR: default: $result = false;
}