Changeset 0ebef4e
- Timestamp:
- Mar 12, 2015, 8:11:13 PM (8 years ago)
- Branches:
- master
- Children:
- c7d197d
- Parents:
- 4cefac0
- Files:
-
- 3 added
- 214 edited
Legend:
- Unmodified
- Added
- Removed
-
cli/async.php
r4cefac0 r0ebef4e 3 3 // MultiMag v0.2 - Complex sales system 4 4 // 5 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org5 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 6 6 // 7 7 // This program is free software: you can redistribute it and/or modify -
cli/backup.php
r4cefac0 r0ebef4e 3 3 // MultiMag v0.2 - Complex sales system 4 4 // 5 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org5 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 6 6 // 7 7 // This program is free software: you can redistribute it and/or modify -
cli/bank_exchange.php
r4cefac0 r0ebef4e 3 3 // MultiMag v0.2 - Complex sales system 4 4 // 5 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org5 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 6 6 // 7 7 // This program is free software: you can redistribute it and/or modify -
cli/core.cli.inc.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
cli/daily.php
r4cefac0 r0ebef4e 3 3 // MultiMag v0.2 - Complex sales system 4 4 // 5 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org5 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 6 6 // 7 7 // This program is free software: you can redistribute it and/or modify -
cli/db_check_struct.php
r4cefac0 r0ebef4e 3 3 // MultiMag v0.2 - Complex sales system 4 4 // 5 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org5 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 6 6 // 7 7 // This program is free software: you can redistribute it and/or modify -
cli/db_optimize.php
r4cefac0 r0ebef4e 3 3 // MultiMag v0.2 - Complex sales system 4 4 // 5 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org5 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 6 6 // 7 7 // This program is free software: you can redistribute it and/or modify -
cli/db_update.php
r4cefac0 r0ebef4e 3 3 // MultiMag v0.2 - Complex sales system 4 4 // 5 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org5 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 6 6 // 7 7 // This program is free software: you can redistribute it and/or modify -
cli/fixer.php
r4cefac0 r0ebef4e 3 3 // MultiMag v0.2 - Complex sales system 4 4 // 5 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org5 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 6 6 // 7 7 // This program is free software: you can redistribute it and/or modify … … 25 25 26 26 require_once("$base_path/config_cli.php"); 27 require_once("$base_path/web/include/doc.core.php"); 27 28 require_once($CONFIG['cli']['location']."/core.cli.inc.php"); 28 require_once("$base_path/web/include/doc.core.php"); 29 29 30 $sec = 0; 30 31 31 function transfer($firm_from_id, $firm_to_id, $store_from_id, $store_to_id) {32 global $db, $sec; 33 $sec++;34 $sum = 0;35 $unc_pos = array();36 $ price_pos = array();37 echo "TRANSFER FROM $firm_from_id TO $firm_to_id:::::::::::::::::::::::::::::::::::::\n";38 $res = $db->query("SELECT `doc_base`.`id`, `doc_base`.`name` FROM `doc_base` ORDER BY `id`"); 39 while($pos_info = $res->fetch_assoc()) { 40 $min = 0;41 $cnt = 0;42 $price = 0;43 $date_info = '';44 $r = $db->query("SELECT `doc_list_pos`.`cnt`, `doc_list`.`type`, `doc_list`.`sklad`, `doc_list_pos`.`cost`, `doc_list`.`date` "45 . "FROM `doc_list` "46 . "INNER JOIN `doc_list_pos` ON `doc_list`.`id`=`doc_list_pos`.`doc` "47 . "WHERE `doc_list_pos`.`tovar`='{$pos_info['id']}' AND `doc_list`.`firm_id`=$firm_from_id AND `doc_list`.`type`<=2 AND `doc_list`.`ok`>0 "48 . "ORDER BY `doc_list`.`date`");49 while($doc_line = $r->fetch_assoc()) {50 switch($doc_line['type']) {51 case 1:52 $cnt += $doc_line['cnt'];53 if($doc_line['cost']) {54 $price = $doc_line['cost'];55 }56 break;57 case 2:58 $cnt -= $doc_line['cnt'];59 if($cnt<0) {60 $min = min($min, $cnt);61 $date_info .= date("Y-m-d ", $doc_line['date']);62 }63 break;32 function getMinCntPos($pos_id, $store_id) 33 { 34 global $db; 35 settype($pos_id, 'int'); 36 settype($store_id, 'int'); 37 $cnt = $mincnt = 0; 38 $res = $db->query("SELECT `doc_list_pos`.`cnt`, `doc_list`.`type`, `doc_list`.`sklad`, `doc_list`.`id`, `doc_list_pos`.`page` FROM `doc_list_pos` 39 INNER JOIN `doc_list` ON `doc_list`.`id`=`doc_list_pos`.`doc` 40 WHERE `doc_list`.`ok`>'0' AND `doc_list_pos`.`tovar`=$pos_id AND 41 (`doc_list`.`type`=1 OR `doc_list`.`type`=2 OR `doc_list`.`type`=8 OR `doc_list`.`type`=17) 42 ORDER BY `doc_list`.`date`"); 43 while ($nxt = $res->fetch_row()) { 44 if ($nxt[1] == 1) { 45 if ($nxt[2] == $store_id) 46 $cnt+=$nxt[0]; 47 } 48 else if ($nxt[1] == 2 || $nxt[1] == 20) { 49 if ($nxt[2] == $store_id) 50 $cnt-=$nxt[0]; 51 } 52 else if ($nxt[1] == 8) { 53 if ($nxt[2] == $store_id) 54 $cnt-=$nxt[0]; 55 else { 56 $r = $db->query("SELECT `value` FROM `doc_dopdata` WHERE `doc`=$nxt[3] AND `param`='na_sklad'"); 57 if (!$r->num_rows) 58 throw new Exception("Cклад назначения в перемещении $nxt[3] не задан"); 59 list($nasklad) = $r->fetch_row(); 60 if (!$nasklad) 61 throw new Exception("Нулевой склад назначения в перемещении $nxt[3] при проверке на отрицательные остатки"); 62 if ($nasklad == $store_id) 63 $cnt+=$nxt[0]; 64 $r->free(); 64 65 } 65 66 } 66 if($min<0) { 67 echo "id:{$pos_info['id']}, {$pos_info['name']}: $min, date: $date_info\n"; 68 $unc_pos[$pos_info['id']] = abs($min); 69 $price_pos[$pos_info['id']] = getInCost($pos_info['id']); 70 $sum += abs($min)*$price; 67 else if ($nxt[1] == 17) { 68 if ($nxt[2] == $store_id) { 69 if ($nxt[4] == 0) 70 $cnt+=$nxt[0]; 71 else 72 $cnt-=$nxt[0]; 73 } 74 } 75 $cnt = round($cnt, 3); 76 if ($cnt < $mincnt) { 77 $mincnt = $cnt; 71 78 } 72 79 } 80 $res->free(); 81 return array($cnt, $mincnt); 82 } 73 83 74 if(count($unc_pos)) { 75 $doc_data = array( 76 'type' => 1, 77 'agent' => 12, 78 'date' => strtotime("2005-01-10 12:01:$sec"), 79 'created'=> date("Y-m-d H:i:s"), 80 'ok' => time(), 81 'sklad' => $store_from_id, 82 'altnum'=> -1, 83 'subtype'=>'bux', 84 'firm_id'=>$firm_from_id, 85 'sum' => $sum 86 ); 87 $doc_id = $db->insertA('doc_list', $doc_data); 84 function testMinusStore($store_id, $firm_id) { 85 global $db; 86 $pos_list = array(); 87 $pos_plus_list = array(); 88 $res = $db->query("SELECT `id`, CONCAT(`vc`, ' ', `name`) AS `name`, `cost` 89 FROM `doc_base` 90 WHERE `pos_type`=0 91 ORDER BY `id`"); 92 $sum = $plus_sum = 0; 93 while($line = $res->fetch_assoc()) { 94 list($cnt, $mincnt) = getMinCntPos($line['id'], $store_id); 95 $mincnt = ceil(abs($mincnt)); 96 if($mincnt>0) { 97 $pos_list[$line['id']] = array('tovar'=>$line['id'], 'cnt'=>$mincnt, 'cost'=>$line['cost']); 98 $sum += $mincnt*$line['cost']; 99 echo "{$line['name']} - $mincnt\n"; 100 } 101 if($cnt<0) { 102 $pos_plus_list[$line['id']] = array('tovar'=>$line['id'], 'cnt'=>ceil(abs($cnt)), 'cost'=>$line['cost']); 103 $plus_sum += $mincnt*$line['cost']; 104 } 105 } 106 107 if(count($pos_plus_list)) { 108 fixStartCnt($store_id, $firm_id, $pos_plus_list, $plus_sum); 109 } 110 111 if(count($pos_list)) { 112 fixStore($store_id, $firm_id, $pos_list, $sum); 113 } 114 if(count($pos_plus_list) || count($pos_list)) { 115 return 1; 116 } 117 } 88 118 89 $pos_data = array( 90 'doc' => $doc_id, 91 'tovar' => 0, 92 'cnt' => 1, 93 'cost' => 100 94 ); 119 function fixStartCnt($store_id, $firm_id, $pos_list, $sum) { 120 global $db, $sec; 121 122 $doc_data = array( 123 'type' => 1, 124 'agent' => 1, 125 'date' => strtotime("2005-01-10 12:01:00"), 126 'created'=> date("Y-m-d H:i:s"), 127 'ok' => time(), 128 'sklad' => $store_id, 129 'altnum'=> $store_id, 130 'subtype'=>'sfix', 131 'firm_id'=>$firm_id, 132 'sum' => $sum 133 ); 134 $doc_id = $db->insertA('doc_list', $doc_data); 95 135 96 foreach($unc_pos as $pos_id => $cnt) { 97 if(isset($price_pos[$pos_id])) { 98 if($price_pos[$pos_id]>0) { 99 $pos_data['cost'] = $price_pos[$pos_id]; 100 } 101 } 102 $pos_data['tovar'] = $pos_id; 103 $pos_data['cnt'] = $cnt; 104 $db->insertA('doc_list_pos', $pos_data); 105 } 136 foreach($pos_list as $pos_info) { 137 $pos_info['doc'] = $doc_id; 138 $db->insertA('doc_list_pos', $pos_info); 139 } 140 } 106 141 107 $doc_data['date'] = strtotime("2014-12-14 18:01:$sec"); 108 $doc_data['type'] = 2; 109 $doc_data['sklad'] = $store_to_id; 110 $doc_data['firm_id'] = $firm_to_id; 111 $doc_data['p_doc'] = $doc_id; 142 function fixStore($store_id, $firm_id, $pos_list, $sum) { 143 global $db, $sec; 144 145 $doc_data = array( 146 'type' => 1, 147 'agent' => 1, 148 'date' => strtotime("2005-01-10 12:00:00"), 149 'created'=> date("Y-m-d H:i:s"), 150 'ok' => time(), 151 'sklad' => $store_id, 152 'altnum'=> $store_id, 153 'subtype'=>'fix', 154 'firm_id'=>$firm_id, 155 'sum' => $sum 156 ); 157 $doc_id = $db->insertA('doc_list', $doc_data); 112 158 113 $doc_id = $db->insertA('doc_list', $doc_data); 114 $pos_data['doc'] = $doc_id; 159 foreach($pos_list as $pos_info) { 160 $pos_info['doc'] = $doc_id; 161 $db->insertA('doc_list_pos', $pos_info); 162 } 115 163 116 foreach($unc_pos as $pos_id => $cnt) {117 if(isset($price_pos[$pos_id])) {118 if($price_pos[$pos_id]>0) {119 $pos_data['cost'] = $price_pos[$pos_id]; 120 }121 }122 $pos_data['tovar'] = $pos_id; 123 $pos_data['cnt'] = $cnt;124 $db->insertA('doc_list_pos', $pos_data);125 }164 $doc_data['date'] = time(); 165 $doc_data['type'] = 2; 166 $doc_data['p_doc'] = $doc_id; 167 168 $doc_id = $db->insertA('doc_list', $doc_data); 169 $pos_data['doc'] = $doc_id; 170 171 foreach($pos_list as $pos_info) { 172 $pos_info['doc'] = $doc_id; 173 $db->insertA('doc_list_pos', $pos_info); 126 174 } 127 175 } 128 176 129 177 $db->startTransaction(); 130 transfer(3, 1, 1, 1); 131 transfer(1, 3, 1, 1); 132 133 transfer(4, 3, 2, 1); 134 transfer(3, 1, 1, 1); 135 transfer(1, 4, 1, 2); 136 137 transfer(4, 3, 2, 1); 138 transfer(3, 1, 1, 1); 139 transfer(1, 4, 1, 2); 140 141 142 echo"test:\n"; 143 sleep(1); 144 transfer(4, 3, 1, 1); 145 transfer(1, 3, 1, 1); 146 transfer(3, 4, 1, 1); 147 178 $res = $db->query("SELECT `id`, `name` FROM `doc_sklady` ORDER BY `id`"); 179 while($line = $res->fetch_assoc()) { 180 echo "FIX {$line['name']}:\n"; 181 if(testMinusStore($line['id'], 1)) { 182 echo "AGAIN:\n"; 183 testMinusStore($line['id'], 1); 184 } 185 } 186 //$db->rollback(); 148 187 $db->commit(); 149 188 -
cli/iptinit.php
r4cefac0 r0ebef4e 3 3 // MultiMag v0.2 - Complex sales system 4 4 // 5 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org5 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 6 6 // 7 7 // This program is free software: you can redistribute it and/or modify -
cli/price_an.php
r4cefac0 r0ebef4e 3 3 // MultiMag v0.2 - Complex sales system 4 4 // 5 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org5 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 6 6 // 7 7 // This program is free software: you can redistribute it and/or modify -
cli/ps_parser.php
r4cefac0 r0ebef4e 3 3 // MultiMag v0.2 - Complex sales system 4 4 // 5 // Copyright (C) 2005-201 4, Sl_An, TND Team, http://tndproject.org5 // Copyright (C) 2005-2015, Sl_An, TND Team, http://tndproject.org 6 6 // 7 7 // This program is free software: you can redistribute it and/or modify -
cli/resp_clear.php
r4cefac0 r0ebef4e 3 3 // MultiMag v0.2 - Complex sales system 4 4 // 5 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org5 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 6 6 // 7 7 // This program is free software: you can redistribute it and/or modify -
cli/up_to_0.2.php
r4cefac0 r0ebef4e 3 3 // MultiMag v0.2 - Complex sales system 4 4 // 5 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org5 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 6 6 // 7 7 // This program is free software: you can redistribute it and/or modify -
common/action.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
common/actions/agentcalcavgsum.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
common/actions/agentdiscountnotify.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
common/actions/currencyupdater.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
common/actions/docmove.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
common/actions/respdebtnotify.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
common/actions/userfree.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
common/async/dbcheck.php
r4cefac0 r0ebef4e 3 3 // MultiMag v0.2 - Complex sales system 4 4 // 5 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org5 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 6 6 // 7 7 // This program is free software: you can redistribute it and/or modify -
common/async/psparser.php
r4cefac0 r0ebef4e 3 3 // MultiMag v0.2 - Complex sales system 4 4 // 5 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org5 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 6 6 // 7 7 // This program is free software: you can redistribute it and/or modify -
common/asyncworker.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
common/bank1c.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
common/core.common.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
common/priceloader.ods.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
common/priceloader.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
common/priceloader.xls.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
config_all.sample.php
r4cefac0 r0ebef4e 15 15 $CONFIG['site']['location'] = $CONFIG['location'].'/web'; 16 16 $CONFIG['cli']['location'] = $CONFIG['location'].'/cli'; 17 $CONFIG['site']['user_pass_period'] = false; // Срок действия (суток) пароля обычного пользователя. Если false - не ограничен. false по умолчанию 18 $CONFIG['site']['worker_pass_period'] = 90; // Срок действия (суток) пароля сотрудника. Если false - не ограничен. 90 по умолчанию. 17 19 18 20 // Настройки базы данных -
examples/dovecot.sql
r4cefac0 r0ebef4e 26 26 CREATE TABLE IF NOT EXISTS `virtual_domains` ( 27 27 `id` int(11) NOT NULL AUTO_INCREMENT, 28 `name` varchar( 50) NOT NULL,28 `name` varchar(64) NOT NULL, 29 29 PRIMARY KEY (`id`) 30 30 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; -
web/1c_sync.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
web/adm.php
r4cefac0 r0ebef4e 3 3 // MultiMag v0.2 - Complex sales system 4 4 // 5 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org5 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 6 6 // 7 7 // This program is free software: you can redistribute it and/or modify -
web/adm_comments.php
r4cefac0 r0ebef4e 3 3 // MultiMag v0.2 - Complex sales system 4 4 // 5 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org5 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 6 6 // 7 7 // This program is free software: you can redistribute it and/or modify -
web/adm_users.php
r4cefac0 r0ebef4e 3 3 // MultiMag v0.2 - Complex sales system 4 4 // 5 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org5 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 6 6 // 7 7 // This program is free software: you can redistribute it and/or modify … … 37 37 $order = '`users`.`id`'; 38 38 $res = $db->query("SELECT `users`.`id`, `users`.`name`, `users`.`reg_email`, `users`.`reg_email_confirm`, `users`.`reg_email_subscribe`, 39 40 41 42 43 44 39 `users`.`reg_phone`, `users`.`reg_phone_confirm`, `users`.`reg_phone_subscribe`, `users`.`reg_date`, `users_worker_info`.`worker`, 40 ( SELECT `date` FROM `users_login_history` WHERE `user_id`=`users`.`id` ORDER BY `date` DESC LIMIT 1) AS `lastlogin_date`, 41 ( SELECT `user_id` FROM `users_openid` WHERE `user_id`=`users`.`id` LIMIT 1) AS `openid` 42 FROM `users` 43 LEFT JOIN `users_worker_info` ON `users_worker_info`.`user_id`=`users`.`id` 44 ORDER BY $order"); 45 45 $tmpl->addBreadcrumb('Список пользователей', ''); 46 46 $tmpl->setTitle('Список пользователей'); -
web/adv_search.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
web/articles.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
web/attachments.php
r4cefac0 r0ebef4e 3 3 // MultiMag v0.2 - Complex sales system 4 4 // 5 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org5 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 6 6 // 7 7 // This program is free software: you can redistribute it and/or modify -
web/c_img.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
web/core.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
web/counter.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
web/doc.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
web/doc_opt.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
web/doc_reports.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
web/doc_sc.php
r4cefac0 r0ebef4e 3 3 // MultiMag v0.2 - Complex sales system 4 4 // 5 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org5 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 6 6 // 7 7 // This program is free software: you can redistribute it and/or modify -
web/doc_service.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
web/docj.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
web/docj_new.php
r4cefac0 r0ebef4e 3 3 // MultiMag v0.2 - Complex sales system 4 4 // 5 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org5 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 6 6 // 7 7 // This program is free software: you can redistribute it and/or modify -
web/docs.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
web/e404.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
web/factory.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
web/get_yml.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
web/gpb_check.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
web/gpb_pay.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
web/gpb_pay_failed.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
web/gpb_pay_success.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
web/images.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
web/include/comments.inc.php
r4cefac0 r0ebef4e 3 3 // MultiMag v0.2 - Complex sales system 4 4 // 5 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org5 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 6 6 // 7 7 // This program is free software: you can redistribute it and/or modify -
web/include/doc.agent_dov.inc.php
r4cefac0 r0ebef4e 3 3 // MultiMag v0.2 - Complex sales system 4 4 // 5 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org5 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 6 6 // 7 7 // This program is free software: you can redistribute it and/or modify -
web/include/doc.core.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
web/include/doc.dogovor.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
web/include/doc.doveren.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
web/include/doc.kompredl.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
web/include/doc.korbonus.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
web/include/doc.kordolga.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
web/include/doc.nulltype.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify … … 1634 1634 LEFT JOIN `doc_agent` AS `b` ON `a`.`agent`=`b`.`id` 1635 1635 WHERE `a`.`id`='".(int)$this->doc."'"); 1636 if(!$res->num_rows) throw new Exception("Документ не найден");1636 if(!$res->num_rows) throw new NotFoundException("Документ не найден"); 1637 1637 $this->doc_data = $res->fetch_assoc(); 1638 1638 -
web/include/doc.pbank.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
web/include/doc.peremeshenie.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
web/include/doc.perkas.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
web/include/doc.pko.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
web/include/doc.poseditor.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
web/include/doc.postuplenie.php
r4cefac0 r0ebef4e 3 3 // MultiMag v0.2 - Complex sales system 4 4 // 5 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org5 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 6 6 // 7 7 // This program is free software: you can redistribute it and/or modify -
web/include/doc.predlojenie.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
web/include/doc.rbank.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
web/include/doc.realiz_bonus.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
web/include/doc.realiz_op.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
web/include/doc.realizaciya.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
web/include/doc.rko.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
web/include/doc.s.agent.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
web/include/doc.s.agent_dov.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
web/include/doc.s.inform.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
web/include/doc.s.nulltype.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
web/include/doc.s.price_an.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
web/include/doc.s.sklad.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
web/include/doc.sborka.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify … … 61 61 $sign = $line['page'] ? '-' : '+'; 62 62 $db->query("UPDATE `doc_base_cnt` SET `cnt`=`cnt` $sign '{$line['cnt']}' WHERE `id`='{$line['tovar']}' AND `sklad`='{$doc_info['sklad']}'"); 63 // Если это первое поступление 64 if ($db->affected_rows == 0) { 65 $db->query("INSERT INTO `doc_base_cnt` (`id`, `sklad`, `cnt`) VALUES ('{$line['tovar']}', '$doc_info[3]', '{$line['cnt']}')"); 66 } 63 67 64 68 if ($line['page']) { … … 80 84 } 81 85 } 82 83 if($fail_text) { 84 throw new Exception("Ошибка номенклатуры: \n".$fail_text); 85 } 86 // Если это первое поступление 87 if ($db->affected_rows == 0) { 88 $db->query("INSERT INTO `doc_base_cnt` (`id`, `sklad`, `cnt`) VALUES ('$line[0]', '$doc_info[3]', '{$line['cnt']}')"); 89 } 86 } 87 if($fail_text) { 88 throw new Exception("Ошибка номенклатуры: \n".$fail_text); 90 89 } 91 90 if ($silent) { -
web/include/doc.sklad.kompl.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
web/include/doc.sklad.link.php
r4cefac0 r0ebef4e 3 3 // MultiMag v0.2 - Complex sales system 4 4 // 5 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org5 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 6 6 // 7 7 // This program is free software: you can redistribute it and/or modify -
web/include/doc.specific.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
web/include/doc.v_puti.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
web/include/doc.zapposeditor.php
r4cefac0 r0ebef4e 1 1 <?php 2 // MultiMag v0.2 - Complex sales system 3 // 4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 // 6 // This program is free software: you can redistribute it and/or modify 7 // it under the terms of the GNU Affero General Public License as 8 // published by the Free Software Foundation, either version 3 of the 9 // License, or (at your option) any later version. 10 // 11 // This program is distributed in the hope that it will be useful, 12 // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 // GNU Affero General Public License for more details. 15 // 16 // You should have received a copy of the GNU Affero General Public License 17 // along with this program. If not, see <http://www.gnu.org/licenses/>. 18 // 2 19 3 20 include_once('include/doc.poseditor.php'); -
web/include/doc.zayavka.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
web/include/doc.zsbor.php
r4cefac0 r0ebef4e 3 3 // MultiMag v0.2 - Complex sales system 4 4 // 5 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org5 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 6 6 // 7 7 // This program is free software: you can redistribute it and/or modify -
web/include/doc/printforms/doveren/dov.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
web/include/doc/printforms/iprintform.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
web/include/doc/printforms/realiz_op/sfak.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
web/include/doc/printforms/realiz_op/torg12.php
r4cefac0 r0ebef4e 3 3 // MultiMag v0.2 - Complex sales system 4 4 // 5 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org5 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 6 6 // 7 7 // This program is free software: you can redistribute it and/or modify -
web/include/doc/printforms/realiz_op/upd.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
web/include/doc/printforms/realizaciya/certlist.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify … … 101 101 } 102 102 103 $res = $db->query("SELECT `id`, `param` FROM `doc_base_params` WHERE `param`='Срок годности'");103 $res = $db->query("SELECT `id`, `param` FROM `doc_base_params` WHERE `param`='Срок реализации'"); 104 104 if(!$res->num_rows) { 105 105 throw new \Exception('Не найден параметр *срок годности*. Создайте параметр с таким названием в настройках параметров складской номенклатуры.'); 106 106 } 107 107 list($exp_date_id) = $res->fetch_row(); 108 109 $res = $db->query("SELECT `id`, `param` FROM `doc_base_params` WHERE `param`='Температура хранения'"); 110 if(!$res->num_rows) { 111 throw new \Exception('Не найден параметр *Температура хранения*. Создайте параметр с таким названием в настройках параметров складской номенклатуры.'); 112 } 113 list($t_store_id) = $res->fetch_row(); 108 114 109 115 $res = $db->query("SELECT `doc_list_pos`.`tovar` AS `pos_id`, `doc_group`.`printname` AS `group_printname`, `doc_base`.`name`, 110 116 `doc_base`.`proizv` AS `vendor`, `doc_base`.`vc`, `certnum`.`value` AS `cert_num`, `certdate`.`value` AS `cert_dates`, 111 `certcreator`.`value` AS `cert_creator`, `exp`.`value` AS `exp_date` 117 `certcreator`.`value` AS `cert_creator`, `exp`.`value` AS `exp_date`, `tst`.`value` AS `t_store` 112 118 FROM `doc_list_pos` 113 119 INNER JOIN `doc_base` ON `doc_list_pos`.`tovar`=`doc_base`.`id` … … 117 123 LEFT JOIN `doc_base_values` AS `certcreator` ON `certcreator`.`id`=`doc_list_pos`.`tovar` AND `certcreator`.`param_id`=$cert_creator_id 118 124 LEFT JOIN `doc_base_values` AS `exp` ON `exp`.`id`=`doc_list_pos`.`tovar` AND `exp`.`param_id`=$exp_date_id 125 LEFT JOIN `doc_base_values` AS `tst` ON `tst`.`id`=`doc_list_pos`.`tovar` AND `tst`.`param_id`=$t_store_id 119 126 WHERE `doc_list_pos`.`doc`='{$doc_id}' 120 127 ORDER BY `doc_list_pos`.`id`"); … … 161 168 162 169 $this->pdf->SetLineWidth($this->line_bold_w); 163 $t_width = array(10, 75, 35, 40, 40, 40, 37);170 $t_width = array(10, 75, 40, 40, 40, 70); 164 171 $t_text = array( 165 172 'N п/п', 166 173 'Наименование товара', 167 'Производитель',168 174 'N сертификата', 169 175 'Срок действия', 170 176 'Орган сертификации', 171 'Срок годности товара');177 'Срок реализации, температура хранения'); 172 178 173 179 foreach ($t_width as $i => $w) { … … 194 200 $i++, 195 201 $line['name'], 196 $line['vendor'],197 202 $line['cert_num'], 198 203 $line['cert_dates'], 199 204 $line['cert_creator'], 200 $line['exp_date'] );205 $line['exp_date'].', '.$line['t_store']); 201 206 $this->pdf->RowIconv($row); 202 207 } -
web/include/doc/printforms/realizaciya/sfak.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
web/include/doc/printforms/realizaciya/torg12.php
r4cefac0 r0ebef4e 3 3 // MultiMag v0.2 - Complex sales system 4 4 // 5 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org5 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 6 6 // 7 7 // This program is free software: you can redistribute it and/or modify -
web/include/doc/printforms/realizaciya/upd.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
web/include/doc_scripts/agent_balances.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
web/include/doc_scripts/bank_import.php
r4cefac0 r0ebef4e 3 3 // MultiMag v0.2 - Complex sales system 4 4 // 5 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org5 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 6 6 // 7 7 // This program is free software: you can redistribute it and/or modify … … 37 37 <label><input type='checkbox' name='process_in' value='1' checked>Обработать приходы</label><br> 38 38 <label><input type='checkbox' name='process_out' value='1'>Обработать расходы</label><br> 39 <label><input type='checkbox' name='apply' value='1'>Провести документы</label><br> 39 40 Подтип документов:<br> 40 41 <input type='text' name='subtype' maxlength='5'><br> … … 51 52 $process_out = rcvint('process_out'); 52 53 $subtype = request('subtype'); 54 $apply = request('apply'); 53 55 54 56 $tmpl->addContent("<h1>" . $this->getname() . "</h1>"); … … 169 171 'firm_id' => $banks[$curr_rs]['firm_id'], 170 172 'comment' => $import_doc['desc'], 171 'ok' => time()173 'ok' => $apply ? time() : 0 172 174 ); 173 175 $doc_id = $db->insertA('doc_list', $doc_ins_data); -
web/include/doc_scripts/bank_verify.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
web/include/doc_scripts/salary_storekeeper.php
r4cefac0 r0ebef4e 3 3 // MultiMag v0.2 - Complex sales system 4 4 // 5 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org5 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 6 6 // 7 7 // This program is free software: you can redistribute it and/or modify -
web/include/doc_scripts/sborka_zap.php
r4cefac0 r0ebef4e 3 3 // MultiMag v0.2 - Complex sales system 4 4 // 5 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org5 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 6 6 // 7 7 // This program is free software: you can redistribute it and/or modify -
web/include/doc_scripts/zp_s_prodaj.php
r4cefac0 r0ebef4e 3 3 // MultiMag v0.2 - Complex sales system 4 4 // 5 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org5 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 6 6 // 7 7 // This program is free software: you can redistribute it and/or modify -
web/include/doc_scripts/zp_s_prodaj_conn.php
r4cefac0 r0ebef4e 3 3 // MultiMag v0.2 - Complex sales system 4 4 // 5 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org5 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 6 6 // 7 7 // This program is free software: you can redistribute it and/or modify -
web/include/imageproductor.php
r4cefac0 r0ebef4e 3 3 // MultiMag v0.2 - Complex sales system 4 4 // 5 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org5 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 6 6 // 7 7 // This program is free software: you can redistribute it and/or modify -
web/include/imodule.php
r4cefac0 r0ebef4e 3 3 // MultiMag v0.2 - Complex sales system 4 4 // 5 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org5 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 6 6 // 7 7 // This program is free software: you can redistribute it and/or modify -
web/include/ipv6.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
web/include/iwidget.php
r4cefac0 r0ebef4e 3 3 // MultiMag v0.2 - Complex sales system 4 4 // 5 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org5 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 6 6 // 7 7 // This program is free software: you can redistribute it and/or modify -
web/include/listeditor.php
r4cefac0 r0ebef4e 3 3 // MultiMag v0.2 - Complex sales system 4 4 // 5 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org5 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 6 6 // 7 7 // This program is free software: you can redistribute it and/or modify -
web/include/listeditors/accessgroupeditor.php
r4cefac0 r0ebef4e 3 3 // MultiMag v0.2 - Complex sales system 4 4 // 5 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org5 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 6 6 // 7 7 // This program is free software: you can redistribute it and/or modify -
web/include/listeditors/accountlisteditor.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
web/include/listeditors/banklisteditor.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
web/include/listeditors/builderslisteditor.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
web/include/listeditors/ctypeslisteditor.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
web/include/listeditors/dtypeslisteditor.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
web/include/listeditors/firmlisteditor.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
web/include/listeditors/kasslisteditor.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
web/include/listeditors/mailaliaseditor.php
r4cefac0 r0ebef4e 3 3 // MultiMag v0.2 - Complex sales system 4 4 // 5 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org5 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 6 6 // 7 7 // This program is free software: you can redistribute it and/or modify … … 53 53 protected function getInputUser_id($name, $value) { 54 54 $ret = "<select name='$name'>"; 55 foreach($this-> domain_list as $id => $user_name) {55 foreach($this->user_list as $id => $user_name) { 56 56 $selected = $id == $value ? ' selected' : ''; 57 57 $ret.= "<option value='{$id}'{$selected}>" . html_out($user_name) . "</option>"; … … 66 66 67 67 protected function getFieldUser_id($data) { 68 return html_out($this->user_list[$data[' domain_id']]);68 return html_out($this->user_list[$data['user_id']]); 69 69 } 70 70 -
web/include/listeditors/maildomainseditor.php
r4cefac0 r0ebef4e 3 3 // MultiMag v0.2 - Complex sales system 4 4 // 5 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org5 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 6 6 // 7 7 // This program is free software: you can redistribute it and/or modify -
web/include/listeditors/postypeslisteditor.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
web/include/listeditors/storeslisteditor.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
web/include/logview.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
web/include/models/basket.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
web/include/models/ldo/agentnames.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
web/include/models/ldo/banknames.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
web/include/models/ldo/doclist.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
web/include/models/ldo/docnames.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
web/include/models/ldo/firmnames.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
web/include/models/ldo/kassnames.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
web/include/models/ldo/posnames.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
web/include/models/ldo/skladnames.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
web/include/models/ldo/usernames.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
web/include/models/listdataobject.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
web/include/modules/admin/acl.php
r4cefac0 r0ebef4e 3 3 // MultiMag v0.2 - Complex sales system 4 4 // 5 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org5 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 6 6 // 7 7 // This program is free software: you can redistribute it and/or modify -
web/include/modules/admin/mailconfig.php
r4cefac0 r0ebef4e 3 3 // MultiMag v0.2 - Complex sales system 4 4 // 5 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org5 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 6 6 // 7 7 // This program is free software: you can redistribute it and/or modify -
web/include/modules/site/news.php
r4cefac0 r0ebef4e 3 3 // MultiMag v0.2 - Complex sales system 4 4 // 5 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org5 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 6 6 // 7 7 // This program is free software: you can redistribute it and/or modify -
web/include/news.php
r4cefac0 r0ebef4e 3 3 // MultiMag v0.2 - Complex sales system 4 4 // 5 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org5 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 6 6 // 7 7 // This program is free software: you can redistribute it and/or modify -
web/include/pricecalc.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
web/include/pricewriter/basepricewriter.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
web/include/pricewriter/csv.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
web/include/pricewriter/html.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
web/include/pricewriter/pdf.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
web/include/pricewriter/xls.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
web/include/reports/agent.php
r4cefac0 r0ebef4e 3 3 // MultiMag v0.2 - Complex sales system 4 4 // 5 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org5 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 6 6 // 7 7 // This program is free software: you can redistribute it and/or modify -
web/include/reports/agent_nosells.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
web/include/reports/agent_resp.php
r4cefac0 r0ebef4e 3 3 // MultiMag v0.2 - Complex sales system 4 4 // 5 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org5 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 6 6 // 7 7 // This program is free software: you can redistribute it and/or modify -
web/include/reports/apay.php
r4cefac0 r0ebef4e 3 3 // MultiMag v0.2 - Complex sales system 4 4 // 5 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org5 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 6 6 // 7 7 // This program is free software: you can redistribute it and/or modify -
web/include/reports/balance.php
r4cefac0 r0ebef4e 3 3 // MultiMag v0.2 - Complex sales system 4 4 // 5 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org5 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 6 6 // 7 7 // This program is free software: you can redistribute it and/or modify -
web/include/reports/bankday.php
r4cefac0 r0ebef4e 3 3 // MultiMag v0.2 - Complex sales system 4 4 // 5 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org5 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 6 6 // 7 7 // This program is free software: you can redistribute it and/or modify -
web/include/reports/cons_finance.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
web/include/reports/costs.php
r4cefac0 r0ebef4e 3 3 // MultiMag v0.2 - Complex sales system 4 4 // 5 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org5 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 6 6 // 7 7 // This program is free software: you can redistribute it and/or modify -
web/include/reports/dolgi.php
r4cefac0 r0ebef4e 3 3 // MultiMag v0.2 - Complex sales system 4 4 // 5 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org5 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 6 6 // 7 7 // This program is free software: you can redistribute it and/or modify -
web/include/reports/editedpos.php
r4cefac0 r0ebef4e 3 3 // MultiMag v0.2 - Complex sales system 4 4 // 5 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org5 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 6 6 // 7 7 // This program is free software: you can redistribute it and/or modify -
web/include/reports/groupstore.php
r4cefac0 r0ebef4e 3 3 // MultiMag v0.2 - Complex sales system 4 4 // 5 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org5 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 6 6 // 7 7 // This program is free software: you can redistribute it and/or modify -
web/include/reports/images.php
r4cefac0 r0ebef4e 3 3 // MultiMag v0.2 - Complex sales system 4 4 // 5 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org5 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 6 6 // 7 7 // This program is free software: you can redistribute it and/or modify -
web/include/reports/incost.php
r4cefac0 r0ebef4e 3 3 // MultiMag v0.2 - Complex sales system 4 4 // 5 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org5 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 6 6 // 7 7 // This program is free software: you can redistribute it and/or modify -
web/include/reports/kassday.php
r4cefac0 r0ebef4e 3 3 // MultiMag v0.2 - Complex sales system 4 4 // 5 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org5 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 6 6 // 7 7 // This program is free software: you can redistribute it and/or modify -
web/include/reports/kladovshik.php
r4cefac0 r0ebef4e 3 3 // MultiMag v0.2 - Complex sales system 4 4 // 5 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org5 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 6 6 // 7 7 // This program is free software: you can redistribute it and/or modify -
web/include/reports/komplekt_zp.php
r4cefac0 r0ebef4e 3 3 // MultiMag v0.2 - Complex sales system 4 4 // 5 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org5 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 6 6 // 7 7 // This program is free software: you can redistribute it and/or modify -
web/include/reports/liquidity.php
r4cefac0 r0ebef4e 3 3 // MultiMag v0.2 - Complex sales system 4 4 // 5 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org5 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 6 6 // 7 7 // This program is free software: you can redistribute it and/or modify -
web/include/reports/mincnt.php
r4cefac0 r0ebef4e 3 3 // MultiMag v0.2 - Complex sales system 4 4 // 5 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org5 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 6 6 // 7 7 // This program is free software: you can redistribute it and/or modify -
web/include/reports/noimg.php
r4cefac0 r0ebef4e 3 3 // MultiMag v0.2 - Complex sales system 4 4 // 5 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org5 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 6 6 // 7 7 // This program is free software: you can redistribute it and/or modify -
web/include/reports/ostatkinadatu.php
r4cefac0 r0ebef4e 3 3 // MultiMag v0.2 - Complex sales system 4 4 // 5 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org5 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 6 6 // 7 7 // This program is free software: you can redistribute it and/or modify -
web/include/reports/outlay_items.php
r4cefac0 r0ebef4e 3 3 // MultiMag v0.2 - Complex sales system 4 4 // 5 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org5 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 6 6 // 7 7 // This program is free software: you can redistribute it and/or modify -
web/include/reports/payments.php
r4cefac0 r0ebef4e 3 3 // MultiMag v0.2 - Complex sales system 4 4 // 5 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org5 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 6 6 // 7 7 // This program is free software: you can redistribute it and/or modify -
web/include/reports/pos_komplekt.php
r4cefac0 r0ebef4e 3 3 // MultiMag v0.2 - Complex sales system 4 4 // 5 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org5 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 6 6 // 7 7 // This program is free software: you can redistribute it and/or modify -
web/include/reports/pos_nosells.php
r4cefac0 r0ebef4e 3 3 // MultiMag v0.2 - Complex sales system 4 4 // 5 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org5 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 6 6 // 7 7 // This program is free software: you can redistribute it and/or modify -
web/include/reports/pricetags.php
r4cefac0 r0ebef4e 3 3 // MultiMag v0.2 - Complex sales system 4 4 // 5 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org5 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 6 6 // 7 7 // This program is free software: you can redistribute it and/or modify -
web/include/reports/profitability.php
r4cefac0 r0ebef4e 3 3 // MultiMag v0.2 - Complex sales system 4 4 // 5 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org5 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 6 6 // 7 7 // This program is free software: you can redistribute it and/or modify -
web/include/reports/reserve.php
r4cefac0 r0ebef4e 3 3 // MultiMag v0.2 - Complex sales system 4 4 // 5 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org5 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 6 6 // 7 7 // This program is free software: you can redistribute it and/or modify -
web/include/reports/revision_act.php
r4cefac0 r0ebef4e 3 3 // MultiMag v0.2 - Complex sales system 4 4 // 5 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org5 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 6 6 // 7 7 // This program is free software: you can redistribute it and/or modify -
web/include/reports/sales.php
r4cefac0 r0ebef4e 3 3 // MultiMag v0.2 - Complex sales system 4 4 // 5 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org5 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 6 6 // 7 7 // This program is free software: you can redistribute it and/or modify -
web/include/reports/store.php
r4cefac0 r0ebef4e 3 3 // MultiMag v0.2 - Complex sales system 4 4 // 5 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org5 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 6 6 // 7 7 // This program is free software: you can redistribute it and/or modify -
web/include/reports/ved_agentov.php
r4cefac0 r0ebef4e 3 3 // MultiMag v0.2 - Complex sales system 4 4 // 5 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org5 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 6 6 // 7 7 // This program is free software: you can redistribute it and/or modify -
web/include/reports/zayavki.php
r4cefac0 r0ebef4e 3 3 // MultiMag v0.2 - Complex sales system 4 4 // 5 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org5 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 6 6 // 7 7 // This program is free software: you can redistribute it and/or modify -
web/include/sendfax.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
web/include/sendsms.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
web/include/sitemap.inc.php
r4cefac0 r0ebef4e 3 3 // MultiMag v0.2 - Complex sales system 4 4 // 5 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org5 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 6 6 // 7 7 // This program is free software: you can redistribute it and/or modify -
web/include/sync/dataexport.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
web/include/sync/xml1cdataexport.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
web/include/widgets/incl.php
r4cefac0 r0ebef4e 3 3 // MultiMag v0.2 - Complex sales system 4 4 // 5 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org5 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 6 6 // 7 7 // This program is free software: you can redistribute it and/or modify -
web/include/widgets/priceinfo.php
r4cefac0 r0ebef4e 3 3 // MultiMag v0.2 - Complex sales system 4 4 // 5 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org5 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 6 6 // 7 7 // This program is free software: you can redistribute it and/or modify -
web/include/widgets/productinfo.php
r4cefac0 r0ebef4e 3 3 // MultiMag v0.2 - Complex sales system 4 4 // 5 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org5 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 6 6 // 7 7 // This program is free software: you can redistribute it and/or modify -
web/incomp_orders.php
r4cefac0 r0ebef4e 3 3 // MultiMag v0.2 - Complex sales system 4 4 // 5 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org5 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 6 6 // 7 7 // This program is free software: you can redistribute it and/or modify -
web/index.php
r4cefac0 r0ebef4e 3 3 // MultiMag v0.2 - Complex sales system 4 4 // 5 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org5 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 6 6 // 7 7 // This program is free software: you can redistribute it and/or modify -
web/js/autocomplete.js
r4cefac0 r0ebef4e 1 1 // MultiMag v0.2 - Complex sales system 2 2 // 3 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org3 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 4 4 // 5 5 // This program is free software: you can redistribute it and/or modify -
web/js/calendar.js
r4cefac0 r0ebef4e 1 1 // MultiMag v0.2 - Complex sales system 2 2 // 3 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org3 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 4 4 // 5 5 // This program is free software: you can redistribute it and/or modify -
web/js/doc_journal.js
r4cefac0 r0ebef4e 1 1 // MultiMag v0.2 - Complex sales system 2 2 // 3 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org3 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 4 4 // 5 5 // This program is free software: you can redistribute it and/or modify -
web/js/formvalid.js
r4cefac0 r0ebef4e 1 1 // MultiMag v0.2 - Complex sales system 2 2 // 3 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org3 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 4 4 // 5 5 // This program is free software: you can redistribute it and/or modify -
web/json.php
r4cefac0 r0ebef4e 3 3 // MultiMag v0.2 - Complex sales system 4 4 // 5 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org5 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 6 6 // 7 7 // This program is free software: you can redistribute it and/or modify -
web/keygen.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
web/login.php
r4cefac0 r0ebef4e 3 3 // MultiMag v0.2 - Complex sales system 4 4 // 5 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org5 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 6 6 // 7 7 // This program is free software: you can redistribute it and/or modify … … 20 20 21 21 include_once("core.php"); 22 $login=request('login');23 $pass=request('pass');24 $mode=request('mode');25 26 function attack_test() {27 global $db;28 $lock=0;29 $captcha=0;30 $ip=getenv("REMOTE_ADDR");31 32 $sql='SELECT `id` FROM `users_bad_auth`';33 34 $tm = time()-60*60*3;35 $res = $db->query("$sql WHERE `ip`='$ip' AND `time`>'$tm'");36 if($res->num_rows > 20) return 2; // Более 20 ошибок вводе пароля c данного IP за последние 3 часа. Блокируем аутентификацию.37 $tm = time()-60*30;38 $res = $db->query("$sql WHERE `ip`='$ip' AND `time`>'$tm'");39 if($res->num_rows > 2) $captcha=1; // Более двух ошибок ввода пароля c данного IP за последние 30 минут. Планируем запрос captcha.40 41 $ip_a = explode(".",$ip);42 if(!is_array($ip_a)) return $captcha; // Если IP не удаётся разделить на элементы - завершаем тест43 if(count($ip_a) < 2) return $captcha; // Если IP не удаётся разделить на элементы - завершаем тест44 45 $tm = time()-60*60*3;46 $res = $db->query("$sql WHERE `ip`='$ip_a[0].$ip_a[1].$ip_a[2].%' AND `time`>'$tm'");47 if($res->num_rows > 100) return 3; // Более 100 ошибок вводе пароля c подсети /24 за последние 3 часа. Блокируем аутентификацию.48 $tm = time()-60*30;49 $res = $db->query("$sql WHERE `ip`='$ip_a[0].$ip_a[1].$ip_a[2].%' AND `time`>'$tm'");50 if($res->num_rows > 6) $captcha=1; // Более 6 ошибок ввода пароля c подсети /24 за последние 30 минут. Планируем запрос captcha.51 52 $tm = time()-60*60*3;53 $res = $db->query("$sql WHERE `ip`='$ip_a[0].$ip_a[1].%' AND `time`>'$tm'");54 if($res->num_rows > 500) return 3; // Более 500 ошибок вводе пароля c подсети /16 за последние 3 часа. Блокируем аутентификацию.55 $tm = time()-60*30;56 $res = $db->query("$sql WHERE `ip`='$ip_a[0].$ip_a[1].%' AND `time`>'$tm'");57 if($res->num_rows > 30) $captcha=1; // Более 30 ошибок ввода пароля c подсети /16 за последние 30 минут. Планируем запрос captcha.58 59 $tm = time()-60*15;60 $res = $db->query("$sql WHERE `time`>'$tm'");61 if($res->num_rows > 100) $captcha=1; // Более 100 ошибок ввода пароля со всей сети за последние 15 минут. Планируем запрос captcha.62 63 return $captcha;64 }65 66 function regMsg($login, $pass, $conf) {67 global $CONFIG;68 $proto='http';69 if($CONFIG['site']['force_https_login'] || $CONFIG['site']['force_https']) $proto='https';70 return "Вы получили это письмо потому, что в заявке на регистрацию на сайте http://{$CONFIG['site']['name']} был указан Ваш адрес электронной почты. Для продолжения регистрации введите следующий код подтверждения:71 $conf72 или перейдите по ссылке $proto://{$CONFIG['site']['name']}/login.php?mode=conf&login=$login&e=$conf .73 Если не переходить по ссылке (например, если заявка подана не Вами), то регистрационные данные будут автоматически удалены через неделю.74 75 Ваш аккаунт:76 Логин: $login77 Пароль: $pass78 79 После подтверждения регистрации Вы сможете получить доступ к расширенным функциям сайта. Неактивные аккаунты удаляются через 6 месяцев.80 81 ------------------------------------------------------------------------------------------82 83 You have received this letter because in the form of registration in a site http://{$CONFIG['site']['name']} your e-mail address has been entered. For continuation of registration enter this key:84 $conf85 or pass under the link $proto://{$CONFIG['site']['name']}/login.php?mode=conf&login=$login&e=$conf . If not going under the reference (for example if the form is submitted not by you) registration data will be automatically removed after a week.86 87 Your account:88 Login: $login89 Pass: $pass90 91 After confirmatoin of registration you can get access to the expanded functions of a site. Inactive accounts leave in 6 months.92 93 ------------------------------------------------------------------------------------------94 Сообщение сгенерировано автоматически, отвечать на него не нужно!95 The message is generated automatically, to answer it is not necessary!";96 }97 98 class RegException extends \Exception {99 var $target;100 function __construct($text='', $target='', $prevous=null)101 {102 parent::__construct($text, 0, $prevous);103 $this->target=$target;104 }105 106 }107 108 function RegForm($err_target='', $err_msg='')109 {110 global $CONFIG, $tmpl;111 $login = html_out(request('login'));112 $pass = html_out(request('pass'));113 $phone = html_out(request('phone'));114 $email = html_out(request('email'));115 116 $err_msgs=array('login'=>'', 'email'=>'','img'=>'','phone'=>'');117 $err_msgs[$err_target]="<div style='color: #c00'>$err_msg</div>";118 119 $form_action='/login.php';120 if($CONFIG['site']['force_https_login'])121 {122 $host=$_SERVER['HTTP_HOST'];123 $form_action='https://'.$host.'/login.php';124 }125 126 $tmpl->addContent("<p id='text'>127 Для использования всех возможностей этого сайта, необходимо пройти процедуру регистрации. Регистрация не сложная,128 и займёт всего несколько минут. Все зарегистрированные пользователи автоматически получают возможность приобретать товар по специальным ценам!</p>129 <p>Регистрируясь, Вы даёте согласие на хранение, обработку и публикацию своей персональной информации, в соответствии с законом РФ "О персональных данных".</p>130 <form action='$form_action' method='post' id='reg-form'>131 <h2>Для регистрации заполните следующую форму:</h2>132 <input type='hidden' name='mode' value='regs'>133 <table cellspacing='15'>134 135 <tr><td>136 <b>Желаемый логин</b><br>137 <small>латинские буквы, цифры, длина от 3 до 24 символов </small>138 <td>139 <input type='text' name='login' value='$login' id='login' autofocus><br>140 <span id='login_valid' style='color: #c00'>{$err_msgs['login']}</span>");141 142 if(@$CONFIG['site']['allow_phone_regist'])143 $tmpl->addContent("<tr><td colspan='2'>Заполните хотя бы одно из полей: номер телефона и e-mail");144 145 $tmpl->addContent("<tr><td>146 <b>Адрес электронной почты e-mail</b><br>147 <small>в формате user@host.zone</small>148 <td><input type='text' name='email' value='$email' id='email'><br>149 <span id='email_valid'>{$err_msgs['email']}</span>");150 151 if(@$CONFIG['site']['allow_phone_regist'])152 $tmpl->addContent("153 <tr><td><b>Мобильный телефон: <span id='phone_num'></span></b><br>154 <small>Российский, 10 цифр, без +7 или 8</small>155 <td>156 +7<input type='text' name='phone' value='$phone' maxlength='10' placeholder='Номер' id='phone'><br>157 <span id='phone_valid'>{$err_msgs['phone']}</span>");158 159 $tmpl->addContent("<tr><td colspan='2'><input type='checkbox' name='subs' value='1' checked>Подписаться на новости и другую информацию160 <tr><td colspan='2'><b>Подтвердите что вы не робот, введя текст с картинки:</b>161 <tr><td>162 <img src='/kcaptcha/index.php'><br>163 <td>164 <input type='text' name='img'>{$err_msgs['img']}165 <tr><td style='color: #c00;'><td>166 <button type='submit'>Далее >></button>167 </form>168 </table>");169 if(@$CONFIG['site']['allow_openid'])170 $tmpl->addContent("<b>Примечание:</b> Если Вы хоте зарегистрироваться, используя свой OpenID, Вам <a href='/login_oid.php'>сюда</a>!<br>");171 $tmpl->addContent("<script type='text/javascript'>172 ");173 174 if(@$CONFIG['site']['allow_phone_regist'])175 $tmpl->addContent("176 var phone=document.getElementById('phone')177 var phone_num=document.getElementById('phone_num')178 var phone_valid=document.getElementById('phone_valid')179 function updatePhoneNum()180 {181 phone_num.innerHTML='+7'+phone.value182 var regexp=/^9\d{9}$/183 if(!regexp.test(phone.value))184 {185 phone.style.borderColor=\"#f00\"186 phone.style.color=\"#f00\"187 phone_valid.innerHTML=''188 }189 else190 {191 phone.style.borderColor=\"\"192 phone.style.color=\"\"193 phone_valid.innerHTML='Введено верно'194 phone_valid.style.color=\"#0c0\"195 }196 }197 phone.onkeyup=updatePhoneNum");198 199 $tmpl->addContent("200 var email=document.getElementById('email')201 var email_valid=document.getElementById('email_valid')202 function updateEmail()203 {204 var regexp=/^\w+([+-\.\w]+)*\w@\w(([-\.\w])*\w+)*\.\w{2,8}$/205 if(!regexp.test(email.value))206 {207 email.style.borderColor=\"#f00\"208 email.style.color=\"#f00\"209 email_valid.innerHTML=''210 }211 else212 {213 email.style.borderColor=\"\"214 email.style.color=\"\"215 email_valid.innerHTML='Введено верно'216 email_valid.style.color=\"#0c0\"217 }218 }219 email.onkeyup=updateEmail220 221 var login=document.getElementById('login')222 var login_valid=document.getElementById('login_valid')223 function updateLogin()224 {225 var regexp=/^[a-zA-Z\d]{3,24}$/226 if(!regexp.test(login.value))227 {228 login.style.borderColor=\"#f00\"229 login.style.color=\"#f00\"230 login_valid.innerHTML='Заполнено неверно'231 }232 else233 {234 login.style.borderColor=\"\"235 login.style.color=\"\"236 login_valid.innerHTML=''237 }238 }239 login.onkeyup=updateLogin240 241 </script>242 ");243 }244 245 try246 {247 248 if(!isset($_REQUEST['mode']))249 {250 if(@$_SESSION['uid'])251 {252 include("user.php");253 exit();254 }255 $pass = @$_REQUEST['pass'];256 257 // Куда переходить после авторизации258 $from=getenv("HTTP_REFERER");259 if($from)260 {261 $froma=explode("/",$from);262 $proto=@$_SERVER['HTTPS']?'https':'http';263 if( ($froma[2]!=$_SERVER['HTTP_HOST']) || ($froma[3]=='login.php') || ($froma[3]=='') ) $from="$proto://".$_SERVER['HTTP_HOST'];264 }265 $_SESSION['redir_to']=$from;266 267 $tmpl->addContent("<h1 id='page-title'>Аутентификация</h1>");268 $tmpl->setTitle("Аутентификация");269 if(isset($_REQUEST['cont'])) $tmpl->addContent("<div id='page-info'>Для доступа в этот раздел Вам необходимо пройти аутентификацию.</div>");270 271 $ip = $db->real_escape_string(getenv("REMOTE_ADDR"));272 $time = time()+60;273 $at = attack_test();274 if($at > 1)275 {276 $res = $db->query("INSERT INTO `users_bad_auth` (`ip`, `time`) VALUES ('$ip', '$time')");277 }278 if($at >= 3)279 {280 $tmpl->msg("Из-за попыток подбора паролей к сайту доступ с вашей подсети заблокирован! Вы сможете авторизоваться через несколько часов после прекращения попыток подбора пароля. Если Вы не предпринимали попыток подбора пароля, обратитесь к Вашему поставщику интернет-услуг - возможно, кто-то другой пытается подобрать пароль, используя ваш адрес.","err","Доступ заблокирован");281 }282 else if($at == 2)283 {284 $tmpl->msg("Из-за попыток подбора паролей к сайту доступ с вашего адреса заблокирован! Вы сможете авторизоваться через несколько часов после прекращения попыток подбора пароля. Если Вы не предпринимали попыток подбора пароля, обратитесь к Вашему поставщику интернет-услуг - возможно, кто-то другой пытается подобрать пароль, используя ваш адрес.","err","Доступ заблокирован");285 }286 else287 {288 if(@$_REQUEST['opt']=='login')289 {290 if( ($at == 1) && ( (strtoupper($_SESSION['captcha_keystring'])!=strtoupper(@$_REQUEST['img'])) || ($_SESSION['captcha_keystring']=='') ) )291 {292 $tmpl->msg("Введите правильный код подтверждения, изображенный на картинке", "err");293 $res = $db->query("INSERT INTO `users_bad_auth` (`ip`, `time`) VALUES ('$ip', '$time')");294 }295 else296 {297 $login_sql = $db->real_escape_string($_REQUEST['login']);298 $res = $db->query("SELECT `users`.`id`, `users`.`name`, `users`.`pass`, `users`.`pass_type`, `users`.`reg_email_confirm`, `users`.`reg_phone_confirm`, `users`.`disabled`, `users`.`disabled_reason`, `users`.`bifact_auth` FROM `users`299 WHERE `name`='$login_sql'");300 if($res->num_rows)301 {302 $nxt = $res->fetch_assoc();303 if($nxt['disabled']) throw new Exception("Пользователь заблокирован (забанен). Причина блокировки: ".$nxt['disabled_reason']);304 305 $pass_ok=0;306 if($nxt['pass_type']=='CRYPT')307 {308 if(crypt($pass, $nxt['pass']) == $nxt['pass']) $pass_ok=1;309 }310 else if($nxt['pass_type']=='SHA1')311 {312 if(SHA1($pass) == $nxt['pass']) $pass_ok=1;313 }314 else315 {316 if(MD5($pass) == $nxt['pass']) $pass_ok=1;317 }318 319 if(!$pass_ok)320 {321 $res = $db->query("INSERT INTO `users_bad_auth` (`ip`, `time`) VALUES ('$ip', '$time')");322 $tmpl->msg("Неверная пара логин / пароль! Попробуйте снова!","err","Авторизоваться не удалось");323 }324 else325 {326 327 if( ($nxt['reg_email_confirm']=='1') || ($nxt['reg_phone_confirm']=='1') )328 {329 $ip=$db->real_escape_string(getenv("REMOTE_ADDR"));330 $ua=$db->real_escape_string($_SERVER['HTTP_USER_AGENT']);331 $res = $db->query("INSERT INTO `users_login_history` (`user_id`, `date`, `ip`, `useragent`, `method`)332 VALUES ({$nxt['id']}, NOW(), '$ip', '$ua', 'password')");333 $_SESSION['uid'] = $nxt['id'];334 $_SESSION['name'] = $nxt['name'];335 if(@$_SESSION['last_page'])336 {337 $lp=$_SESSION['last_page'];338 unset($_SESSION['last_page']);339 header("Location: ".$lp);340 }341 else if(@$_SESSION['redir_to']) header("Location: ".$_SESSION['redir_to']);342 else header("Location: user.php");343 exit();344 }345 else346 {347 header("Location: login.php?mode=conf&login=".urlencode($_REQUEST['login']));348 exit();349 }350 }351 }352 else353 {354 $res = $db->query("INSERT INTO `users_bad_auth` (`ip`, `time`) VALUES ('$ip', '$time')");355 $tmpl->msg("Неверная пара логин / пароль! Попробуйте снова!","err","Авторизоваться не удалось");356 }357 }358 }359 $at = attack_test();360 361 if($at > 0)362 $m="<tr><td>363 Введите код подтверждения, изображенный на картинке:<br>364 <img src='/kcaptcha/index.php' alt='Включите отображение картинок!'><td>365 <input type='text' name='img'>";366 else $m='';367 368 $form_action='/login.php';369 if($CONFIG['site']['force_https_login'])370 {371 $host=$_SERVER['HTTP_HOST'];372 $form_action='https://'.$host.'/login.php';373 }374 $login_html=html_out(request('login'));375 $tmpl->addContent("376 <form method='post' action='$form_action' id='login-form' name='fefe'>377 <input type='hidden' name='opt' value='login'>378 <table id='login-table'>379 <tr><th colspan='2'>380 Введите данные:381 <tr><td colspan='2'>382 Если у Вас их нет, вы можете <a class='wiki' href='/login.php?mode=reg'>зарегистрироваться</a>383 <tr><td>384 Имя:<td>385 <input type='text' name='login' class='text' id='input_name' value='$login_html' autofocus>386 <tr><td>Пароль:<td>387 <input type='password' name='pass' class='text'>(<a class='wiki' href='?mode=rem'>Сменить</a>)<br>$m388 <tr><td><td>389 <button type='submit'>Вход!</button> ( <a class='wiki' href='/login.php?mode=rem'>Забыли пароль?</a> )390 </table></form>");391 if(@$CONFIG['site']['allow_openid'])392 $tmpl->addContent("393 <table style='width: 800px'>394 <tr><th colspan='4'><center>Войти через</center></th></tr>395 <tr>396 <td><a href='/login_oid.php?oid=https://www.google.com/accounts/o8/id'><img src='/img/oid/google.png' alt='Войти через Google'></a></td>397 <td><a href='/login_oid.php?oid=ya.ru'><img src='/img/oid/yandex.png' alt='Войти через Яндекс'></a></td>398 <td><a href='/login_oid.php?oid=vkontakteid.ru'><img src='/img/oid/vkontakte.png' alt='Войти через Вконтакте'></a></td>399 <td><a href='/login_oid.php?oid=loginza.ru'><img src='/img/oid/loginza.png' alt='Войти через Loginza'></a></td>400 </tr>401 </table>");402 $tmpl->addContent("403 <script type=\"text/javascript\">404 405 function focusInput()406 {407 var input_name = document.getElementById('input_name');408 if (input_name.value == '')409 input_name.focus();410 return false;411 }412 413 window.setTimeout('focusInput()', 300);414 </script>");415 }416 }417 else if($mode=='logout')418 {419 unset($_SESSION['uid']);420 unset($_SESSION['name']);421 header("Location: index.php");422 exit();423 }424 else if($mode=='reg')425 {426 if(!intval(@$_SESSION['uid']))427 {428 $tmpl->setTitle("Регистрация");429 $tmpl->addContent("<h1 id='page-title'>Регистрация</h1>");430 RegForm();431 } else $tmpl->msg("Вы уже являетесь нашим зарегистрированным пользователем. Повторная регистрация не требуется.","info");432 }433 else if($mode=='regs')434 {435 try436 {437 $login = request('login');438 $email = request('email');439 $phone = request('phone');440 $img = strtoupper(@$_REQUEST['img']);441 $subs = @$_REQUEST['subs'];442 $subs = $subs?1:0;443 $db->query("START TRANSACTION");444 if($login=='')445 throw new RegException('Поле login не заполнено','login');446 if(strlen($login)<3)447 throw new RegException('login слишком короткий','login');448 if(strlen($login)>24)449 throw new RegException('login слишком длинный','login');450 if( !preg_match('/^[a-zA-Z\d]*$/', $login))451 throw new RegException('login должен состоять из латинских букв и цифр','login');452 453 $sql_login = $db->real_escape_string($login);454 $res=$db->query("SELECT `id` FROM `users` WHERE `name`='$sql_login'");455 if($res->num_rows)456 throw new RegException('Такой login занят. Используйте другой.','login');457 458 if(@$CONFIG['site']['allow_phone_regist'])459 {460 if($email=='' && $phone=='')461 throw new RegException('Нужно заполнить телефон или email','email');462 }463 else464 {465 if($email=='')466 throw new RegException('Поле email не заполнено','email');467 }468 22 469 23 470 if($email!='') 471 { 472 if( !preg_match('/^\w+([-\.\w]+)*\w@\w(([-\.\w])*\w+)*\.\w{2,8}$/', $email)) 473 throw new RegException('Неверный формат адреса e-mail. Адрес должен быть в формате user@host.zone','email'); 474 $res = $db->query("SELECT `id` FROM `users` WHERE `reg_email`='$email'"); 475 if($res->num_rows) 476 throw new RegException('Пользователь с таким email уже зарегистрирован. Используйте другой.','email'); 477 } 478 479 if($phone!='') 480 { 481 $phone='+7'.$phone; 482 if( !preg_match('/^\+79\d{9}$/', $phone)) 483 throw new RegException('Неверный формат телефона. Номер должен быть в федеральном формате +79XXXXXXXXX '.$phone,'phone'); 484 $res=$db->query("SELECT `id` FROM `users` WHERE `reg_phone`='$phone'"); 485 if($res->num_rows) 486 throw new RegException('Пользователь с таким телефоном уже зарегистрирован. Используйте другой.','phone'); 487 } 488 489 if($img=='') 490 throw new RegException('Код подтверждения не введён','img'); 491 if(strtoupper($_SESSION['captcha_keystring'])!=strtoupper($img)) 492 throw new RegException('Код подтверждения введён неверно','img'); 493 494 $email_conf=$email?substr(MD5(time()+rand(0,1000000)),0,8):''; 495 $phone_conf=$phone?rand(1000,99999):''; 496 $pass=keygen_unique(0,8,11); 497 $sql_email=$db->real_escape_string($email); 498 $sql_phone=$db->real_escape_string($phone); 499 500 $sql_login=$db->real_escape_string($login); 501 if(@$CONFIG['site']['pass_type']=='MD5') 502 { 503 $sql_pass_hash=MD5($pass); 504 $sql_pass_type='MD5'; 505 } 506 else if(@$CONFIG['site']['pass_type']=='SHA1') 507 { 508 $sql_pass_hash=SHA1($pass); 509 $sql_pass_type='SHA1'; 510 } 511 else 512 { 513 if(CRYPT_SHA256 == 1) 514 { 515 $sql_pass_hash=crypt($pass, '$5$'.substr(MD5($login.rand(0,1000000)),0,16).'$'); 516 } 517 else $sql_pass_hash=crypt($pass); 518 $sql_pass_type='CRYPT'; 519 } 520 521 $res=$db->query("INSERT INTO `users` (`name`, `pass`, `pass_type`, `pass_date_change`, `reg_email`, `reg_email_confirm`, `reg_phone`, `reg_phone_confirm`, `reg_date`, `reg_email_subscribe`, `reg_phone_subscribe`) 522 VALUES ('$sql_login', '$sql_pass_hash', '$sql_pass_type', NOW(), '$sql_email', '$email_conf', '$sql_phone', '$phone_conf', NOW(), $subs, $subs )"); 523 if($email) 524 { 525 $msg=regMsg($login, $pass, $email_conf); 526 mailto($email,"Регистрация на ".$CONFIG['site']['name'], $msg); 527 } 528 529 if($phone) 530 { 531 require_once('include/sendsms.php'); 532 $sender=new SMSSender(); 533 $sender->setNumber($phone); 534 $sender->setContent("Ваш код: $phone_conf\r\nЛогин:$login\r\nПароль:$pass\r\n{$CONFIG['site']['name']}"); 535 $sender->send(); 536 } 537 $db->query("COMMIT"); 538 $tmpl->addContent("<h1 id='page-title'>Завершение регистрации</h1> 539 <form action='/login.php' method='post'> 540 <input type='hidden' name='mode' value='conf'> 541 <input type='hidden' name='login' value='$login'>"); 542 if($email) 543 $tmpl->addContent("Для проверки, что указанный адрес электронной почты принадлежит Вам, на него было выслано сообщение.<br><b>Введите код, полученный по email:</b><br> 544 <input type='text' name='e'><br>Если Вы не получите письмо в течение трёх часов, возможно ваш сервер не принимает наше сообщение. Сообщите о проблеме администратору своего почтового сервера, или используйте другой!<br><br>"); 545 if($phone) 546 $tmpl->addContent("Для проверки, что номер телефона принадлежит Вам, на него было выслано сообщение.<br><b>Введите код, полученный по SMS:</b><br> 547 <input type='text' name='p'><br>SMS сообщения обычно приходят в течение 1 часа.<br><br>"); 548 $tmpl->addContent("<button type='submit'>Продолжить</button> 549 </form>"); 550 551 552 } 553 catch(mysqli_sql_exception $e) 554 { 555 $id = writeLogException($e); 556 $tmpl->errorMessage("Ошибка при регистрации. Порядковый номер - $id<br>Сообщение передано администратору", "Ошибка при регистрации"); 557 mailto($CONFIG['site']['admin_email'],"ВАЖНО! Ошибка регистрации на ".$CONFIG['site']['name'].". номер в журнале - $id", $e->getMessage()); 558 } 559 catch(RegException $e) 560 { 561 $db->rollback(); 562 $tmpl->setTitle("Регистрация"); 563 $tmpl->setContent("<h1 id='page-title'>Регистрация</h1>"); 564 $tmpl->msg("Проверьте данные! ".$e->getMessage(),"err","Неверный ввод!"); 565 RegForm($e->target, $e->getMessage()); 566 567 } 568 catch(Exception $e) 569 { 570 $db->rollback(); 571 $id = writeLogException($e); 572 $tmpl->errorMessage("Ошибка при регистрации: ".$e->getMessage().". Порядковый номер - $id<br>Сообщение передано администратору", "Ошибка при регистрации"); 573 } 574 24 try { 25 $login_page = new \Modules\Site\login(); 26 $login_page->run(); 575 27 } 576 else if($mode=='conf') { 577 $login = $_REQUEST['login']; 578 $e = @$_REQUEST['e']; 579 $p = @$_REQUEST['p']; 580 581 $sql_login = $db->real_escape_string($login); 582 $res = $db->query("SELECT `id`, `name`, `reg_email`, `reg_email_confirm`, `reg_phone`, `reg_phone_confirm` FROM `users` WHERE `name`='$sql_login'"); 583 if($nxt = $res->fetch_assoc()) { 584 $bad_e_key = $bad_p_key = $auto_auth = 0; 585 $need_e_key = $need_p_key = 0; 586 587 if($nxt['reg_email'] && $nxt['reg_email_confirm']!=1) { 588 if($e) { 589 if($e == $nxt['reg_email_confirm']) { 590 $db->update('users', $nxt['id'], 'reg_email_confirm', 1); 591 $auto_auth = 1; 592 } 593 else { 594 $bad_e_key = 1; 595 $need_e_key = 1; 596 } 597 } 598 else { 599 $need_e_key = 1; 600 } 601 } 602 603 if($nxt['reg_phone'] && $nxt['reg_phone_confirm']!=1) { 604 $auto_auth = 0; 605 if($p) { 606 if($p == $nxt['reg_phone_confirm']) { 607 $db->update('users', $nxt['id'], 'reg_phone_confirm', 1); 608 $auto_auth = 1; 609 } 610 else { 611 $bad_p_key = 1; 612 $need_p_key = 1; 613 } 614 } 615 else { 616 $need_p_key = 1; 617 } 618 } 619 620 if( $need_e_key || $need_p_key ) { 621 $tmpl->addContent("<h1 id='page-title'>Завершение регистрации</h1> 622 <form action='/login.php' method='post'> 623 <input type='hidden' name='mode' value='conf'> 624 <input type='hidden' name='login' value='$login'>"); 625 if($need_e_key) { 626 $tmpl->addContent("Для проверки, что указанный адрес электронной почты принадлежит Вам, на него было выслано сообщение.<br> 627 <b>Введите код, полученный по email:</b><br> 628 <input type='text' name='e'>"); 629 if ($bad_e_key) { 630 $tmpl->addContent("<br><span style='color: #f00;'>Вы ввели неверный код подтверждения!"); 631 } 632 $tmpl->addContent("<br>Если Вы не получите письмо в течение трёх часов, возможно ваш сервер не принимает наше сообщение. " 633 . "Сообщите о проблеме администратору своего почтового сервера, или используйте другой!<br><br>"); 634 } 635 if($need_p_key) { 636 $tmpl->addContent("Для проверки, что номер телефона принадлежит Вам, на него было выслано сообщение.<br> 637 <b>Введите код, полученный по SMS:</b><br> 638 <input type='text' name='p'>"); 639 if ($bad_p_key) { 640 $tmpl->addContent("<br><span style='color: #f00;'>Вы ввели неверный код подтверждения!"); 641 } 642 $tmpl->addContent("<br>SMS сообщения обычно приходят в течение 1 часа.<br><br>"); 643 } 644 $tmpl->addContent("<button type='submit'>Продолжить</button> 645 </form>"); 646 } elseif($auto_auth) { 647 $ip=$db->real_escape_string(getenv("REMOTE_ADDR")); 648 $ua=$db->real_escape_string($_SERVER['HTTP_USER_AGENT']); 649 $res=$db->query("INSERT INTO `users_login_history` (`user_id`, `date`, `ip`, `useragent`, `method`) 650 VALUES ({$nxt['id']}, NOW(), '$ip', '$ua', 'register')"); 651 $_SESSION['uid']=$nxt['id']; 652 $_SESSION['name']=$nxt['name']; 653 654 $tmpl->msg("Регистрация завершена! Теперь Вам доступны новые возможности!","ok"); 655 } 656 else $tmpl->msg("Пользователь не найден в базе, либо код подтверждения устарел","err"); 657 } 658 else $tmpl->msg("Пользователь не найден в базе, либо код подтверждения устарел","err"); 659 } 660 661 else if($mode=='rem') { 662 663 if(!isset($_REQUEST['login'])) { 664 $proto='http'; 665 if($CONFIG['site']['force_https_login'] || $CONFIG['site']['force_https']) $proto='https'; 666 $tmpl->setContent("<h1 id='page-title'>Восстановление доступа</h1> 667 <p id='text'>Для начала процедуры смены пароля введите логин на сайте, номер телефона, или адрес электронной почты, указанный при регистрации:</p> 668 <form method='post' action='$proto://{$CONFIG['site']['name']}/login.php'> 669 <input type='hidden' name='mode' value='rem'> 670 <input type='text' name='login'><br> 671 Подтвердите, что вы не робот, введите текст с картинки:<br> 672 <img src='/kcaptcha/index.php'><br> 673 <input type='text' name='img'><br> 674 <button type='submit'>Далее</button> 675 </form>"); 676 } 677 else { 678 $login=$_REQUEST['login']; 679 if(!isset($_SESSION['captcha_ok'])) { 680 if(@$_REQUEST['img']=='') 681 throw new Exception('Код с изображения не введён'); 682 if(strtoupper($_SESSION['captcha_keystring'])!=strtoupper($_REQUEST['img'])) 683 throw new Exception('Код с изображения введён неверно'); 684 } 685 $_SESSION['captcha_ok'] = 1; 686 687 $sql_login = $db->real_escape_string($login); 688 689 $res = $db->query("SELECT `id`, `name`, `reg_email`, `reg_email_confirm`, `reg_phone`, `reg_phone_confirm`, `disabled`, `disabled_reason` FROM `users` WHERE `name`='$sql_login' OR `reg_email`='$sql_login' OR `reg_phone`='$sql_login' OR MD5(CONCAT(`id`,`name`,`reg_email`,`reg_phone`))='$sql_login'"); 690 if(! $res->num_rows ) throw new Exception("Пользователь не найден!"); 691 $user_info = $res->fetch_assoc(); 692 if($user_info['disabled']) 693 throw new Exception("Пользователь заблокирован (забанен). Причина блокировки: ".$user_info['disabled_reason']); 694 695 if(!isset($_REQUEST['method'])) { 696 $md5_hash = md5($user_info['id'].$user_info['name'].$user_info['reg_email'].$user_info['reg_phone']); 697 $tmpl->addContent("<h1 id='page-title'>Восстановление доступа - шаг 2</h1> 698 <form action='/login.php' method='post'> 699 <input type='hidden' name='mode' value='rem'> 700 <input type='hidden' name='login' value='$md5_hash'> 701 <input type='hidden' name='img' value='{$_REQUEST['img']}'> 702 <fieldset><legend>Восстановить доступ при помощи</legend>"); 703 if($user_info['reg_email']!='' && $user_info['reg_email_confirm']=='1') 704 $tmpl->addContent("<label><input type='radio' name='method' value='email'>Электронной почты</label><br>"); 705 if(preg_match('/^\+79\d{9}$/', $user_info['reg_phone']) && $user_info['reg_phone_confirm']=='1' && @$CONFIG['site']['allow_phone_regist']) 706 $tmpl->addContent("<label><input type='radio' name='method' value='sms'>SMS на мобильный телефон</label><br>"); 707 if(@$CONFIG['site']['allow_openid']) { 708 $res=$db->query("SELECT `openid_identify` FROM `users_openid` WHERE `user_id`={$user_info['id']}"); 709 while($openid_info=$res->fetch_row()) { 710 $oid=htmlentities($openid_info[0],ENT_QUOTES); 711 $tmpl->addContent("<label><input type='radio' name='method' value='$oid'>OpenID аккаунта $oid</label><br>"); 712 } 713 } 714 $tmpl->addContent("</fieldset> 715 <br><button type='submit'>Далее</button> 716 </form>"); 717 } 718 else { 719 $method=$_REQUEST['method']; 720 if($method=='email') { 721 $db->query("START TRANSACTION"); 722 $key=substr(md5($user_info['id'].$user_info['name'].$user_info['reg_email'].time().rand(0,1000000)),8); 723 $proto='http'; 724 if($CONFIG['site']['force_https_login'] || $CONFIG['site']['force_https']) $proto='https'; 725 726 $res=$db->query("UPDATE `users` SET `pass_change`='$key' WHERE `id`='{$user_info['id']}'"); 727 $msg="Поступил запрос на смену пароля доступа к сайту {$CONFIG['site']['name']} для аккаунта {$user_info['name']}.\nЕсли Вы действительно хотите сменить пароль, перейдите по ссылке\n$proto://{$CONFIG['site']['name']}/login.php?mode=remn&login={$user_info['name']}&s=$key ,\nлибо введите код подтверждения:\n$key\n----------------------------------------\nСообщение сгенерировано автоматически, отвечать на него не нужно!"; 728 mailto($user_info['reg_email'],"Восстановление забытого пароля",$msg); 729 $tmpl->msg("Сылка и код для смены пароля выслан Вам по электронной почте. Проверьте почтовый ящик.","ok"); 730 $db->query("COMMIT"); 731 } 732 else if($method=='sms') 733 { 734 require_once('include/sendsms.php'); 735 $db->query("START TRANSACTION"); 736 $key=rand(100000,99999999); 737 $res=$db->query("UPDATE `users` SET `pass_change`='$key' WHERE `id`='{$user_info['id']}'"); 738 739 $sender=new SMSSender(); 740 $sender->setNumber($user_info['reg_phone']); 741 $sender->setContent("Ваш код: $key\n{$CONFIG['site']['name']}"); 742 $sender->send(); 743 $db->query("COMMIT"); 744 $tmpl->msg("Код для смены пароля выслан Вам по SMS","ok"); 745 } 746 else if(@$CONFIG['site']['allow_openid']) 747 { 748 header("Location: /login_oid.php?oid=$method"); 749 exit(); 750 } 751 else throw new Exception("Метод не реализован или не доступен"); 752 753 if($method!='openid') 754 { 755 $tmpl->addContent("<h1 id='page-title'>Восстановление доступа - шаг 3</h1> 756 <form method='post'> 757 <input type='hidden' name='mode' value='remn'> 758 <input type='hidden' name='login' value='$login'> 759 Введите полученный код:<br> 760 <input type='text' name='s'><br> 761 <br><button type='submit'>Далее</button> 762 </form>"); 763 } 764 unset($_SESSION['captcha_ok']); 765 } 766 767 } 768 } 769 else if($mode=='remn') 770 { 771 $sql_key=$db->real_escape_string(@$_REQUEST['s']); 772 $sql_login=$db->real_escape_string(@$_REQUEST['login']); 773 $res=$db->query("SELECT `id`, `name` FROM `users` WHERE `pass_change`='$sql_key' AND `name`='$sql_login'"); 774 if($nxt=$res->fetch_row()) 775 { 776 $pass=keygen_unique(0,8,11); 777 778 if(@$CONFIG['site']['pass_type']=='MD5') 779 { 780 $sql_pass_hash=MD5($pass); 781 $sql_pass_type='MD5'; 782 } 783 else if(@$CONFIG['site']['pass_type']=='SHA1') 784 { 785 $sql_pass_hash=SHA1($pass); 786 $sql_pass_type='SHA1'; 787 } 788 else 789 { 790 if(CRYPT_SHA256 == 1) 791 { 792 $sql_pass_hash=crypt($pass, '$5$'.substr(MD5($login.rand(0,1000000)),0,16).'$'); 793 } 794 else $sql_pass_hash=crypt($pass); 795 $sql_pass_type='CRYPT'; 796 } 797 798 $res=$db->query("UPDATE `users` SET `pass`='$sql_pass_hash', `pass_type`='$sql_pass_type', `pass_change`='', `pass_date_change`=NOW() WHERE `id`='$nxt[0]'"); 799 $_SESSION['uid']=$nxt[0]; 800 $_SESSION['name']=$nxt[1]; 801 $tmpl->addContent("<h1>Завершение смены пароля</h1> 802 $nxt[1], ваш новый пароль:<br> 803 $pass<br>Не забудьте его!"); 804 } 805 else 806 { 807 $res = $db->query("UPDATE `users` SET `pass_change`='' WHERE `name`='$sql_login'"); 808 $tmpl->msg("Код неверен или устарел","err"); 809 } 810 } 811 else if($mode=='unsubscribe') { 812 $tmpl->setContent("<h1 id='page-title'>Отказ от рассылки</h1>"); 813 $email = $db->real_escape_string($_REQUEST['email']); 814 $source_sql = $db->real_escape_string($_REQUEST['from']); 815 $c=0; 816 $res = $db->query("UPDATE `users` SET `reg_email_subscribe`='0' WHERE `reg_email`='$email'"); 817 if($db->affected_rows) { 818 $db->query("INSERT INTO `users_unsubscribe_log` (`email`, `time`, `source`, `is_user`) 819 VALUES ('$email', NOW(), '$source_sql', 1)"); 820 $tmpl->msg("Вы успешно отказались от автоматической рассылки!","ok"); 821 $c=1; 822 } 823 824 $res = $db->query("UPDATE `doc_agent` SET `no_mail`='1' WHERE `email`='$email'"); 825 if($db->affected_rows) { 826 $db->query("INSERT INTO `users_unsubscribe_log` (`email`, `time`, `source`, `is_user`) 827 VALUES ('$email', NOW(), '$source_sql', 0)"); 828 $tmpl->msg("В нашей клиентской базе Ваш адрес помечен, как нежелательный для рассылки.","ok"); 829 $c=1; 830 } 831 832 if(!$c) $tmpl->msg("Ваш адрес не найден в наших базах рассылки! Возможно, Вы отказались от рассылки ранее, или не являетесь нашим зарегистрированным пользователем. За разяснением обратитесь по телефону или e-mail, указанному на странице <a class='wiki' href='/article/ContactInfo'>Контакты</a>, либо в письме, полученном от нас. Спасибо за понимание!","notify"); 833 } 834 else { 835 throw new NotFoundException("Неверная опция"); 836 } 837 838 } 839 catch(mysqli_sql_exception $e) 840 { 28 catch(mysqli_sql_exception $e) { 841 29 $id = writeLogException($e); 842 30 $tmpl->msg("Ошибка при регистрации. Порядковый номер - $id<br>Сообщение передано администратору",'err',"Ошибка при регистрации"); 843 31 mailto($CONFIG['site']['admin_email'],"ВАЖНО! Ошибка регистрации на ".$CONFIG['site']['name'].". номер в журнале - $id", $e->getMessage()); 844 845 32 } 846 33 catch(Exception $e) { 847 writeLogException($e);848 34 $db->rollback(); 849 $tmpl->msg($e->getMessage(),"err","Ошибка при регистрации"); 35 $id = writeLogException($e); 36 $tmpl->errorMessage("Ошибка при регистрации: " . $e->getMessage() . ". Порядковый номер - $id<br>Сообщение передано администратору", "Ошибка при регистрации"); 850 37 } 851 38 -
web/login_oid.php
r4cefac0 r0ebef4e 3 3 // MultiMag v0.2 - Complex sales system 4 4 // 5 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org5 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 6 6 // 7 7 // This program is free software: you can redistribute it and/or modify … … 191 191 mailto(@$oid_attr['contact/email'], "Регистрация на ".$CONFIG['site']['name'], $msg); 192 192 } 193 193 /// ТОВО: отправить SMS с кодом подтверждения 194 194 195 $_SESSION['uid']=$user_id; 195 196 $_SESSION['name']=$login; -
web/message.php
r4cefac0 r0ebef4e 3 3 // MultiMag v0.2 - Complex sales system 4 4 // 5 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org5 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 6 6 // 7 7 // This program is free software: you can redistribute it and/or modify … … 140 140 } 141 141 } 142 else if($mode=='send') 143 { 144 $nm = request('nm');145 $backadr= request('backadr');146 $text = request('text');147 $text="Нам написал сообщение $nm($backadr)с сайта {$CONFIG['site']['name']}\n-------------------\n$text\n";148 $text.="-------------------\nIP отправителя: ".getenv("REMOTE_ADDR")."\nSESSION ID:".session_id();149 142 else if($mode=='send') { 143 $nm = request('nm'); 144 $backadr = request('backadr'); 145 $text = request('text'); 146 $text = "Нам написал сообщение $nm($backadr)с сайта {$CONFIG['site']['name']}\n-------------------\n$text\n"; 147 $text .= "-------------------\nIP отправителя: " . getenv("REMOTE_ADDR") . "\nSESSION ID:" . session_id(); 148 $text .= "\nБроузер: ".getenv("HTTP_USER_AGENT"); 149 if(@$_SESSION['name']) $text.="\nLogin отправителя: ".$_SESSION['name']; 150 150 151 151 if($opt=='jabber') -
web/news.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
web/photo.php
r4cefac0 r0ebef4e 3 3 // MultiMag v0.2 - Complex sales system 4 4 // 5 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org5 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 6 6 // 7 7 // This program is free software: you can redistribute it and/or modify -
web/photogalery.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
web/price.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
web/priceload.php
r4cefac0 r0ebef4e 3 3 // MultiMag v0.2 - Complex sales system 4 4 // 5 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org5 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 6 6 // 7 7 // This program is free software: you can redistribute it and/or modify -
web/quest_stat.php
r4cefac0 r0ebef4e 3 3 // MultiMag v0.2 - Complex sales system 4 4 // 5 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org5 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 6 6 // 7 7 // This program is free software: you can redistribute it and/or modify -
web/rights.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
web/search.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
web/sitemap.php
r4cefac0 r0ebef4e 3 3 // MultiMag v0.2 - Complex sales system 4 4 // 5 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org5 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 6 6 // 7 7 // This program is free software: you can redistribute it and/or modify -
web/statistics.php
r4cefac0 r0ebef4e 3 3 // MultiMag v0.2 - Complex sales system 4 4 // 5 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org5 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 6 6 // 7 7 // This program is free software: you can redistribute it and/or modify -
web/survey.php
r4cefac0 r0ebef4e 3 3 // MultiMag v0.2 - Complex sales system 4 4 // 5 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org5 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 6 6 // 7 7 // This program is free software: you can redistribute it and/or modify -
web/tickets.php
r4cefac0 r0ebef4e 3 3 // MultiMag v0.2 - Complex sales system 4 4 // 5 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org5 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 6 6 // 7 7 // This program is free software: you can redistribute it and/or modify -
web/user.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify … … 21 21 need_auth($tmpl); 22 22 23 try 24 { 25 23 try { 26 24 $tmpl->setTitle("Личный кабинет"); 27 $tmpl->setContent("<h1>Личный кабинет</h1> <p class=text>На этой странице представлены дополнительные возможности, доступные только зарегистрированным пользователям. Разделы с пометкой 'В разработке' и 'Тестирование' размещены здесь только в целях тестирования и не являются полностью рабочими.</p>");25 $tmpl->setContent("<h1>Личный кабинет</h1>"); 28 26 29 27 $tmpl->hideBlock('left'); … … 31 29 32 30 if ($mode == '') { 33 $tmpl->add Content("<ul>");34 $res=$db->query("SELECT `users_worker_info`.`worker` FROM `users` 35 LEFT JOIN `users_worker_info` ON `users_worker_info`.`user_id`=`users`.`id` 36 WHERE `users`.`id`='{$_SESSION['uid']}'");37 $l = $res->fetch_row(); 38 if ($l) { 39 if ($l[0]) { 40 $tmpl->addContent("<li><a href='/user.php?mode=frequest' accesskey='w' style='color: #f00'>Сообщить об ошибке или заказать доработку программы</a></li>"); 41 } 42 } 43 44 if (isAccess('doc_list', 'view') || isAccess('doc_fabric', 'view')) { 45 $tmpl->addContent("<h2>Документы</h2>"); 46 } 47 if (isAccess('doc_list', 'view')) { 48 $tmpl->addContent("<li><a href='/docj_new.php' accesskey='l' title='Документы'>Журнал документов (L)</a></li>"); 49 } 50 if (isAccess('doc_factory', 'view')) { 51 $tmpl->addContent("<li><a href='/factory.php'>Учёт производства (экспериментально)</a></li>"); 52 } 53 // Журналы 54 if (isAccess('log_browser', 'view') || isAccess('log_error', 'view') || isAccess('log_access', 'view') || isAccess('log_call_request', 'view')) { 55 $tmpl->addContent("<h2>Журналы</h2>"); 56 } 57 if (isAccess('log_browser', 'view')) {58 $tmpl->addContent("<li><a href='/statistics.php' title='Статистика по броузерам'>Статистика по броузерам</a></li>"); 59 } 60 if (isAccess('log_error', 'view')) { 61 $tmpl->addContent("<li><a href='?mode=elog' accesskey='e' title='Ошибки'>Журнал ошибок (E)</a></li>"); 62 } 63 if (isAccess('log_access', 'view')) { 64 $tmpl->addContent("<li><a href='?mode=clog'>Журнал посещений</a></li>"); 65 } 66 if (isAccess('log_call_request', 'view')) { 67 $tmpl->addContent("<li><a href='?mode=log_call_request'>Журнал запрошенных звонков</a></li>");68 }69 // Системные функции70 if (isAccess('sys_async_task', 'view') || isAccess('sys_ps-stat', 'view') || isAccess('sys_ip-blacklist', 'view') || isAccess('sys_acl', 'view')) {71 $tmpl->addContent("<h2>Системные функции</h2>");72 73 if (isAccess('sys_async_task', 'view')) {74 $tmpl->addContent("<li><a href='?mode=async_task' title=''>Ассинхронные задачи</a></li>");75 76 if (isAccess('sys_ps-stat', 'view')) {77 $tmpl->addContent("<li><a href='?mode=psstat' title=''>Статистика переходов с поисковиков</a></li>");78 } 79 if (isAccess('sys_ip-blacklist', 'view')) {80 $tmpl->addContent("<li><a href='?mode=denyip'>Запрещенные IP адреса</a></li>");81 } 31 $tmpl->addBreadcrumb('Главная', '/'); 32 $tmpl->addBreadcrumb('Личный кабинет', ''); 33 $auth = new \authenticator(); 34 $auth->loadDataForID($_SESSION['uid']); 35 if( $auth->isNeedConfirmEmail() || $auth->isNeedConfirmPhone() ) { 36 $login_page = new \Modules\Site\login(); 37 $tmpl->addContent( $login_page->getConfirmForm($_SESSION['name']) ."<br><br>" ); 38 } 39 40 $block = ''; 41 if (isAccess('doc_list', 'view')) { 42 $block .= "<li><a href='/docj_new.php' accesskey='l' title='Документы'>Журнал документов (L)</a></li>"; 43 } 44 if (isAccess('doc_factory', 'view')) { 45 $block .= "<li><a href='/factory.php'>Учёт производства (экспериментально)</a></li>"; 46 } 47 if (isAccess('log_call_request', 'view')) { 48 $block .= "<li><a href='?mode=log_call_request' accesskey='c'>Журнал запрошенных звонков (C)</a></li>"; 49 } 50 if (isAccess('sys_async_task', 'view')) { 51 $block .= "<li><a href='?mode=async_task' title=''>Ассинхронные задачи</a></li>"; 52 } 53 if (isAccess('sys_ip-blacklist', 'view')) { 54 $block .= "<li><a href='?mode=denyip'>Запрещенные IP адреса</a></li>"; 55 } 56 if (isAccess('generic_tickets', 'view')) { 57 $block .= "<li><a href='/tickets.php' accesskey='t' title='Задания'>Планировщик заданий (T)</a></li>"; 58 } 59 if( $block ) { 60 $tmpl->addContent("<h2>Сотруднику</h2>" 61 . "<ul class='items'>" 62 . "<li><a href='/user.php?mode=feedback' style='color: #f00' accesskey='r'>Сообщить об ошибке или заказать доработку программы (R)</a></li>" 63 . $block 64 . "</ul>"); 65 } 66 $block = ''; 67 // Администрирование 68 if (isAccess('admin_comments', 'view')) { 69 $block .= "<li><a href='/adm_comments.php'>Администрирование коментариев</a></li>"; 70 } 71 if (isAccess('admin_users', 'view')) { 72 $block .= "<li><a href='/adm_users.php'>Администрирование пользователей</a></li>"; 73 } 74 if (isAccess('admin_mailconfig', 'view')) { 75 $block .= "<li><a href='/adm.php?mode=mailconfig'>Настройка почтовых ящиков и алиасов</a></li>"; 76 } 77 if (isAccess('sys_ps-stat', 'view')) { 78 $block .= "<li><a href='?mode=psstat' title=''>Статистика переходов с поисковиков</a></li>"; 79 } 82 80 if (isAccess('sys_acl', 'view')) { 83 $tmpl->addContent("<li><a href='/rights.php'>Привилегии доступа</a></li>"); 84 } 85 86 // Администрирование 87 if (isAccess('admin_comments', 'view') || isAccess('admin_users', 'view')) { 88 $tmpl->addContent("<h2>Администрирование</h2>"); 89 if (isAccess('admin_comments', 'view')) { 90 $tmpl->addContent("<li><a href='/adm_comments.php'>Администрирование коментариев</a></li>"); 91 } 92 if (isAccess('admin_users', 'view')) { 93 $tmpl->addContent("<li><a href='/adm_users.php'>Администрирование пользователей</a></li>"); 94 } 95 if (isAccess('admin_mailconfig', 'view')) { 96 $tmpl->addContent("<li><a href='/adm.php?mode=mailconfig'>Настройка почтовых ящиков и алиасов</a></li>"); 97 } 98 } 99 100 101 // Разное 102 if (isAccess('generic_articles', 'view') || isAccess('generic_tickets', 'view')) { 103 $tmpl->addContent("<h2>Разное</h2>"); 104 if (isAccess('generic_articles', 'view')) { 105 $tmpl->addContent("<li><a href='/articles.php' accesskey='w' title='Cтатьи'>Cтатьи (W)</a></li>"); 106 } 107 if (isAccess('generic_tickets', 'view')) { 108 $tmpl->addContent("<li><a href='/tickets.php' title='Задачи'>Планировщик задач</a></li>"); 109 } 110 } 111 $tmpl->addContent("<li><a href='/user.php?mode=user_data'>Личные данные</a></li>"); 112 $tmpl->addContent("<li><a href='/user.php?mode=doc_hist'>История документов</a></li>"); 113 $tmpl->addContent("<li><a href='/voting.php'>Голосования</a></li>"); 114 115 $tmpl->addContent("</ul>"); 116 } 117 else if($mode=='user_data'){ 118 $opt=request('opt'); 119 $tmpl->setContent("<h1 id='page-title'>Личные данные</h1>"); 120 if($opt=='save'){ 121 $data=array( 122 'real_name'=> request('rname'), 123 'reg_email_subscribe'=> rcvint('subscribe'), 124 'reg_phone'=> request('tel'), 125 'real_address'=> request('adres'), 126 'jid'=> request('jid') ); 127 $uid = intval($_SESSION['uid']); 128 $db->updateA('users', $uid, $data); 129 $data=requestA( array('icq', 'skype', 'mra', 'site_name') ); 130 $db->replaceKA('users_data', 'uid', $uid, $data); 131 $tmpl->msg("Данные обновлены!","ok"); 132 } 133 134 135 $user_data=$db->selectRowA('users', $uid, 136 array('name', 'reg_email', 'reg_date', 'reg_email_subscribe', 'real_name', 'reg_phone', 'real_address', 'jid', 'agent_id') ); 137 $user_dopdata=$db->selectFieldKA('users_data', 'uid', $uid, array('icq', 'skype', 'mra', 'site_name') ); 138 $subs_checked=$user_data['reg_email_subscribe']?'checked':''; 139 140 $tmpl->addContent("<form action='' method='post'> 141 <input type='hidden' name='mode' value='user_data'> 142 <input type='hidden' name='opt' value='save'> 143 <table border='0' width='500' class='list'> 144 <tr><th colspan='2'>Общие данные</th></tr> 145 <tr><td>Логин:</td><td>".html_out($user_data['name'])."</td></tr> 146 <tr><td>Дата регистрации:</td><td>".html_out($user_data['reg_date'])."</td></tr> 147 <tr><td>E-mail:</td><td>{$user_data['reg_email']}<br><label><input type='checkbox' name='subscribe' value='1' $subs_checked> Подписка</label> 148 <tr><td>Jabber ID<td><input type='text' name='jid' value='".html_out($user_data['jid'])."'> 149 <tr><th colspan='2'>Данные физического лица 150 <tr><td>Фамилия И.О.:</td><td><input type='text' name='rname' value='".html_out($user_data['real_name'])."'></td></tr> 151 <tr><td>Телефон:</td><td><input type='text' name='tel' value='".html_out($user_data['reg_phone'])."'></td></tr> 152 <tr><td>Адрес доставки:</td><td><input type='text' name='adres' value='".html_out($user_data['real_address'])."'></td></tr> 153 <tr><th colspan='2'>Дополнительная контактная информация</td></tr> 154 <tr><td>UIN ICQ:</td><td><input type='text' name='icq' value='".html_out($user_dopdata['icq'])."'></td></tr> 155 <tr><td>Skype-login:</td><td><input type='text' name='skype' value='".html_out($user_dopdata['skype'])."'></td></tr> 156 <tr><td>Mail-ru ID:</td><td><input type='text' name='mra' value='".html_out($user_dopdata['mra'])."'></td></tr> 157 <tr><td>Сайт:</td><td><input type='text' name='site_name' value='".html_out($user_dopdata['site_name'])."'></td></tr> 158 <tr><td><td><button type='submit'>Сохранить</button> 159 </table></form>"); 160 161 if($user_data['agent_id']){ 162 $adata=$db->selectRowA('users', $uid, array('id', 'name', 'fullname', 'tel', 'fax_phone', 'sms_phone', 'adres', 'data_sverki') ); 163 $tmpl->addContent("<table border='0' width='500' class='list'> 164 <tr><th colspan='2'>Аккаунт прикреплён к агенту 165 <tr><td>ID агента</td><td>{$adata['id']}</td></tr> 166 <tr><td>Краткое название</td><td>".html_out($adata['name'])."</td></tr> 167 <tr><td>Полное название</td><td>".html_out($adata['fullname'])."</td></tr> 168 <tr><td>Телефон</td><td>".html_out($adata['tel'])."</td></tr> 169 <tr><td>Факс</td><td>".html_out($adata['fax_phone'])."</td></tr> 170 <tr><td>Телефон для SMS</td><td>".html_out($adata['sms_phone'])."</td></tr> 171 <tr><td>Адрес</td><td>".html_out($adata['adres'])."</td></tr> 172 <tr><td>Дата сверки</td><td>".html_out($adata['data_sverki'])."</td></tr> 173 </table>"); 174 } 175 } 176 else if($mode=='log_call_request'){ 177 if(!isAccess('log_call_request','view')) throw new AccessException(); 178 179 $tmpl->setContent("<h1>Журнал запрошенных звонков</h1> 180 <div class='content'> 181 <table width='100%' class='list' cellspacing='0'> 182 <tr><th>Дата запроса</th><th>Кому звонить?</th><th>Куда звонить?</th><th>Когда звонить?</th><th>IP</th></tr>"); 183 $res=$db->query("SELECT `id`, `request_date`, `name`, `phone`, `call_date`, `ip` FROM `log_call_requests` ORDER BY `request_date`"); 184 while($line=$res->fetch_assoc()) 185 $tmpl->addContent("<tr><td>".html_out($line['request_date'])."</td><td>".html_out($line['name'])."</td><td>". html_out($line['phone'])."</td><td>".html_out($line['call_date'])."</td><td>{$line['ip']}</td></tr>"); 186 $tmpl->addContent("</table></div>"); 187 } 188 else if($mode=='doc_hist'){ 189 $tmpl->setContent("<h1>Выписанные документы</h1> 190 <div class='content'> 191 <table width='100%' class='list' cellspacing='0'> 192 <tr class='title'><th>Номер</th><th>Дата</th><th>Документ</th><th>Подтверждён ?</th><th>Дата подтверждения</th><th>Сумма</th></tr>"); 193 $res=$db->query("SELECT `doc_list`.`id`, `doc_list`.`date`, `doc_types`.`name`, `doc_list`.`ok`, `doc_list`.`sum`, `doc_list`.`type` 194 FROM `doc_list` 195 LEFT JOIN `doc_types` ON `doc_types`.`id`=`doc_list`.`type` 196 WHERE `doc_list`.`user`='{$_SESSION['uid']}' 197 ORDER BY `date`"); 198 $i=0; 199 while($nxt=$res->fetch_assoc()) { 200 $date=date("Y-m-d H:i:s",$nxt['date']); 201 $ok=$nxt['ok']?'Да':'Нет'; 202 $ok_date=$nxt['ok']?date("Y-m-d H:i:s",$nxt['ok']):''; 203 $lnum=$nxt['id']; 204 if($nxt['type']==2 || $nxt['type']==3) $lnum="<a href='/user.php?mode=doc_view&doc={$nxt['id']}'>{$nxt['id']}</a>"; 205 $tmpl->addContent("<tr><td>$lnum</td><td>$date</td><td>".html_out($nxt['name'])."</td><td>$ok</td><td>$ok_date</td><td>{$nxt['sum']}</td></tr>"); 206 } 207 $tmpl->addContent("</table></div>"); 208 } 209 else if($mode=='doc_view'){ 210 try{ 211 include_once("include/doc.core.php"); 212 include_once("include/doc.nulltype.php"); 213 $doc=rcvint('doc'); 214 if($doc){ 215 $doc_data=$db->selectRowA('doc_list', $doc, array('id', 'type', 'user') ); 216 $uid = intval($_SESSION['uid']); 217 if($doc_data['user']!=$uid) throw new Exception("Документ не найден"); 218 219 $document=AutoDocumentType($doc_data['type'], $doc); 220 if($doc_data['type']==3) $document->PrintForm('int:schet'); 221 else if($doc_data['type']==2) $document->PrintForm('int:nak'); 222 else throw new Exception("Способ просмотра не задан!"); 223 } 224 else throw new Exception("Документ не указан"); 225 } 226 catch(Exception $e){ 227 $tmpl->addContent("<br><br>"); 228 writeLogException($e); 229 $tmpl->errorMessage($e->getMessage()); 230 } 231 } 232 233 else if($mode=='frequest') 234 { 235 if(!$CONFIG['site']['trackticket_login']) throw new Exception("Конфигурация модуля не заполнена!"); 236 237 $ch = curl_init(); 238 curl_setopt($ch, CURLOPT_URL, "http://multimag.tndproject.org/login"); 239 curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 240 curl_setopt($ch, CURLOPT_USERPWD, $CONFIG['site']['trackticket_login'].':'.$CONFIG['site']['trackticket_pass']); 241 curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC); 242 curl_setopt($ch, CURLOPT_HEADER, true); 243 244 $data = curl_exec($ch); 245 $header=substr($data,0,curl_getinfo($ch,CURLINFO_HEADER_SIZE)); 246 //$body=substr($data,curl_getinfo($ch,CURLINFO_HEADER_SIZE)); 247 preg_match_all("/Set-Cookie: (.*?)=(.*?);/i",$header,$res); 248 $cookie=''; 249 foreach ($res[1] as $key => $value) 250 $cookie.= $value.'='.$res[2][$key].'; '; 251 252 curl_setopt($ch, CURLOPT_HEADER, false); 253 curl_setopt($ch, CURLOPT_COOKIE,$cookie); 254 curl_setopt($ch, CURLOPT_URL, "http://multimag.tndproject.org/newticket"); 255 $output = curl_exec($ch); 256 // close curl resource to free up system resources 257 curl_close($ch); 258 259 $_SESSION['trac_cookie']=$cookie; 260 261 $doc = new DOMDocument('1.0','UTF8'); 262 263 @$doc->loadHTML('<meta http-equiv="content-type" content="text/html; charset=utf-8">'.$output); 264 $doc->normalizeDocument (); 265 266 $form=$doc->getElementById('propertyform'); 267 if(!$form) throw new Exception("Не удалость получить форму треккера!"); 268 269 $form_inputs=$form->getElementsByTagName('input'); 270 $token=''; 271 foreach($form_inputs as $input) 272 { 273 $input_name=$input->attributes->getNamedItem('name'); 274 $input_name=$input_name?$input_name->nodeValue:''; 275 if($input_name=='__FORM_TOKEN') 276 { 277 $input_value=$input->attributes->getNamedItem('value'); 278 $input_value=$input_value?$input_value->nodeValue:''; 279 $token=$input_value; 280 break; 281 } 282 } 283 $form_selects=$form->getElementsByTagName('select'); 284 $selects=array(); 285 $selects_html=array(); 286 foreach($form_selects as $select) 287 { 288 $select_name=$select->attributes->getNamedItem('name'); 289 $select_name=$select_name?$select_name->nodeValue:''; 290 $selects[$select_name]=array(); 291 $select_options=$select->getElementsByTagName('option'); 292 $selects_html[$select_name]=''; 293 294 foreach($select_options as $option) 295 { 296 if($option->nodeValue=='Ядро') continue; 297 $selected=$option->attributes->getNamedItem('selected'); 298 $selected=$selected?' selected':''; 299 $selects[$select_name][]=$option->nodeValue; 300 $selects_html[$select_name].='<option'.$selected.'>'.$option->nodeValue.'</option>'; 301 } 302 } 303 304 $tmpl->setTitle("Запрос на доработку программы"); 305 $tmpl->setContent("<h1 id='page-title'>Оформление запроса на доработку программы</h1> 306 <div id='page-info'>Внимание! Страница является упрощённым интерфейсом к <a href='http://multimag.tndproject.org/newticket' >http://multimag.tndproject.org/newticket</a></div> 307 <p class='text'>Заполняя эту форму, вы формируете заказ на доработку сайта от имени Вашей организации в общедоступный реестр заказов, расположенный по адресу <a href='http://multimag.tndproject.org/report/3'>http://multimag.tndproject.org/report/3</a>. Копия Вашего сообщения будет отправлена всем разработчикам и пользователям multimag, подписанных на получение таких сообщений. 308 <br> 309 Внимательно заполните все поля. Если иное не написано рядом с полем, все поля являются обязательными для заполнения. Особое внимание стоит уделить полю *краткое содержание*. 310 <br> 311 <b>Для удобства отслеживания исполнения задач (вашего и разработчиков) каждая задача должна быть добавлена отдельно. Нарушение этого условия скорее всего приведёт к тому, что некоторые задачи окажутся незамеченными.</b> 312 <br> 313 Все задания можно и нужно отслеживать через систему-треккер. 314 </p> 315 </p> 316 317 <form action='/user.php' method='post'> 318 <input type='hidden' name='token' value='$token'> 319 <input type='hidden' name='mode' value='sendrequest'> 320 321 <b>Тип задачи</b> определяет суть задачи и очерёдность её исполнения. 322 <ul> 323 <li>Тип <u>Дефект</u> используется для информирования разработчиков о неверной работе существующих частей сайта. Такие задачи исполняются в первую очередь.</li> 324 <li>Тип <u>Улучшение</u> используйте для задач по доработке существующего функционала сайта</li> 325 <li>Тип <u>Задача</u> используется для задач, описывающих новый функционал. Это тип по умолчанию.</li> 326 <li>Тип <u>Предложение</u> используете в том случае, если Вам бы хотелось видеть какой-либо функционал на сайте, но Вы не планируете заказывать его разработку в ближайшее время. Используется для отправки идей по доработке разработчикам и другим пользователям программы.</li> 327 </ul> 328 <i><u>Пример</u>: Задача</i><br> 329 <select name='field_type'>{$selects_html['field_type']}</select><br><br> 330 331 <b>Краткое содержание</b>. Тема задачи. Максимально кратко (3-8 слов) и ёмко изложите суть поставленной задачи. Максимум 64 символа.<br> 332 <i><u>Пример</u>: Реализовать печатную форму: Приходный кассовый ордер</i><br> 333 <input type='text' maxlength='64' name='field_summary' style='width:90%'><br><br> 334 335 <b>Подробное описание</b>. Максимально подробно изложите суть задачи. Описание должно являться дополнением краткого содержания. Не допускается писать несколько задач. Можно использовать wiki разметку для форматирвания.<br> 336 <i><u>Пример</u>: Форма должна быть доступна в документе *приходный кассовый ордер*, должна быть в PDF формате, и соответствовать общепринятой форме КО-1</i><br> 337 <textarea name='field_description' rows='7' cols='80'></textarea><br><br> 338 339 <b>Компонент приложения</b>. Выбирается исходя из того, к какой части сайта относится ваша задача. Если задача относится к вашим индивидуальным модификациям - выбирайте *пользовательский дизайн*<br> 340 <i><u>Пример</u>: Документы</i><br> 341 <select name='field_component'>{$selects_html['field_component']}</select><br><br> 342 343 <b>Приоритет</b> определяет то, насколько срочно требуется выполнить поставленную задачу. Критический приоритет допустимо указывать только для задач с типом *дефект*<br> 344 <i><u>Пример</u>: Обычный</i><br> 345 <select name='field_priority'>{$selects_html['field_priority']}</select><br><br> 346 347 <b>Целевая версия</b> нужна, чтобы указать, в какой версии программы вы хотели бы видеть реализацию этой задачи. Вы можете отложить реализацию, указав более позднюю версию. Нет смысла выбирать более раннюю версию, т.к. приём задач в неё закрыт. В случае, если задача не соответствует целям версии, разработчики могут изменить этот параметр.<br> 348 <i><u>Пример</u>: 0.9</i><br> 349 <select name='field_milestone'>{$selects_html['field_milestone']}</select><br><br> 350 351 <button type='submit'>Опубликовать задачу</button> 352 </form>"); 353 } 354 else if($mode=='sendrequest') 355 { 356 $fields=array( 357 '__FORM_TOKEN' => $_POST['token'], 358 'field_type' => $_POST['field_type'], 359 'field_summary' => $_POST['field_summary'], 360 'field_description' => $_POST['field_description']."\nUser: {$_SESSION['name']} at {$_SERVER['HTTP_HOST']} ({$CONFIG['site']['name']})", 361 'field_component' => $_POST['field_component'], 362 'field_priority' => $_POST['field_priority'], 363 'field_milestone' => $_POST['field_milestone'], 364 'field_reporter' => $CONFIG['site']['trackticket_login'], 365 'field_cc' => $_SESSION['name'].'@'.$CONFIG['site']['name'], 366 'submit' => 'submit' 367 ); 368 369 $ch = curl_init(); 370 curl_setopt($ch, CURLOPT_URL, "http://multimag.tndproject.org/newticket"); 371 curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 372 curl_setopt($ch, CURLOPT_HEADER, true); 373 curl_setopt($ch, CURLOPT_COOKIE,$_SESSION['trac_cookie'].' trac_form_token='.$_POST['token']); 374 curl_setopt($ch, CURLOPT_POST, 1); 375 curl_setopt($ch, CURLOPT_POSTFIELDS, $fields); 376 377 378 $data = curl_exec($ch); 379 $header=substr($data,0,curl_getinfo($ch,CURLINFO_HEADER_SIZE)); 380 $body=substr($data,curl_getinfo($ch,CURLINFO_HEADER_SIZE)); 381 curl_close($ch); 382 383 $ticket=0; 384 $ticket_url=''; 385 $hlines=explode("\n",$header); 386 foreach($hlines as $line) 387 { 388 $line=trim($line); 389 if(strpos($line,'Location')===0) 390 { 391 $chunks=explode(": ",$line); 392 $ticket_url=trim($chunks[1]); 393 $chunks=explode("/",$ticket_url); 394 $ticket=$chunks[count($chunks)-1]; 395 settype($ticket,'int'); 396 break; 397 } 398 } 399 400 $tmpl->setContent("<h1>Оформление запроса на доработку программы</h1> 401 <div id='page-info'>Внимание! Страница является упрощённым интерфейсом к <a href='http://multimag.tndproject.org/newticket' >http://multimag.tndproject.org/newticket</a></div>"); 402 if($ticket) 403 { 404 $tmpl->msg("Номер задачи: <b>$ticket</b>.<br>Посмотресть созданную задачу, а так же следить за ходом её выполнения, можно по ссылке: <a href='$ticket_url'>$ticket_url</a>","ok","Задача успешно внесена в реестр!"); 405 $tmpl->addContent("<iframe width='100%' height='70%' src='$ticket_url'></iframe>"); 406 } 407 else $tmpl->msg("Не удалось создать задачу! Сообщите о проблеме своему системному администратору!","err"); 408 } 409 else if($mode=="elog") { 410 if (!isAccess('log_error', 'view')) { 411 throw new AccessException(); 412 } 413 $id = rcvint('id'); 414 if($id) { 415 $tmpl->addContent("<h1>Детализация ошибки $id</h1>"); 416 $line = $db->selectRow('errorlog', $id); 417 $line['trace'] = str_replace("\n", '</li><li>', html_out($line['trace'])); 418 $pref_len = strlen($CONFIG['location']); 419 $fname = substr($line['file'], $pref_len); 420 $link = 'http://multimag.tndproject.org/browser/trunk'.$fname.'?rev='.MULTIMAG_REV.'#L'.$line['line']; 421 $tmpl->addContent("<ui class='items'>" 422 . "<li>id: {$line['id']}</li>" 423 . "<li>Сообщение: ".html_out($line['msg'])."</li>" 424 . "<li>Класс: ".html_out($line['class'])."</li>" 425 . "<li>Кoд: ".html_out($line['code'])."</li>" 426 . "<li>Файл: <a href='$link'>".html_out($line['file'])."</a></li>" 427 . "<li>Строка: ".html_out($line['line'])."</li>" 428 . "<li>Страница: ".html_out($line['page'])."</li>" 429 . "<li>Ссылка: ".html_out($line['referer'])."</li>" 430 . "<li>Дата: ".html_out($line['date'])."</li>" 431 . "<li>IP: ".html_out($line['ip'])."</li>" 432 . "<li>Броузер: ".html_out($line['useragent'])."</li>" 433 . "<li>ID пользователя: ".html_out($line['uid'])."</li>" 434 . "<li>Стек:<ul><li>".$line['trace']."</li></ul></li>" 435 . "</ul>"); 436 } 437 else { 438 $p = rcvint('p', 1); 439 if($p<=0) $p=1; 440 $lines = 250; 441 $from=($p-1)*$lines; 442 $tmpl->addContent("<h1>Журнал ошибок</h1>"); 443 $res = $db->query("SELECT SQL_CALC_FOUND_ROWS `id`, `class`, `page`, `referer`, `code`, `msg`, `file`, `line`, `date`, `ip`, `useragent`, `uid` " 444 . "FROM `errorlog` " 445 . "ORDER BY `id` DESC LIMIT $from, $lines"); 446 $fr = $db->query('SELECT FOUND_ROWS()'); 447 list($total) = $fr->fetch_row(); 448 $tmpl->addContent("<table width='100%' class='list'> 449 <tr><th>Дата</th><th>Класс</th><th>Код</th><th>Ошибка</th><th>Файл:строка</th><th>Страница</th><th>ID</th></tr>"); 450 $i=0; 451 while($line = $res->fetch_assoc()) { 452 $line['date'] = str_replace(' ', ' ', html_out($line['date'])); 453 $tmpl->addContent('<tr>' 454 . '<td>'.$line['date'].'</td>' 455 . '<td>'.html_out($line['class']).'</td>' 456 . '<td>'.$line['code'].'</td>' 457 . '<td>'.html_out($line['msg']).'</td>' 458 . '<td>'.html_out(basename($line['file'])).':'.$line['line'].'</td>' 459 . '<td>'.html_out($line['page']).'</td>' 460 . '<td><a href="/user.php?mode=elog&id='.$line['id'].'">'.$line['id'].'</a></td>' 461 . '</tr>'); 462 } 463 $tmpl->addContent('</table>'); 464 465 $pages_count = ceil($total/$lines); 466 if ($pages_count > 1) { 467 $tmpl->addContent('<p>Страницы: '); 468 for ($i = 1; $i <= $pages_count; ++$i) { 469 if ($i == $p) 470 $tmpl->addContent("<b>$i</b> "); 471 else 472 $tmpl->addContent("<a href='?mode=elog&p=$i'>$i</a> "); 473 } 474 $tmpl->addContent("</p>"); 475 } 476 } 81 $block .= "<li><a href='/rights.php'>Привилегии доступа</a></li>"; 82 } 83 if (isAccess('log_browser', 'view')) { 84 $block .= "<li><a href='/statistics.php' title='Статистика по броузерам'>Статистика по броузерам</a></li>"; 85 } 86 if (isAccess('log_error', 'view')) { 87 $block .= "<li><a href='?mode=elog' accesskey='e' title='Ошибки'>Журнал ошибок (E)</a></li>"; 88 } 89 if (isAccess('log_access', 'view')) { 90 $block .= "<li><a href='?mode=clog'>Журнал посещений</a></li>"; 91 } 92 if( $block ) { 93 $tmpl->addContent("<h2>Администратору</h2>" 94 . "<ul class='items'>$block</ul>"); 95 } 96 97 $block = ''; 98 if (isAccess('generic_articles', 'view')) { 99 $block .= "<li><a href='/articles.php' accesskey='w' title='Cтатьи'>Cтатьи (W)</a></li>"; 100 } 101 $block .= "<li><a href='/user.php?mode=profile' accesskey='p'>Мой профиль (P)</a></li>"; 102 $block .= "<li><a href='/user.php?mode=my_docs' accesskey='d'>Мои документы (D)</a></li>"; 103 $block .= "<li><a href='/voting.php'>Голосования</a></li>"; 104 105 if( $block ) { 106 $tmpl->addContent("<h2>Клиенту</h2>" 107 . "<ul class='items'>$block</ul>"); 108 } 109 } 110 else if($mode=='profile' || $mode=='chpwd' || $mode=='cemail' || $mode=='cphone' || $mode=='my_docs' || $mode=='get_doc' || $mode=='elog' 111 || $mode=='log_call_request' || $mode=='feedback' || $mode=='feedback_send' ){ 112 $cab = new \Modules\Site\cabinet(); 113 $cab->ExecMode($mode); 477 114 } 478 115 else if ($mode == "clog") { -
web/vitrina.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify -
web/voting.php
r4cefac0 r0ebef4e 3 3 // MultiMag v0.2 - Complex sales system 4 4 // 5 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org5 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 6 6 // 7 7 // This program is free software: you can redistribute it and/or modify -
web/wikiphoto.php
r4cefac0 r0ebef4e 2 2 // MultiMag v0.2 - Complex sales system 3 3 // 4 // Copyright (C) 2005-201 4, BlackLight, TND Team, http://tndproject.org4 // Copyright (C) 2005-2015, BlackLight, TND Team, http://tndproject.org 5 5 // 6 6 // This program is free software: you can redistribute it and/or modify
Note: See TracChangeset
for help on using the changeset viewer.