function actSend() { global $post; $error = array(); if (!$this->getUserId()) { $error['userid'] = 'Ќеобходимо выпонить вход, или зарегистрироватьс¤'; } if (!trim($post->get('description'))) { $error['description'] = '¬ведите описание'; } if (!trim($post->get('text'))) { $error['text'] = '¬ведите текст'; } if (empty($error)) { $data = array('userid' => $this->getUserId(), 'text' => $post->get('text'), 'description' => $post->get('description'), 'category' => $post->getInt('category'), 'time' => now(), 'date_to' => dte($post->get('date_to'), DTE_FORMAT_SQL), 'status' => 0); DB::insert('sc_shop_board', $data); $this->sendTemplateMail($this->cfg('MAIL'), 'notice_board', $data); // $this->noticeICQ($this->cfg('ICQ'),'Ќовое объ¤вление на сайте на сайте'); } else { echo printJSON(array('err' => $error)); exit; } echo printJSON(array('msg' => 'ok')); exit; }
function actSave() { global $ST, $get, $post; $id = $post->getInt('id'); $data = array('description' => $post->get('description'), 'text' => $post->get('text'), 'status' => $post->getInt('status'), 'date_to' => dte($post->get('date_to'), DTE_FORMAT_SQL)); if ($id) { $ST->update('sc_shop_board', $data, "id=" . $id); } else { $id = $ST->insert('sc_shop_board', $data); } echo printJSON(array('msg' => 'Сохранено', 'id' => $id)); exit; }
function actSave() { global $ST, $get, $post; $id = $post->getInt('id'); $data = array('content' => $post->get('content'), 'description' => $post->get('description'), 'title' => $post->get('title'), 'author' => $post->get('author'), 'date' => dte($post->get('date'), 'Y-m-d'), 'date_to' => $post->get('date_to') ? dte($post->get('date_to'), 'Y-m-d') : null, 'state' => $post->get('state'), 'img' => $post->get('img'), 'gallery' => $post->getInt('gallery'), 'position' => $post->getInt('position'), 'type' => $this->getType()); if ($data['img'] && file_exists(ROOT . $data['img'])) { $from = ROOT . $data['img']; $name = md5_file(ROOT . $data['img']) . '.' . substr($data['img'], -3); $path = $this->cfg('NEWS_IMAGE_PATH') . '/' . $name; $data['img'] = $path; if (!file_exists(ROOT . $data['img'])) { rename($from, ROOT . $data['img']); } } elseif ($data['img'] == 'clear') { $data['img'] = ''; } if ($id) { $ST->update('sc_news', $data, "id=" . $id); } else { $id = $ST->insert('sc_news', $data); } if (true) { $content = ''; if ($post->get('type') == 'news') { $content .= '<small>' . date('d.m.Y') . '</small> '; } $content .= '<strong>' . $post->getHtml('title') . '</strong><br />'; $content .= '<span>' . $post->getHtml('description') . '</span><br />'; $content .= '<a href="http://' . $this->cfg('SITE') . '/' . $post->get('type') . '/view/' . $id . '/">подробнее...</a>'; if ($get->exists('save_and_send')) { $mail = new Mail(); $mail->setFromMail(array($this->cfg('SITE'), $this->cfg('mail'))); $mail->setTemplate('letter_' . $post->get('type'), array('FROM_SITE' => $this->cfg('SITE'), 'CONTENT' => $content, 'BODY' => $post->get('content'))); $mail->xsend($this->getUser('mail')); } elseif ($get->exists('save_and_send_all')) { $rs = $ST->execute("SELECT distinct mail FROM sc_subscribe WHERE type LIKE '%" . $post->get('type') . "%'"); $mail = new Mail(); $mail->setFromMail($this->getConfig('mail')); $mail->setFromMail(array($post->get('title'), $this->cfg('mail'))); $mail->setTemplate('letter_' . $post->get('type'), array('FROM_SITE' => $this->cfg('SITE'), 'CONTENT' => $content, 'BODY' => $post->get('content'))); while ($rs->next()) { $key = 'http://' . $this->cfg('SITE') . '/cabinet/unsubscribe/?key=' . md5($rs->get('mail') . $post->get('type') . 'unsubscribe') . '&type=' . $post->get('type') . '&mail=' . $rs->get('mail'); $key = '<a href="' . $key . '">' . $key . '</a>'; $mail->xsend($rs->get('mail'), array('UNSUBSCRIBE' => $key)); } } } echo printJSON(array('msg' => 'Сохранено', 'nws_id' => $id)); exit; }
function actOrder1c() { global $ST, $get; $login = $get->get('login'); $password = $get->get('password'); $q = "SELECT * FROM sc_users WHERE type='admin' \n\t\t\tAND login='******'\n\t\t\tAND password=PASSWORD('" . SQL::slashes($password) . "')"; $rs = $ST->select($q); if (!$rs->next()) { exit; } $data = array('make_date' => date('Y-m-d'), 'make_time' => date('H:i:s'), 'document' => array()); $date_from = date('Y-m-d'); $date_to = date('Y-m-d', time() + 3600 * 24); if ($get->get('date_from')) { $date_from = $get->get('date_from'); } if ($get->get('date_to')) { $date_to = $get->get('date_to'); } $q = "SELECT * FROM sc_shop_order o,sc_users u WHERE u.u_id=o.userid\n\t\t\tAND o.create_time>='{$date_from}' AND o.create_time<='{$date_to}'\n\t\t"; $rs = $ST->select($q); while ($rs->next()) { $d = array('id' => $rs->get('id'), 'num' => $rs->get('id'), 'date' => dte($rs->get('create_time'), 'Y-m-d'), 'summ' => $rs->get('total_price'), 'contragent' => array('id' => $rs->get('u_id') . '#' . $rs->get('login') . '#' . $rs->get('name'), 'name' => $rs->get('type') == 'user_jur' ? $rs->get('company') : $rs->get('name'), 'address' => $rs->get('address'), 'mail' => $rs->get('mail')), 'time' => dte($rs->get('create_time'), 'H:i:s'), 'additionally' => $rs->get('additionally'), 'goods' => array()); $q = "SELECT *,ec.id AS ext_cat_id, oi.price AS price \t\n\t\t\tFROM sc_shop_order_item AS oi, sc_shop_item AS si\n\t\t\tLEFT JOIN sc_shop_srv_extcat AS ec ON ec.lnk=si.category\n\t\t\tWHERE\n\t\t\t\tsi.id=oi.itemid\n\t\t\t\tAND oi.orderid={$rs->get('id')} \n\t\t\t\t\n\t\t\t"; $q = "SELECT *, oi.price AS price \t\n\t\t\tFROM sc_shop_order_item AS oi, sc_shop_item AS si\n\t\t\t\n\t\t\tWHERE\n\t\t\t\tsi.id=oi.itemid\n\t\t\t\tAND oi.orderid={$rs->get('id')} \n\t\t\t\t\n\t\t\t"; $rs1 = $ST->select($q); while ($rs1->next()) { $g = array('name' => $rs1->get('name'), 'id' => $rs1->get('ext_id'), 'price' => $rs1->get('price') / $rs1->get('count'), 'count' => $rs1->get('count'), 'summ' => $rs1->get('price')); $d['goods'][] = $g; } $data['document'][] = $d; } if ($data['document']) { echo '<?xml version="1.0" encoding="windows-1251"?>'; echo $this->render($data, dirname(__FILE__) . '/order1c.xml.php'); exit; } else { echo 'Нет заказов'; } }
function actSave() { global $ST, $post; $id = $post->getInt('id'); $data = array('description' => $post->get('description'), 'file' => $post->get('file'), 'place' => $post->getInt('place'), 'start_date' => dte($post->get('start_date'), 'Y-m-d'), 'stop_date' => dte($post->get('stop_date'), 'Y-m-d'), 'url' => $post->get('url'), 'code' => $post->get('code')); if ($data['file'] && file_exists(ROOT . $data['file'])) { $from = ROOT . $data['file']; $name = md5_file(ROOT . $data['file']) . '.' . substr($data['file'], -3); $path = $this->cfg('ADVERTISING_PATH') . '/' . $name; $data['file'] = $path; if (!file_exists(ROOT . $data['file'])) { rename($from, ROOT . $data['file']); } } elseif ($data['file'] == 'clear') { $data['file'] = ''; } if ($id) { $ST->update('sc_advertising', $data, 'id=' . $id); } else { $id = $ST->insert('sc_advertising', $data); } echo printJSON(array('msg' => 'Сохранено', 'id' => $id)); exit; }
<img src="<?php echo scaleImg($row['mail'], 'w150h200'); ?> "> <?php } ?> <div class="autor"><?php echo $row['name']; ?> <?php echo $row['phone']; ?> <span class="date"><?php echo dte($row['time']); ?> </span></div> <div class="description"> <?php echo $row['comment']; ?> </div> </div> </li> <?php } ?> </ul> </div>
?> </td> <td><?php echo dte($row['end_date']); ?> </td> <td><?php echo $row['volume_min']; ?> </td> <td><?php echo $row['volume_total']; ?> </td> <td><?php echo dte($row['delivery_date']); ?> <?php echo $row['delivery_time']; ?> </td> <td><?php echo $row['delivery_comment']; ?> </td> </tr> <?php } ?> </table>
function actSberPDF() { // $this->needAuth(); global $ST, $get; $q = "SELECT o.*,u.company,u.other_info,u.address AS u_address FROM sc_shop_order o \r\n\t\tLEFT JOIN sc_users u ON u_id=o.userid\r\n\t\t\r\n\t\tWHERE o.id=" . $get->getInt('id'); if (strpos('user', $this->getUser('type')) !== false) { $q .= " AND o.userid=" . $this->getUserId(); } $rs = $ST->select($q); if ($rs->next()) { $inn = ''; if ($other_info = getJSON($rs->get('other_info'))) { $inn = @$other_info['inn']; } $data = array('doc_number' => $rs->get('id'), 'order_num' => $rs->get('ordernum'), 'doc_date' => dte($rs->get('create_time')), 'full_firm_name' => $this->cfg('SHOP_R_FULL_FIRM_NAME'), 'firm_name1' => $this->cfg('SHOP_R_FIRM_NAME'), 'firm_address' => $this->cfg('SHOP_R_FIRM_ADRESS'), 'firm_inn' => $this->cfg('SHOP_R_FIRM_INN'), 'firm_kpp' => $this->cfg('SHOP_R_FIRM_KPP'), 'firm_name' => $this->cfg('SHOP_R_FIRM_INN'), 'firm_phone' => $this->cfg('SHOP_R_FIRM_PHONE'), 'firm_account' => $this->cfg('SHOP_R_FIRM_ACCOUNT'), 'firm_bank' => $this->cfg('SHOP_R_FIRM_BANK'), 'firm_bank_bik' => $this->cfg('SHOP_R_FIRM_BANK_BIK'), 'firm_corr_account' => $this->cfg('SHOP_R_FIRM_CORR_ACCOUNT'), 'firm_name' => $this->cfg('SHOP_R_FIRM_NAME'), 'doc_receiver' => $rs->get('fullname') . ' ' . $rs->get('first_name') . ' ' . $rs->get('middle_name'), 'receiver_address' => $rs->get('u_address'), 'doc_buyer' => $rs->get('company'), 'buyer_address' => $rs->get('u_address'), 'buyer_inn' => $inn, 'buyer_kpp' => $rs->get('kpp'), 'doc_director' => $this->cfg('SHOP_R_FIRM_DIRECTOR'), 'doc_accountant' => $this->cfg('SHOP_R_FIRM_ACCOUNTANT'), 'sum_nds' => 0, 'total' => 0, 'delivery' => $rs->get('delivery'), 'total_amount' => $rs->get('total_price'), 'goods' => array()); $data['total_propis'] = num2str($data['total_amount']); // $tpl=new MSXML($xml,$data,true); // header('Content-Type: application/vnd.ms-word'); // header('Content-Disposition: attachment; filename=СЧЕТ_НА_ОПЛАТУ_№_'.$data['order_num'].'_от_'.$data['doc_date'].'.doc'); // header('Expires: 0'); // header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); include "shared/php/mPDF/mpdf.php"; // $str = "<strong>Привет</strong>"; $tpl = 'schet_sber.htm'; $data['dir'] = dirname(__FILE__); $str = $this->render($data, dirname(__FILE__) . "/{$tpl}"); // $mpdf = new mPDF('UTF-8','A4','','',10,10,0,10,0,0); $mpdf = new mPDF('UTF-8', 'A4', '', ''); @$mpdf->WriteHTML(iconv('windows-1251', 'utf-8', $str)); @$mpdf->Output(); } exit; }
?> <br /><i style="color:red"><?php echo $item['name']; ?> </i><?php } elseif ($item['type'] != 'user') { ?> <br /><i style="color:green"><?php echo $item['name']; ?> </i><?php } ?> </td> <td style="white-space:nowrap"><strong><?php echo dte($item['date']); ?> </strong><br /><i><?php echo $item['time']; ?> </i></td> <td><i><?php echo $item['address']; ?> </i></td> <td><?php echo $item['price']; ?> </td> <td><?php echo $item['discount'];
static function export1c() { global $CONFIG, $ST; set_time_limit(1000); $data = array('make_date' => date('Y-m-d'), 'make_time' => date('H:i:s'), 'document' => array()); $date_from = date('Y-m-d'); $date_to = date('Y-m-d', time() + 3600 * 24); if (isset($_GET['d']) && ($t = strtotime($_GET['d']))) { $date_from = date('Y-m-d', $t); $date_to = date('Y-m-d', $t + 3600 * 24); } // if($get->get('date_from')){ // $date_from=$get->get('date_from'); // } // // if($get->get('date_to')){ // $date_to=$get->get('date_to'); // } $q = "SELECT u.*,o.* FROM sc_shop_order o\r\n\t\tLEFT JOIN sc_users AS u ON u.u_id=o.userid\r\n\t\tWHERE \r\n\t\t o.create_time>='{$date_from}' AND o.create_time<='{$date_to}'\r\n\t\t"; $rs = $ST->select($q); while ($rs->next()) { $d = array('id' => $rs->get('id'), 'num' => $rs->get('id'), 'date' => dte($rs->get('create_time'), 'Y-m-d'), 'summ' => $rs->get('total_price'), 'contragent' => array('id' => $rs->get('u_id') . '#' . $rs->get('login') . '#' . $rs->get('fullname') . '#' . $rs->get('phone'), 'name' => $rs->get('type') == 'user_jur' && trim($rs->get('company')) ? $rs->get('company') : $rs->get('fullname'), 'address' => $rs->get('address'), 'mail' => $rs->get('mail')), 'time' => dte($rs->get('create_time'), 'H:i:s'), 'additionally' => $rs->get('additionally'), 'goods' => array()); $q = "SELECT *,ec.id AS ext_cat_id, oi.price AS price \t\r\n\t\t\tFROM sc_shop_order_item AS oi, sc_shop_item AS si\r\n\t\t\tLEFT JOIN sc_shop_srv_extcat AS ec ON ec.lnk=si.category\r\n\t\t\tWHERE\r\n\t\t\t\tsi.id=oi.itemid\r\n\t\t\t\tAND oi.orderid={$rs->get('id')} \r\n\t\t\t\t\r\n\t\t\t"; $q = "SELECT *, oi.price AS price \t\r\n\t\t\tFROM sc_shop_order_item AS oi, sc_shop_item AS si\r\n\t\t\t\r\n\t\t\tWHERE\r\n\t\t\t\tsi.id=oi.itemid\r\n\t\t\t\tAND oi.orderid={$rs->get('id')} "; $rs1 = $ST->select($q); while ($rs1->next()) { $g = array('name' => $rs1->get('name'), 'id' => $rs1->get('ext_id'), 'price' => $rs1->get('price'), 'count' => $rs1->get('count'), 'summ' => $rs1->get('price') * $rs1->get('count')); if ($rs1->get('unit_sale') == 2) { if ($rs1->getInt('pack_size') != 0) { //03.02.2013 $g['count'] *= $rs1->getInt('pack_size'); $g['price'] /= $rs1->getInt('pack_size'); $g['price'] = round($g['price'], 2); } } $d['goods'][] = $g; } $data['document'][] = $d; } $file = ROOT . '/' . CATALOG_EXPORT_DIR . '/' . 'order.xml'; if (isset($_GET['d']) && ($t = strtotime($_GET['d']))) { $file = ROOT . '/' . CATALOG_EXPORT_DIR . '/' . date('Y_m_d', $t) . '.xml'; } $out = '<?xml version="1.0" encoding="windows-1251"?>'; $out .= LibCatsrv::render($data, dirname(__FILE__) . '/order1c.xml.php'); if (isset($_GET['get'])) { return $out; } else { file_put_contents($file, $out); exit; } }
echo $item["id"]; ?> "/></td> <td><a href="<?php echo $this->mod_uri; ?> waybillEdit/?id=<?php echo $item['id']; ?> " title="Просмотр">№ <strong style="font-size:14px"><?php echo $item['id']; ?> </strong></td> <td> <i><?php echo dte($item['time'], 'd.m H:i'); ?> </i> </td> <td> <?php if ($item['name']) { ?> <i><?php echo $item['name']; ?> - [<?php echo $item['car']; ?> ]</i> <?php
?> </td> <td class="xl65"><?php echo $row['price']; ?> </td> <td class="xl65"><?php echo $row['delivery']; ?> </td> <td class="xl65"><?php echo $row['total_price']; ?> </td> <td class="xl65"><?php echo dte($row['date'], 'd.m.Y'); ?> </td> <td class="xl65"><?php echo $row['order_status_desc']; ?> </td> <td class="xl65"><?php echo $row['comment']; ?> </td> </tr> <?php } ?>
</td> <td style="text-align:left"> <a href="/admin/<?php echo $this->rs->get('type'); ?> /?act=edit&id=<?php echo $this->rs->get('id'); ?> "><?php echo htmlspecialchars($this->rs->get('title')); ?> </a> </td> <td> <small>[<?php echo dte($this->rs->get('date')); ?> ]</small> (<?php echo $this->rs->get('position'); ?> ) </td> <td style="text-align:center" id="view<?php echo $this->rs->get('id'); ?> "> <?php echo $this->rs->get('view'); ?> </td> <td>
?> <table class="grid"> <tr><th>Время</th><th>Имя</th><th>Телефон</th><th>e-mail</th><th>Сообщение</th><th>Браузер</th><th>Тип</th><th>URL</th><th>Статус</th><th>Действие</th></tr> <?php while ($this->rs->next()) { ?> <tr> <td> <a href="<?php echo $this->mod_uri; ?> ?act=edit&id=<?php echo $this->rs->get('id'); ?> "><?php echo dte($this->rs->get('time'), 'd.m.Y H:i'); ?> </a><br> <?php echo $this->rs->get('ip'); ?> </td> <td><strong><?php echo $this->rs->get('name'); ?> </strong></td> <td><?php echo $this->rs->get('phone'); ?> </td> <td><?php
<tr> <td style="text-align:left"> <a href="/admin/<?php echo $this->rs->get('type'); ?> /?act=edit&id=<?php echo $this->rs->get('id'); ?> "><?php echo htmlspecialchars($this->rs->get('name')); ?> </a> </td> <td> <small>[<?php echo dte($this->rs->get('time')); ?> ]</small> </td> <td><small><?php echo $this->rs->get('question'); ?> </small></td> <td><small><?php echo $this->rs->get('answer'); ?> </small></td> <td><?php echo $this->rs->get('pos'); ?> </td>
</td> <td style="text-align:left"> <a href="/admin/users/?act=edit&id=<?php echo $this->rs->get('u_id'); ?> "><?php echo htmlspecialchars($this->rs->get('name')); ?> </a> </td> <td><small>[<?php echo dte($this->rs->get('time')); ?> ]</small></td> <td><small>[<?php echo dte($this->rs->get('date_to')); ?> ]</small></td> <td><small><?php echo $this->rs->get('description'); ?> </small></td> <td><small><?php echo $this->rs->get('text'); ?> </small></td> <td> <small>[<?php if ($this->rs->get('status') == 0) { ?>
echo $ps->getForm(array('Amount' => $item['total_price'], 'OrderId' => $item['ordernum'])); ?> <br> <?php } ?> <?php } ?> <?php } else { ?> <strong style="color:green">оплачен <?php echo dte($item['pay_time'], 'd.m.Y H:i'); ?> </strong> <?php } ?> </td> </tr> <?php } ?> </table> <?php
function getModulesData($begin = 0, $end = 0) { global $ST; $result = array(); $limitCond = " AND DATE(LOG_TIME) BETWEEN '" . dte($begin, 'Y-m-d') . "' AND '" . dte($end, 'Y-m-d') . "'"; $limitCond .= " AND REQUEST_COMPONENT NOT LIKE '/admin%'"; $notBotCond = ''; foreach ($this->bot as $b) { $notBotCond .= " AND USER_AGENT NOT LIKE '%{$b}%'"; } $queryString = "SELECT REQUEST_COMPONENT AS hr , count( REQUEST_COMPONENT ) AS c FROM sc_loger where 1=1\r\n\t\t\t{$limitCond}\r\n\t\t\t{$notBotCond}\r\n\t\t\tGROUP BY hr\r\n\t\t\tORDER BY c DESC\r\n\t\t\t"; $rs = $ST->select($queryString); while ($rs->next()) { $result[$rs->get('hr')]['all'] = $rs->getInt('c'); } $queryString = "SELECT REQUEST_COMPONENT AS hr , count( DISTINCT REMOTE_ADDR ) AS c FROM sc_loger where 1=1\r\n\t\t\t{$limitCond}\r\n\t\t\t{$notBotCond}\r\n\t\t\tGROUP BY hr\r\n\t\t\tORDER BY c DESC\r\n\t\t\t"; $rs = $ST->select($queryString); while ($rs->next()) { $result[$rs->get('hr')]['all_v'] = $rs->getInt('c'); } return $result; }
</table> <?php if ($type == 'collect') { ?> <h2>Информация по заказу</h2> <table style="width:100%" class="grid"> <tr><th style="width:200px">ответственный за сборку</th><td><?php echo $item['name']; ?> </td></tr> <tr><th>Передан в сборку</th><td><?php echo dte($item['time1'], 'd.m.Y H:i:s'); ?> </td></tr> <tr><th>Получен обратно</th><td><?php echo dte($item['time2'], 'd.m.Y H:i:s'); ?> </td></tr> </table> <?php } ?> <br /><br /><br /><br /> <table > <tr> <td> Заказчик________________________ </td> <td style="padding-left:50px"> Исполнитель________________________ </td>
echo $comment; ?> </textarea></td> </tr> <th>Ответ</th> <td> <textarea name="answer" style="width:100%;height:100px"><?php echo $answer; ?> </textarea> </td> </tr> <tr> <th><span>Ответ <small>(формат DD.MM.YYYY)</small></span></th> <td><input name="time_answer" value="<?php echo dte($time_answer); ?> " class="date" ><br /></td> </tr> <tr> <th>Статус</th> <td> <?php foreach ($status_list as $key => $desc) { ?> <input type="radio" class="radio" name="status" id="<?php echo $key; ?> " value="<?php echo $key; ?>
?> <?php if ($pay_system == 3) { ?> <?php if (empty($pay_status)) { ?> <strong style="color:red">НЕ оплачен <?php echo dte($pay_time, 'd.m.Y H:i'); ?> </strong> <?php } else { ?> <strong style="color:green">оплачен <?php echo dte($pay_time, 'd.m.Y H:i'); ?> </strong> <?php } ?> <?php } elseif ($pay_system == 2) { ?> <?php if (!empty($data['pay_account_jur'])) { ?> <?php echo parsJur($data['pay_account_jur']); ?> <?php
function actExp3() { global $ST, $post; $date_from = dte($post->get('date_from'), 'Y-m-d'); $date_to = dte($post->get('date_to'), 'Y-m-d'); $queryStr = "SELECT *,c.name AS c_name,i.name as i_name,i.id as i_id, d.* \r\n\t\t\tFROM sc_shop_item i, sc_shop_catalog c,sc_shop_srv_diff d \r\n\t\t\tWHERE c.id=i.category AND d.product=i.id AND d.time BETWEEN '{$date_from}' AND '{$date_to}' ORDER BY c.name,i.name "; $res = $ST->select($queryStr); $rs = array(); while ($res->next()) { $row = $res->getRow(); $row['price_diff'] = $row['price_new'] - $row['price_old']; $row['percent'] = ($row['price_new'] - $row['price_old']) / $row['price_old'] * 100; $rs[] = $row; } $data['rs'] = $rs; header('Content-Type: application/vnd.ms-excel; charset=windows-1251'); header('Content-Disposition: attachment; filename=result.xls'); header('Expires: 0'); header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); echo $this->render($data, dirname(__FILE__) . '/admin_catsrv_export3.xls.php'); exit; }
<th>Когда</th> <th>Куда</th> <th>Стоимость</th> <th>Статус</th> </tr> <?php $n = 0; foreach ($client_orders as $row) { ?> <tr> <td><?php echo $row['id']; ?> </td> <td><?php echo dte($row['date']); ?> <small><?php echo $row['time']; ?> </small></td> <td><?php echo $row['address']; ?> </td> <td><?php echo $row['price']; ?> р.</td> <td> <strong style="color:<?php
<?php _select_tree($catalog_tree, $category); ?> </select></div> <?php } ?> <div><label>Описание: <span>*</span></label><br><textarea name="description" class="field"></textarea></div> <div><label>Полный текст: <span>*</span></label><br><textarea name="text" class="field"></textarea></div> <div><label>Спрос действует до:</label><br><input name="date_to" class="date" value="<?php echo dte($date_to); ?> "></div> <input type="submit" class="button long" name="send" value="Отправить"> </div> </form> <div class="success"><?php echo $this->getText('msg_board_success'); ?> </div> <?php } else { ?> Необходимо выполнить <a href="/join/">вход</a> или <a href="/join/signup/">зарегистрироваться</a>
function actSave() { global $ST, $get, $post; $id = $post->getInt('id'); $data = array('content' => $post->get('content'), 'description' => $post->get('description'), 'title' => $post->get('title'), 'author' => $post->get('author'), 'date' => dte($post->get('date'), 'Y-m-d'), 'state' => $post->get('state'), 'category' => $post->getInt('category'), 'position' => $post->getInt('position'), 'gallery' => $post->getInt('gallery'), 'type' => $this->getType()); $img_out = ""; if (!empty($_FILES['upload']['name']) && isImg($_FILES['upload']['name'])) { $img = $this->cfg('NEWS_IMAGE_PATH') . '/' . md5($_FILES['upload']['tmp_name']) . "." . file_ext($_FILES['upload']['name']); move_uploaded_file($_FILES['upload']['tmp_name'], ROOT . $img); $data['img'] = $img; $img_out = scaleImg($img, 'w200'); } if ($post->getInt('clear')) { $data['img'] = ''; } if ($id) { $ST->update('sc_news', $data, "id=" . $id); } else { $id = $ST->insert('sc_news', $data); } $ST->delete('sc_relation', "parent={$id} AND type='public'"); foreach ($post->getArray('public_rel') as $v) { $ST->insert('sc_relation', array('parent' => $id, 'type' => 'public', 'child' => $v)); } $msg = "Сохранено"; if (true) { $content = ''; $content .= '<small>' . date('d.m.Y') . '</small> '; $content .= '<strong>' . $post->getHtml('title') . '</strong><br />'; $content .= '<span>' . $post->getHtml('description') . '</span><br />'; $content .= '<a href="http://' . $this->cfg('SITE') . '/' . $post->get('type') . '/' . $id . '/">подробнее...</a>'; if ($post->exists('save_and_send')) { $mail = new Mail(); $mail->setFromMail(array($this->cfg('SITE'), $this->cfg('mail'))); $key = 'http://' . $this->cfg('SITE') . '/cabinet/unsubscribe/?key=' . md5($this->getUser('mail') . $this->getType() . 'unsubscribe') . '&type=' . $this->getType() . '&mail=' . $this->getUser('mail'); $key = '<a href="' . $key . '">' . $key . '</a>'; $mail->setTemplate('letter_' . $this->getType(), array('FROM_SITE' => $this->cfg('SITE'), 'CONTENT' => $content, 'BODY' => $post->get('content'), 'TITLE' => $post->get('title'))); $mail->xsend($this->getUser('mail'), array('UNSUBSCRIBE' => $key)); } elseif ($post->exists('save_and_send_all')) { $q = "SELECT distinct mail,id FROM sc_subscribe WHERE type LIKE '%" . $this->getType() . "%' \r\n\t\t\t\tAND NOT EXISTS(SELECT mailid FROM sc_news_sendlog WHERE id=mailid AND newsid={$id}){$this->getMailFilter()}"; if ($post->getInt('pack')) { $q .= " LIMIT {$post->getInt('pack')}"; } $rs = $ST->select($q); $mail = new Mail(); // $mail->setFromMail($this->getConfig('mail')); $mail->setFromMail(array($this->cfg('SITE'), $this->cfg('mail'))); $mail->setTemplate('letter_' . $this->getType(), array('FROM_SITE' => $this->cfg('SITE'), 'CONTENT' => $content, 'BODY' => $post->get('content'), 'TITLE' => $post->get('title'))); $n = 0; while ($rs->next()) { if (check_mail($m = trim($rs->get('mail')))) { $key = 'http://' . $this->cfg('SITE') . '/cabinet/unsubscribe/?key=' . md5($rs->get('mail') . $this->getType() . 'unsubscribe') . '&type=' . $this->getType() . '&mail=' . $rs->get('mail'); $key = '<a href="' . $key . '">' . $key . '</a>'; $mail->xsend($m, array('UNSUBSCRIBE' => $key)); $ST->insert('sc_news_sendlog', array('mailid' => $rs->get('id'), 'newsid' => $id)); $n++; } else { $ST->delete('sc_subscribe', "mail='" . SQL::slashes($rs->get('mail')) . "'"); } } $msg .= " отправлено {$n}"; } } echo printJSONP(array('msg' => $msg, 'id' => $id, 'img' => $img_out)); exit; }
<td title="<?php echo dte($this->rs->get('reg_date'), 'd.m.y H:i:s'); ?> "><?php echo dte($this->rs->get('reg_date'), 'd.m.y'); ?> </td> <td><?php echo $this->rs->getInt('visit'); ?> </td> <td title="<?php echo dte($this->rs->get('last_visit'), 'd.m.y H:i:s'); ?> "><?php echo dte($this->rs->get('last_visit'), 'd.m.y'); ?> </td> <?php /*td><?=$this->rs->get('f_messages');?></td*/ ?> <td><?php echo $this->rs->get('balance'); ?> </td> <td><?php echo $this->rs->get('discount'); ?> </td> <td style="white-space:nowrap;text-align:right"> <a href="?act=asUser&id=<?php
<?php } ?> </select> </td> </tr> <?php } ?> <tr> <th>Дата</th> <td><input name="date" value="<?php echo dte($date); ?> " class="date" ></td> </tr> <tr> <th>Изображение</th> <td> <div id="html"><img rel="/img/no_image.png" id="img" src="<?php if ($img) { echo scaleImg($img, 'h100'); } else { ?> /img/no_image.png<?php }
function actStatBrandSale() { global $ST, $post; $q = "SELECT COUNT(m.id) AS c,m.id,m.name FROM sc_shop_order o,sc_shop_order_item oi,sc_shop_item i,sc_manufacturer m \r\n\t\tWHERE o.create_time BETWEEN '" . dte($post->get('date_from'), 'Y-m-d') . "' AND '" . dte($post->get('date_to'), 'Y-m-d') . " 23:59:59'\r\n\t\tAND oi.orderid=o.id AND oi.itemid=i.id AND i.manufacturer_id=m.id\r\n\t\t \r\n\t\tGROUP BY m.id,m.name\r\n\t\tORDER BY c DESC\r\n\t\t"; $rs = $ST->select($q); $data['rs'] = $rs->toArray(); echo $this->render($data, dirname(__FILE__) . "/stat_brand_sale.tpl.php"); }
echo $item['id']; ?> " class="item_head"> <tr> <th> <a class="expand" href="#<?php echo $item['id']; ?> "> <?php echo $item['id']; ?> </a> </th> <th><?php echo dte($item['create_time']); ?> </th> <th style="text-align:right;"><?php echo price($item['total_price']); ?> </th> </tr> </thead> <tbody id="body<?php echo $item['id']; ?> "> <tr> <td colspan="3" class="item_content"> <?php
function actSaveOrder() { include 'modules/catalog/Basket.class.php'; global $ST, $post; $id = $post->getInt('id'); $count = $post->getArray('count'); $price = $post->getArray('price'); if (!$count) { echo printJSON(array('msg' => 'Ошибка сохранения. Корзина пуста')); exit; } $orderItem = $count; $rs = $ST->select("SELECT * \r\n\t\t\tFROM sc_shop_item \r\n\t\t\tWHERE id IN (" . implode(',', array_keys($count)) . ")"); while ($rs->next()) { $orderItem[$rs->get('id')] = array('count' => $count[$rs->get('id')], 'price' => $price[$rs->get('id')]); } $basket = new Basket($orderItem); $basket->delivery = $post->getFloat('delivery'); $basket->discount = $post->getFloat('discount'); $data = array('order_status' => $post->get('order_status'), 'comment' => $post->get('comment'), 'review' => $post->get('review'), 'perfid' => $this->getUserId(), 'price' => $basket->getPrice(), 'total_price' => $basket->getTotalPrice(), 'discount' => $basket->discount, 'delivery' => $basket->delivery, 'delivery_type' => $post->get('delivery_type'), 'date' => dte($post->get('date'), 'Y-m-d'), 'time' => $post->get('time'), 'fullname' => $post->get('fullname'), 'address' => $post->get('address'), 'phone' => $post->get('phone'), 'additionally' => $post->get('additionally')); $out['msg'] = 'Сохранено'; if ($id) { if (in_array($data['order_status'], array(3))) { //Логируем изменения $cur_data = array('date' => '', 'discount' => '', 'delivery' => '', 'delivery_type' => ''); $cur_data_item = array(); $rs = $ST->select("SELECT " . implode(',', array_keys($cur_data)) . " FROM sc_shop_order WHERE id={$id}"); if ($rs->next()) { $cur_data = $rs->getRow(); $rs = $ST->select("SELECT itemid,count,price FROM sc_shop_order_item WHERE orderid={$id} ORDER BY itemid"); while ($rs->next()) { $row = $rs->getRow(); $cur_data['items'][$rs->get('itemid')] = array('count' => $rs->get('count'), 'price' => $rs->get('price')); } } // $change=array(); // foreach ($cur_data as $k=>$v){ // if(trim($v)!=trim($data[$k])){ // $change[$k]=$data[$k]; // } // } // ksort($orderItem); // if(json_encode($cur_data_item)!=json_encode($orderItem)){ // $change['item']=$cur_data_item; // } if ($cur_data) { $ST->insert('sc_shop_order_datalog', array('orderid' => $id, 'data' => serialize($cur_data))); } } //////////////////////////////////// $ST->update('sc_shop_order', $data, "id=" . $id); $ST->delete('sc_shop_order_item', 'orderid=' . $id); } else { $data['userid'] = $this->getUserId(); $id = $ST->insert('sc_shop_order', $data); } $this->logOrder($id, $this->getUserId(), $post->get('order_status')); foreach ($orderItem as $key => $row) { $d['orderid'] = $id; $d['itemid'] = $key; $d['count'] = $row['count']; $d['price'] = $row['price']; $ST->insert('sc_shop_order_item', $d); } $out['id'] = $id; echo printJSON($out); exit; }