├── README.md ├── api.txt ├── structure.txt └── www ├── contract.html ├── css ├── baloon.css ├── editor.css ├── viewer.css └── zones.css ├── js ├── cache-manifest.txt ├── editor-lib.js ├── jquery-1.7.2.js ├── test-data.js ├── tool-lib.js └── wrap-lib.js └── maasdam.html /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ymik/HelloDelivery/d63d2e5c0192dd86564980bbd26d80538d5b49f7/README.md -------------------------------------------------------------------------------- /api.txt: -------------------------------------------------------------------------------- 1 | get Zone info: 2 | 3 | [URL] /getZones?r=[uncaching val] 4 | [GET] 5 | { 6 | "[zone id]": 7 | { 8 | "zone":"[zone name]", 9 | "price":"[price]", 10 | "schedule":[value of schedule prop], 11 | "shape":[value of shape prop] 12 | }, 13 | ... 14 | } 15 | 16 | 17 | [URL] /getSchedule?from=[timestamp in seconds]&to=[timestamp in seconds]&r=[uncaching val] 18 | [GET] 19 | { 20 | "[zone id]": // grouped by zone key 21 | { 22 | "[date val]": // grouped by date key 23 | [ 24 | "[p1 val]", 25 | "[p2 val]", 26 | "[p3 val]" 27 | ], 28 | ... 29 | }, 30 | ... 31 | } 32 | 33 | 34 | [URL] /storeZones 35 | [POST] 36 | { 37 | "[zone id]": 38 | { 39 | "zone":"[zone name]", 40 | "price":"[price]", 41 | "schedule":[value of schedule prop], 42 | "shape":[value of shape prop] 43 | }, 44 | ... 45 | } 46 | 47 | 48 | [URL] /storeSchedule 49 | [POST] 50 | { 51 | "[zone id]": // grouped by zone key 52 | { 53 | "[date val]": // grouped by date key 54 | [ 55 | "[p1 val]", 56 | "[p2 val]", 57 | "[p3 val]" 58 | ], 59 | ... 60 | }, 61 | ... 62 | } 63 | 64 | 65 | [URL] /getOrders?from=[timestamp in seconds]&to=[timestamp in seconds]&r=[uncaching val] 66 | [GET] 67 | { 68 | "[zone id]": // grouped by zone key 69 | { 70 | "[date val]": // grouped by date key 71 | [ 72 | "[p1 val]", 73 | "[p2 val]", 74 | "[p3 val]" 75 | ], 76 | ... 77 | }, 78 | ... 79 | } 80 | 81 | 82 | [URL] /createOrder?date=[date val]&period=[period id]&r=[uncaching val] 83 | [GET] 84 | { 85 | "[zone id]": // grouped by zone key 86 | { 87 | "[date val]": // grouped by date key 88 | [ 89 | "[p1 val]", 90 | "[p2 val]", 91 | "[p3 val]" 92 | ], 93 | ... 94 | }, 95 | ... 96 | } 97 | 98 | 99 | [URL] /removeOrder?date=[date val]&period=[period id]&r=[uncaching val] 100 | [GET] 101 | { 102 | "[zone id]": // grouped by zone key 103 | { 104 | "[date val]": // grouped by date key 105 | [ 106 | "[p1 val]", 107 | "[p2 val]", 108 | "[p3 val]" 109 | ], 110 | ... 111 | }, 112 | ... 113 | } -------------------------------------------------------------------------------- /structure.txt: -------------------------------------------------------------------------------- 1 | [zone] 2 | zone varchar[32] : PK 3 | name varchar[255] 4 | price int 5 | schedule text 6 | shape text 7 | 8 | 9 | 10 | [schedule] 11 | id int : PK 12 | zone varchar[32] : Key 13 | date varchar[10] : Key 14 | p1 int 15 | p2 int 16 | p3 int 17 | 18 | 19 | [orders] 20 | id int : PK 21 | zone varchar[32] : Key 22 | date varchar[10] : Key 23 | p1 int 24 | p2 int 25 | p3 int -------------------------------------------------------------------------------- /www/contract.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | Управление зонами и расписанием доставки 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 488 | 489 | 490 | 491 |
492 |
493 |
Разметка зон
494 |
Шаблон расписания
495 |
Редактор расписания
496 |
497 |
498 |
499 |

500 |
501 |
показать редактируемую зону
502 |
503 |

504 |
505 |
добавить зону доставки
506 |
507 |
508 |
509 |
510 |
511 |
512 | 513 | 514 |
515 |
516 | 517 | 518 | -------------------------------------------------------------------------------- /www/css/baloon.css: -------------------------------------------------------------------------------- 1 | table.deliveryBaloon td 2 | { 3 | font-family: sans-serif; 4 | font-size: 10pt; 5 | } 6 | 7 | table.deliveryBaloon tr 8 | { 9 | background-color: #ffffff; 10 | } 11 | 12 | table.deliveryBaloon tr:hover 13 | { 14 | background-color: #ffffa0; 15 | } 16 | 17 | table.deliveryBaloon td 18 | { 19 | padding: 0; 20 | } 21 | 22 | table.deliveryBaloon td.dbDate 23 | { 24 | padding: 2pt; 25 | padding-left: 5pt; 26 | width: 50pt; 27 | font-weight: bolder; 28 | text-align: left; 29 | cursor: default; 30 | } 31 | 32 | table.deliveryBaloon td div 33 | { 34 | padding: 1pt; 35 | margin: 1pt; 36 | 37 | width: 50pt; 38 | 39 | border: 1pt solid #d3d3d3; 40 | text-align: center; 41 | vertical-align: middle; 42 | 43 | font-size: small; 44 | } 45 | 46 | table.deliveryBaloon td div.dbBusy 47 | { 48 | cursor: default; 49 | color: #e8e8e8; 50 | background-color: #ff8080; 51 | } 52 | 53 | table.deliveryBaloon td div.dbVacant 54 | { 55 | cursor: pointer; 56 | background-color: #60a060; 57 | color: #ffffff; 58 | } 59 | 60 | table.deliveryBaloon td div.dbVacant:hover 61 | { 62 | cursor: pointer; 63 | background-color: #00dd00; 64 | color: #ffffff; 65 | } -------------------------------------------------------------------------------- /www/css/editor.css: -------------------------------------------------------------------------------- 1 | /* look base */ 2 | 3 | #contract div, #contract div.frameSet td, #contract div.frameSet td input { 4 | font-family: sans-serif; 5 | font-size: 12pt; 6 | } 7 | 8 | #contract div.frameSet td.zonesEditor input, #contract div.frameSet td.tm input { 9 | border: 1pt solid #a0a0a0; 10 | } 11 | 12 | #contract div.frameSet td, #contract div.frameSet td.tm input { 13 | text-align: center; 14 | } 15 | 16 | #contract div.frameSet table thead { 17 | font-size: 14pt; 18 | } 19 | 20 | #contract div.frameSet table thead td.tm { 21 | font-size: 8pt; 22 | font-weight: lighter; 23 | } 24 | 25 | /* layout */ 26 | #contract div.action { 27 | background-color: #505050; 28 | 29 | margin: 0; 30 | padding: 1pt; 31 | padding-left: 5pt; 32 | text-align: left; 33 | 34 | position: fixed; 35 | left:0; 36 | right: 0; 37 | bottom: 0; 38 | height: 17pt; 39 | } 40 | 41 | #contract div.action input { 42 | text-align: center; 43 | 44 | font-weight: bolder; 45 | border-radius: 14pt; 46 | 47 | font-weight: bolder; 48 | border: 1pt solid #a0a0a0; 49 | background-color: #808080; 50 | color: #ffffff; 51 | 52 | cursor: pointer; 53 | } 54 | 55 | #contract div.action input:hover { 56 | background-color: #d0d0a0; 57 | color: #505050; 58 | } 59 | 60 | /* header look */ 61 | 62 | #contract div.frameSet table thead td { 63 | background-color: #606060; 64 | color: #ffffff; 65 | font-weight: bolder; 66 | text-align: center; 67 | vertical-align: middle; 68 | cursor: default; 69 | } 70 | 71 | #contract div.frameSet table thead td.wd1, #contract div.frameSet table thead td.wd2, #contract div.frameSet table thead td.wd3, #contract div.frameSet table thead td.wd4, #contract div.frameSet table thead td.wd5, #contract div.frameSet table thead td.wd6, #contract div.frameSet table thead td.wd7 { 72 | background-color: #00aa00; 73 | } 74 | 75 | #contract div.frameSet table thead td.wd6 { 76 | background-color: #0000aa; 77 | } 78 | 79 | #contract div.frameSet table thead td.wd7 { 80 | background-color: #aa0000; 81 | } 82 | 83 | /* body look */ 84 | 85 | #contract div.frameSet table td.zone { 86 | width: 200pt; 87 | text-align: left; 88 | padding-left: 5pt; 89 | } 90 | 91 | #contract div.frameSet table sup { 92 | font-size: x-small; 93 | font-weight: normal; 94 | font-style: italic; 95 | } 96 | 97 | #contract div.frameSet table tr.hl { 98 | background-color: #e0e0e0; 99 | } 100 | 101 | #contract div.frameSet table td.tm input { 102 | width: 25pt; 103 | text-align: center; 104 | margin: 1pt; 105 | background: none; 106 | } 107 | 108 | #contract div.frameSet table td.tm input.changed { 109 | background-color: #80ffbb; 110 | } 111 | 112 | #contract div.frameSet table tr td.tm input:focus { 113 | background-color: yellow; 114 | color: black; 115 | } 116 | 117 | #contract div.frameSet table tr td.tm input::selection { 118 | background-color: yellow; 119 | color: black; 120 | } 121 | 122 | #contract div.frameSet table tr td.tm input::-moz-selection { 123 | background-color: yellow; 124 | color: black; 125 | } 126 | 127 | #contract div.frameSet table tr td input:invalid { 128 | background-color: #ff5020; 129 | color: #ffffff; 130 | } 131 | 132 | #contract div.frameSet table tr.hl td.arrow { 133 | background-color: #a0a0a0; 134 | } 135 | 136 | #contract div.frameSet table thead td.arrow { 137 | background-color: #005050; 138 | border-bottom: 1pt solid black; 139 | padding: 2pt; 140 | 141 | cursor: pointer; 142 | } 143 | 144 | #contract div.frameSet table.contract thead td.arrow:hover { 145 | background-color: #00b0b0; 146 | } 147 | 148 | #contract div.frameSet table.contract tr:hover, #contract div.frameSet table tr.hl:focus { 149 | background-color: #ffffa0; 150 | } 151 | 152 | /* porebriks */ 153 | 154 | #contract div.frameSet table td.zone { 155 | border-right: 1pt solid black; 156 | } 157 | 158 | #contract div.frameSet table td.arrow { 159 | border-right: 1pt solid black; 160 | background-color: #b0b0b0; 161 | } 162 | 163 | #contract div.frameSet table td.weekday { 164 | border-right: 1pt solid black; 165 | } 166 | 167 | #contract div.frameSet table tbody td { 168 | padding: 0; 169 | } 170 | 171 | #contract div.frameSet table td.eod { 172 | border-right: 1pt solid black; 173 | } 174 | 175 | /* frames */ 176 | 177 | #contract div.tabHead { 178 | margin: 5pt 0 0 5pt; 179 | padding: 0; 180 | border: 0; 181 | } 182 | 183 | #contract div.tabHead div { 184 | display: inline; 185 | margin: 0 0 0 0; 186 | padding: 3pt 25pt 1pt 25pt; 187 | border: 1pt solid #505050; 188 | border-radius: 7pt 7pt 0 0; 189 | 190 | background-color: #505050; 191 | color: #ffffff; 192 | font-weight: bolder; 193 | font-size: 10pt; 194 | 195 | cursor: default; 196 | } 197 | 198 | #contract div.tabHead div.inactive { 199 | border-color: #a0a0a0; 200 | background-color: #d0d0d0; 201 | color: #808080; 202 | border-bottom: 0; 203 | 204 | cursor: pointer; 205 | } 206 | 207 | #contract div.tabHead div.inactive:hover { 208 | background-color: #d0d0a0; 209 | color: #505050; 210 | } 211 | 212 | body, #contract { 213 | background-color: #f0f0f0; 214 | padding: 0; 215 | margin: 0; 216 | } 217 | 218 | #contract div.frameSet { 219 | margin: 1pt 0 0 0; 220 | border: 7pt solid #505050; 221 | border-bottom: 1pt solid #505050; 222 | border-left: 0; 223 | border-right: 0; 224 | 225 | background-color: #ffffff; 226 | } 227 | 228 | #contract div.frame table { 229 | width: 100%; 230 | } -------------------------------------------------------------------------------- /www/css/viewer.css: -------------------------------------------------------------------------------- 1 | #map{ 2 | position: absolute; 3 | top:0; 4 | left:0; 5 | right:0; 6 | bottom:0; 7 | margin: 0; 8 | padding: 0; 9 | } -------------------------------------------------------------------------------- /www/css/zones.css: -------------------------------------------------------------------------------- 1 | #sf1 { 2 | border: 0; 3 | margin: 0; 4 | padding: 0; 5 | 6 | position: fixed; 7 | top: 27pt; 8 | left: 0; 9 | right: 0; 10 | bottom: 17pt; 11 | 12 | background-color: #606060; 13 | border-bottom: 2pt solid #505050; 14 | } 15 | 16 | #map { 17 | padding: 0; 18 | margin: 0; 19 | border: 0; 20 | 21 | position: absolute; 22 | left: 0; 23 | top: -15pt; 24 | bottom: 15pt; 25 | right: 310pt; 26 | } 27 | 28 | #sf1 .zonesEditor { 29 | padding: 0; 30 | margin: 0; 31 | border: 0; 32 | 33 | background-color: #606060; 34 | 35 | width: 300pt; 36 | vertical-align: top; 37 | } 38 | 39 | #sf1 div.zonesCaption { 40 | margin: 0; 41 | padding: 5pt; 42 | padding-top: 0; 43 | 44 | width: 300pt; 45 | vertical-align: middle; 46 | background-color: #505050; 47 | color: #ffffff; 48 | font-weight: bolder; 49 | font-size: 14pt; 50 | border-radius: 0 0 0pt 14pt; 51 | 52 | position: absolute; 53 | top: -2pt; 54 | right: 0; 55 | } 56 | 57 | #sf1 div.zonesFooter { 58 | margin: 0; 59 | padding: 5pt; 60 | padding-bottom: 0; 61 | width: 300pt; 62 | vertical-align: middle; 63 | background-color: #505050; 64 | color: #ffffff; 65 | font-weight: bolder; 66 | font-size: 14pt; 67 | border-radius: 14pt 0 0 0; 68 | 69 | position: absolute; 70 | bottom: 0; 71 | right: 0; 72 | } 73 | 74 | #sf1 div.zonesList { 75 | overflow-y: auto; 76 | position: absolute; 77 | bottom: 22pt; 78 | top: 22pt; 79 | right: 0; 80 | width: 310pt; 81 | } 82 | 83 | #sf1 .zonesCaption .zoneAction, #sf1 .zonesFooter .zoneAction { 84 | text-align: center; 85 | 86 | font-weight: bolder; 87 | border-radius: 14pt; 88 | 89 | font-weight: bolder; 90 | border: 1pt solid #a0a0a0; 91 | background-color: #808080; 92 | color: #ffffff; 93 | 94 | cursor: pointer; 95 | } 96 | 97 | #sf1 .zonesCaption .zoneAction:hover { 98 | background-color: #999900; 99 | color: #ffffff; 100 | } 101 | 102 | #sf1 .zonesFooter .zoneAdd:hover { 103 | background-color: #99cc00; 104 | color: #ffffff; 105 | } 106 | 107 | #sf1 .zonesList .zone .zoneAction { 108 | display: inline; 109 | padding: 1pt 4pt 1pt 4pt; 110 | width: 16pt; 111 | height: 16pt; 112 | 113 | font-size: 12pt; 114 | font-weight: bolder; 115 | 116 | border: 1pt solid #a0a0a0; 117 | background-color: #808080; 118 | color: #ffffff; 119 | 120 | cursor: pointer; 121 | } 122 | 123 | #sf1 .zonesList .active .zoneAction { 124 | border: 1pt solid #808080; 125 | background-color: #b0b0b0; 126 | } 127 | 128 | #sf1 .zonesList .zone .zoneAction:hover { 129 | background-color: #a0a0a0; 130 | color: #ffffff; 131 | } 132 | 133 | #sf1 .zonesList .zone .zoneRemove:hover { 134 | background-color: #cc0000; 135 | } 136 | 137 | #sf1 .zonesList .zone .zoneShow:hover { 138 | background-color: #cccc80; 139 | } 140 | 141 | #sf1 .zonesList div.zone { 142 | padding: 2pt; 143 | text-align: center; 144 | } 145 | 146 | #sf1 .zonesList div.zone:hover { 147 | background-color: #808040; 148 | } 149 | 150 | #sf1 .zonesList div.active { 151 | background-color: #cccccc; 152 | } 153 | 154 | #sf1 .zonesList div.active:hover { 155 | background-color: #cccccc; 156 | } 157 | 158 | #sf1 .zonesList .zone input{ 159 | font-family: sans-serif; 160 | font-size: 12pt; 161 | border: 1pt solid #a0a0a0; 162 | } 163 | 164 | #sf1 .zonesList .zone input:invalid { 165 | background-color: #ff5020; 166 | color: #ffffff; 167 | } 168 | 169 | #sf1 .zonesList .zone input.zoneName { 170 | width: 200pt; 171 | margin-left: 3pt; 172 | margin-right: 3pt; 173 | } 174 | 175 | #sf1 .zonesList .zone input.zonePrice { 176 | width: 30pt; 177 | margin-left: 0pt; 178 | margin-right: 3pt; 179 | } -------------------------------------------------------------------------------- /www/js/cache-manifest.txt: -------------------------------------------------------------------------------- 1 | CACHE MANIFEST 2 | contract.html 3 | maasdam.html 4 | css/baloon.css 5 | css/editor.css 6 | css/viewer.css 7 | css/zones.css 8 | js/jquery-1.7.2.js 9 | js/editor-lib.js 10 | js/tool-lib.js 11 | js/wrap-lib.js 12 | 13 | NETWORK: 14 | js/test-data.js -------------------------------------------------------------------------------- /www/js/editor-lib.js: -------------------------------------------------------------------------------- 1 | //////////////////////////////// 2 | // editor functions: 3 | 4 | $.contractEditor = { 5 | addHandlers : function(selector, updateHandler) { 6 | selector = $(selector).find('input'); 7 | 8 | selector.focus(function(evt) { 9 | var e = $(evt.target); 10 | e.select(); 11 | }); 12 | 13 | selector.keyup(function(evt) { 14 | var code = evt.which; 15 | 16 | if ((37 <= code && code <= 40) || code == 13) { 17 | var e = $(evt.target); 18 | 19 | // detect X 20 | var line = e.parent().parent().find('input'); 21 | for (var x = 0; x < line.length; x++) 22 | if (line.get(x).id == evt.target.id) break; 23 | 24 | if (code == 39 || code == 37) {// right 25 | if (code == 39) {// right 26 | x = x + 1; 27 | if (x >= line.length) x = 0; 28 | } else if (code == 37) {// left 29 | x = x - 1; 30 | if (x < 0) x = line.length - 1; 31 | } 32 | e = line.get(x); 33 | } else if (code == 38 || code == 40 || code == 13) { 34 | // detect Y 35 | var rowraw = e.parent().parent().parent().find('input'); 36 | var row = [], y, j; 37 | for (j = x; j < rowraw.length; j += line.length) { 38 | if (rowraw.get(j).id == evt.target.id) y = row.length; 39 | row[row.length] = rowraw.get(j); 40 | } 41 | 42 | if (code == 38) {// up 43 | y = y - 1; 44 | if (y < 0) y = row.length - 1; 45 | } else if (code == 40 || code == 13) {// down 46 | y = y + 1; 47 | if (y >= row.length) y = 0; 48 | } 49 | e = row[y]; 50 | } 51 | 52 | if (e) { 53 | $(e).focus(); 54 | e.select(); 55 | } 56 | } 57 | }); 58 | 59 | selector.change(function(evt) { 60 | var z = $.zTools.fromId(evt.target.id); 61 | var val = evt.target.value; 62 | 63 | if (!isNaN(val) && 0 <= val && val <= 99){ // simple validation 64 | updateHandler(z[0], z[1], z[2], val, evt.target.placeholder, evt.target); 65 | } 66 | }); 67 | }, 68 | 69 | constructHeader : function(weekDay, showControls) { 70 | var i, j, line, e = '', tn = $.contractEditor.timeName, tnl = tn.length; 71 | if (!weekDay) weekDay = $.contractEditor.weekDay; 72 | 73 | e += $.doWrap.td('zone', false, 2, 'зона'); 74 | 75 | if(showControls) 76 | e += $.doWrap.td('arrow leftArrow', false, 2, '◄', 'предыдущая неделя'); 77 | 78 | for (i = 1; i <= 7; i++) { 79 | e += $.doWrap.td('weekday wd' + i, tnl, false, weekDay[i - 1]); 80 | } 81 | 82 | if(showControls) 83 | e += $.doWrap.td('arrow rightArrow', false, 2, '▶', 'следующая неделя'); 84 | 85 | e = $.doWrap.tr(e); 86 | 87 | 88 | line = ''; 89 | for (i = 1; i <= 7; i++) { 90 | for (j = 0; j < tnl; j++) { 91 | line += $.doWrap.td('tm wd' + i + ' tm' + (j + 1) + (j == tnl - 1 ? ' eod' : ''), false, false, tn[j]); 92 | } 93 | } 94 | e += $.doWrap.tr(line); 95 | e = $.doWrap.thead(e); 96 | 97 | return e; 98 | }, 99 | 100 | weekDay : ['пн','вт','ср','чт','пт','сб','вс'], 101 | timeName : ['утро','день','вечер'] 102 | }; 103 | 104 | -------------------------------------------------------------------------------- /www/js/test-data.js: -------------------------------------------------------------------------------- 1 | var data_zones = { 2 | "63B22FEA266A4CCF8DFC05DFE3588D2D": 3 | { 4 | "zone":"Север", 5 | "price":"0", 6 | "schedule":[ 7 | ["9","7","12"], 8 | ["9","7","12"], 9 | ["9","7","12"], 10 | ["9","7","12"], 11 | ["9","7","12"], 12 | ["9","7","12"], 13 | ["0","0","0"] 14 | ],"shape":[ 15 | [ 16 | [55.75677667643334,37.61518478393545], 17 | [55.75841190177424,37.612499278783666], 18 | [55.760627812331684,37.61050041913975], 19 | [55.765349594742894,37.60444276332848], 20 | [55.766275947582976,37.60709033012379], 21 | [55.77170901991454,37.60483236312853], 22 | [55.77434937472694,37.603577995300164], 23 | [55.79085025563337,37.58973960876452], 24 | [55.79482991439723,37.58437881469718], 25 | [55.80215304901008,37.58288040161123], 26 | [55.82199762498579,37.57274456024157], 27 | [55.83400753280666,37.572736740112184], 28 | [55.85009837279483,37.56722793579087], 29 | [55.857551115545576,37.56067352294909], 30 | [55.862918334321286,37.54943162488034], 31 | [55.86425022373821,37.547930548892865], 32 | [55.867898714179184,37.54642947290541], 33 | [55.87187413643235,37.547978269541474], 34 | [55.876928817677005,37.54695598976671], 35 | [55.88356289527311,37.542851493693746], 36 | [55.899913971196696,37.54288224764153], 37 | [55.90386864660405,37.542600432783196], 38 | [55.90792000918017,37.543753416836104], 39 | [55.91081529639713,37.570091977715364], 40 | [55.91101347152394,37.578480464219915], 41 | [55.91025281609236,37.58770433664304], 42 | [55.90198132133556,37.61679508686049], 43 | [55.89797342015654,37.637897729873515], 44 | [55.896708610545026,37.65126390457139], 45 | [55.89552926197892,37.664949989318686], 46 | [55.89461950841136,37.694056344032106], 47 | [55.89399911124797,37.69827179908737], 48 | [55.892372437070414,37.705672740936095], 49 | [55.888925940592074,37.71223487853986], 50 | [55.885558123424936,37.71925735473618], 51 | [55.882488313095415,37.725062561035024], 52 | [55.869136885137486,37.710782522857045], 53 | [55.86582119079719,37.703368939757226], 54 | [55.85764418569983,37.68579519152627], 55 | [55.835295917108645,37.65648418188085], 56 | [55.81801856071968,37.63906089305866], 57 | [55.80609951081389,37.636743805408344], 58 | [55.79330641345161,37.63408339500417], 59 | [55.7916411410988,37.634771404266246], 60 | [55.78444128476166,37.63546077728259], 61 | [55.78087408392645,37.63306297302238], 62 | [55.77296461908745,37.632387237548755], 63 | [55.76623901600378,37.6317224121093], 64 | [55.75965729853856,37.625672073364214], 65 | [55.75841060896697,37.6177247619628], 66 | [55.75677667643334,37.61518478393545] 67 | ] 68 | ]}, 69 | "CFDEA0CAF81D4362BDF1FD94899A7770":{ 70 | "zone":"Северо-Запад", 71 | "price":"100", 72 | "schedule":[ 73 | ["9","7","12"], 74 | ["9","7","12"], 75 | ["9","7","12"], 76 | ["9","7","12"], 77 | ["9","7","12"], 78 | ["9","7","12"], 79 | ["0","0","0"] 80 | ], 81 | "shape":[ 82 | [ 83 | [55.832787929206184,37.39562988281245], 84 | [55.838357179995036,37.396706390380764], 85 | [55.84423228823777,37.39243812561022], 86 | [55.85238424940863,37.39545383453358], 87 | [55.86090075126866,37.398334980010894], 88 | [55.86921238463528,37.40904526710502], 89 | [55.87529769165643,37.4250434160232], 90 | [55.88181375804276,37.44643207788458], 91 | [55.88217683504485,37.459872990846556], 92 | [55.882937295759326,37.46934002935878], 93 | [55.88524718387814,37.47716345340004], 94 | [55.892383241685664,37.497897980362076], 95 | [55.89903718243815,37.51135514862823], 96 | [55.90568997727992,37.528245544433524], 97 | [55.907759811137254,37.54275817871088], 98 | [55.89850166461072,37.544175109863254], 99 | [55.88615425011007,37.542823638916005], 100 | [55.87322389931407,37.547297744750956], 101 | [55.86521264055003,37.54747486114497], 102 | [55.85966170575223,37.556489810943546], 103 | [55.85302368506163,37.565117158889734], 104 | [55.846227590706846,37.567370896339376], 105 | [55.83529460645101,37.57296096086499], 106 | [55.82673502315016,37.57300941109656], 107 | [55.81085629230662,37.57955676853654], 108 | [55.79904684609135,37.58489038378], 109 | [55.793527614134426,37.585840577632126], 110 | [55.790864419940284,37.590435547605125], 111 | [55.780246565472694,37.600801117308414], 112 | [55.77261433615617,37.60461061114443], 113 | [55.76642669047531,37.60664410409519], 114 | [55.765330860377574,37.60454854696983], 115 | [55.768602805694684,37.59829977586855], 116 | [55.77245505241981,37.592222666144316], 117 | [55.78515185757847,37.56722758173936], 118 | [55.80125184560688,37.530970323085704], 119 | [55.80559807887438,37.511327509880005], 120 | [55.81351581349343,37.47341517448419], 121 | [55.823935318528164,37.43604265213008], 122 | [55.832787929206184,37.39562988281245] 123 | ] 124 | ]}, 125 | "58ACC4F89BC44DB198734D8F5572C318":{ 126 | "zone":"Запад", 127 | "price":"200", 128 | "schedule":[ 129 | ["9","7","12"], 130 | ["9","7","12"], 131 | ["9","7","12"], 132 | ["9","7","12"], 133 | ["9","7","12"], 134 | ["9","7","12"], 135 | ["0","0","0"] 136 | ], 137 | "shape":[ 138 | [ 139 | [55.76568136748897,37.36953735351557], 140 | [55.78346829851024,37.369478797912535], 141 | [55.789255622057134,37.372853469848586], 142 | [55.80604866272052,37.388185882568315], 143 | [55.8324642671292,37.396706390380764], 144 | [55.823702933817984,37.4375850677489], 145 | [55.81203982424671,37.474687194824135], 146 | [55.807103213858035,37.504954147338715], 147 | [55.7998453919866,37.531444549560426], 148 | [55.77710274639101,37.5839103698729], 149 | [55.76420691322521,37.6048995971679], 150 | [55.75688094664367,37.6147648525237], 151 | [55.75181367335847,37.610856919288466], 152 | [55.75313574389031,37.601455821990804], 153 | [55.75213125392381,37.594922142028715], 154 | [55.75244575386314,37.573958358764564], 155 | [55.751525748085164,37.56979629516599], 156 | [55.741164948689,37.538669532537455], 157 | [55.73748456233727,37.52385060071939], 158 | [55.73302866466061,37.50004922389978], 159 | [55.728765424075924,37.47338915824883], 160 | [55.72411303809015,37.44959478378288], 161 | [55.720426726609595,37.431531791686936], 162 | [55.71731686924368,37.40982536315913], 163 | [55.713228481114854,37.38529525756827], 164 | [55.74662959655184,37.36883323669424], 165 | [55.76568136748897,37.36953735351557] 166 | ] 167 | ]}, 168 | "F2ECC4E9383F433AB3F12967B424BD35":{ 169 | "zone":"Юго-Запад", 170 | "price":"300", 171 | "schedule":[ 172 | ["9","7","12"], 173 | ["9","7","12"], 174 | ["9","7","12"], 175 | ["9","7","12"], 176 | ["9","7","12"], 177 | ["9","7","12"], 178 | ["0","0","0"] 179 | ], 180 | "shape":[ 181 | [ 182 | [55.710865787680376,37.38807678222655], 183 | [55.73327589044163,37.503182983398396], 184 | [55.740778435145494,37.534518432617176], 185 | [55.75242179651518,37.57284729003902], 186 | [55.751659376404206,37.58514526367184], 187 | [55.736559504638514,37.586487731933545], 188 | [55.73075401923448,37.61117614746089], 189 | [55.70715990387985,37.58346374511715], 190 | [55.694072707332715,37.57885070800777], 191 | [55.65090258270239,37.53372558593746], 192 | [55.61040534194568,37.49134704589842], 193 | [55.710865787680376,37.38807678222655] 194 | ] 195 | ]}, 196 | "08C9C659F4CD479588231767F402ED8C":{ 197 | "zone":"Юг", 198 | "price":"400", 199 | "schedule":[ 200 | ["9","7","12"], 201 | ["9","7","12"], 202 | ["9","7","12"], 203 | ["9","7","12"], 204 | ["9","7","12"], 205 | ["9","7","12"], 206 | ["0","0","0"] 207 | ], 208 | "shape":[ 209 | [ 210 | [55.609165562914924,37.49588012695312], 211 | [55.6879190718444,37.575280761718716], 212 | [55.7076350754075,37.581398010253864], 213 | [55.728340519938385,37.61260910034173], 214 | [55.73085209936144,37.639934468269296], 215 | [55.74111150976363,37.65764679908747], 216 | [55.72908743477364,37.67521867752071], 217 | [55.72130898462525,37.700749397277775], 218 | [55.715826660809974,37.71061210632319], 219 | [55.708736724864416,37.73033752441403], 220 | [55.67991462605847,37.73845214843748], 221 | [55.65314149240204,37.74007356643669], 222 | [55.62557294386158,37.75405460357663], 223 | [55.61703686952463,37.78338996887202], 224 | [55.59062759844223,37.728077545165974], 225 | [55.571228330596995,37.673757629394466], 226 | [55.57443774389244,37.59670349121089], 227 | [55.59330042499568,37.515379638671874], 228 | [55.609165562914924,37.49588012695312] 229 | ] 230 | ]}, 231 | "2C3D1686E6AE416B9A03DDD71B0D1CE6":{ 232 | "zone":"Юго-Восток", 233 | "price":"500", 234 | "schedule":[ 235 | ["9","7","12"], 236 | ["9","7","12"], 237 | ["9","7","12"], 238 | ["9","7","12"], 239 | ["9","7","12"], 240 | ["9","7","12"], 241 | ["0","0","0"] 242 | ], 243 | "shape":[ 244 | [ 245 | [55.735474568717024,37.66788482666011], 246 | [55.74102390113564,37.65836486816402], 247 | [55.73741474365365,37.68742218017576], 248 | [55.73599745316832,37.70092086791988], 249 | [55.7298645428606,37.72517967224114], 250 | [55.73106003210099,37.736622428894], 251 | [55.72758926960175,37.754360103607134], 252 | [55.72507873816958,37.76185564994808], 253 | [55.721304363201014,37.77143990993497], 254 | [55.71631629649017,37.79854801893229], 255 | [55.70706311944903,37.835612487792936], 256 | [55.70008360543737,37.82999130249019], 257 | [55.69193944426475,37.82889732360839], 258 | [55.67797423111518,37.83487346649167], 259 | [55.66264556787671,37.839234828948946], 260 | [55.65556129903895,37.838668928146326], 261 | [55.650077389903025,37.83598271846771], 262 | [55.61740064924613,37.78317138671874], 263 | [55.626633674362616,37.7542279422283], 264 | [55.65178605728864,37.74107734441756], 265 | [55.66247153631829,37.74086867809292], 266 | [55.690427990723556,37.737018117904675], 267 | [55.70985656993449,37.73000364303587], 268 | [55.71652663594192,37.709794883728], 269 | [55.72056286878342,37.70370964050288], 270 | [55.729021561346364,37.67711959838862], 271 | [55.735474568717024,37.66788482666011] 272 | ] 273 | ]}, 274 | "8D82679D38E24EC39DF022619329A26F":{ 275 | "zone":"Восток", 276 | "price":"600", 277 | "schedule":[ 278 | ["9","7","12"], 279 | ["9","7","12"], 280 | ["9","7","12"], 281 | ["9","7","12"], 282 | ["9","7","12"], 283 | ["9","7","12"], 284 | ["0","0","0"] 285 | ], 286 | "shape":[ 287 | [ 288 | [55.78232379093888,37.69912719726556], 289 | [55.787610125228134,37.69900207519528], 290 | [55.791993902875916,37.706149291992155], 291 | [55.79437902133705,37.704573059081994], 292 | [55.8033391392929,37.75792846679685], 293 | [55.808823952933906,37.77874603271482], 294 | [55.809826066719104,37.81284408569334], 295 | [55.81430799057026,37.83801574707029], 296 | [55.76401306667005,37.84320922851558], 297 | [55.736904177095404,37.84134277343747], 298 | [55.70841948498925,37.83638641357416], 299 | [55.716832368466264,37.80026916503902], 300 | [55.721231908016684,37.77362747192377], 301 | [55.72536912923094,37.760993270873925], 302 | [55.72782507018193,37.755019493102964], 303 | [55.73118407090291,37.73898633956905], 304 | [55.73053873334033,37.724789953231756], 305 | [55.73660878406867,37.69983897685996], 306 | [55.740353744831026,37.65840850830072], 307 | [55.74475521805831,37.64873546600333], 308 | [55.74725949544855,37.6470038509368], 309 | [55.74947315425361,37.64355562210073], 310 | [55.75433031893926,37.63709498763068], 311 | [55.75386277475073,37.63526921033842], 312 | [55.7569935107856,37.6316176557539], 313 | [55.757543486584225,37.636159181594664], 314 | [55.75922418987882,37.645928878784055], 315 | [55.7633769717594,37.65679519653311], 316 | [55.77081950019782,37.67281135559074], 317 | [55.7749272551919,37.685625953674204], 318 | [55.78232379093888,37.69912719726556] 319 | ] 320 | ]}, 321 | "33EA6B6C900944A1AD941DBEF92FD854":{ 322 | "zone":"Северо-Восток", 323 | "price":"700", 324 | "schedule":[ 325 | ["9","7","12"], 326 | ["9","7","12"], 327 | ["9","7","12"], 328 | ["9","7","12"], 329 | ["9","7","12"], 330 | ["9","7","12"], 331 | ["0","0","0"] 332 | ], 333 | "shape":[ 334 | [ 335 | [55.774777529735935,37.68539428710931], 336 | [55.77147073494271,37.673143768310446], 337 | [55.7632523684831,37.65718370974055], 338 | [55.761033743478656,37.65118001103389], 339 | [55.75930646528685,37.64535242319096], 340 | [55.757787700628135,37.63713047504414], 341 | [55.757624087695554,37.633586299419285], 342 | [55.75707327409925,37.631243753433075], 343 | [55.759467953009676,37.62590761184681], 344 | [55.76556341059755,37.63119983673084], 345 | [55.77262342309008,37.632171249389565], 346 | [55.783644224135784,37.63548736572261], 347 | [55.792508892608446,37.635705566406216], 348 | [55.82002258709131,37.639938545227025], 349 | [55.83737506155859,37.658591079711876], 350 | [55.8541975386545,37.68147659301756], 351 | [55.8617460314936,37.69337577819818], 352 | [55.86774869152751,37.70767822265618], 353 | [55.882391825334196,37.72566337585444], 354 | [55.855655299121935,37.777956085205], 355 | [55.8282239298828,37.831536254882785], 356 | [55.8217495038179,37.8371370697021], 357 | [55.814307429935724,37.83930465698238], 358 | [55.810299673015905,37.810017118453914], 359 | [55.80986841388174,37.78158788681023], 360 | [55.80098135816501,37.74498546600336], 361 | [55.79513486058352,37.71252219200125], 362 | [55.795477078323366,37.70409151077264], 363 | [55.792293190739635,37.70576957702627], 364 | [55.78853621440126,37.69831104278557], 365 | [55.78245725085157,37.6980622863769], 366 | [55.774777529735935,37.68539428710931] 367 | ] 368 | ]} 369 | }; 370 | 371 | var data_schedule = { 372 | "63B22FEA266A4CCF8DFC05DFE3588D2D":{"21.05.2012":["0","0","0"],"24.05.2012":["1","1","1"]}, 373 | "CFDEA0CAF81D4362BDF1FD94899A7770":{"21.05.2012":["0","0","0"],"24.05.2012":["1","1","1"]}, 374 | "58ACC4F89BC44DB198734D8F5572C318":{"21.05.2012":["0","0","0"],"24.05.2012":["1","1","1"]}, 375 | "F2ECC4E9383F433AB3F12967B424BD35":{"21.05.2012":["0","0","0"],"24.05.2012":["1","1","1"]} 376 | }; 377 | 378 | var data_orders = { 379 | "63B22FEA266A4CCF8DFC05DFE3588D2D":{"22.05.2012":["2","7","0"],"24.05.2012":["1","1","1"]}, 380 | "CFDEA0CAF81D4362BDF1FD94899A7770":{"22.05.2012":["2","7","0"],"24.05.2012":["1","1","1"]}, 381 | "58ACC4F89BC44DB198734D8F5572C318":{"22.05.2012":["2","7","0"],"24.05.2012":["1","1","1"]}, 382 | "F2ECC4E9383F433AB3F12967B424BD35":{"22.05.2012":["2","7","0"],"24.05.2012":["1","1","1"]} 383 | }; -------------------------------------------------------------------------------- /www/js/tool-lib.js: -------------------------------------------------------------------------------- 1 | $.zTools = { 2 | dayLng : 86400000, 3 | weekLng : 86400000 * 7, 4 | dayToWeekNbr : function(date) { 5 | if (!isNaN(date)) date = new Date(date); 6 | 7 | date = new Date(date.getTime() - (date.getDay() == 0 ? 6 : date.getDay() - 1) * $.zTools.dayLng); 8 | date = new Date(date.getFullYear(), 9 | date.getMonth(), date.getDate(), 0, 0, 0, 0).getTime(); 10 | 11 | return date / 100000; 12 | }, 13 | 14 | weekNbrToDay : function(week, toString) { 15 | var day = week * 100000; 16 | return toString ? $.zTools.dateToStr(day) : day; 17 | }, 18 | 19 | genUID : function() { 20 | var chars = '0123456789ABCDEF'.split(''); 21 | var uid = [], rnd = Math.random; 22 | 23 | for (var i = 0; i < 32; i++) { 24 | uid[i] = chars[(0 | rnd() * 16) & 0xf]; 25 | } 26 | 27 | return uid.join(''); 28 | }, 29 | 30 | uidToColor : function(uid, bright) { 31 | var baseBright = 255, steps = 256, s = parseInt(uid.substr(uid.length - 2), 16); 32 | 33 | var r, g, b; 34 | var i = Math.floor(6 * s / steps), f = 6 * (s - steps * i / 6) / steps, q = 1 - f; 35 | 36 | switch (i) { 37 | case 0: 38 | r = 1, g = f, b = 0; 39 | break; 40 | case 1: 41 | r = q, g = 1, b = 0; 42 | break; 43 | case 2: 44 | r = 0, g = 1, b = f; 45 | break; 46 | case 3: 47 | r = 0, g = q, b = 1; 48 | break; 49 | case 4: 50 | r = f, g = 0, b = 1; 51 | break; 52 | case 5: 53 | r = 1, g = 0, b = q; 54 | break; 55 | } 56 | 57 | if (bright) { 58 | var br = (3 * bright - (r + g + b)) / 3; 59 | r += br; 60 | g += br; 61 | b += br; 62 | r = r < 1 ? r : 1; 63 | g = g < 1 ? g : 1; 64 | b = b < 1 ? b : 1; 65 | r = r > 0 ? r : 0; 66 | g = g > 0 ? g : 0; 67 | b = b > 0 ? b : 0; 68 | } 69 | 70 | r = Math.round(r * baseBright); 71 | g = Math.round(g * baseBright); 72 | b = Math.round(b * baseBright); 73 | 74 | return "" 75 | + ("00" + r.toString(16)).slice(-2) 76 | + ("00" + g.toString(16)).slice(-2) 77 | + ("00" + b.toString(16)).slice(-2); 78 | }, 79 | 80 | numToStr : function(num, numOfDgts) { 81 | var n = '' + Math.round(num); 82 | while (n.length < numOfDgts) n = '0' + n; 83 | return n; 84 | }, 85 | dateToStr : function(date, showTime, showWeekDay) { 86 | if (!isNaN(date)) date = new Date(date); 87 | 88 | return (showWeekDay ? 89 | ['вс','пн','вт','ср','чт','пт','сб'][date.getDay()] + ', ' 90 | : '') + 91 | $.zTools.numToStr(date.getDate(), 2) + '.' + 92 | $.zTools.numToStr(date.getMonth() + 1, 2) + 93 | (showWeekDay ? '' : '.' + $.zTools.numToStr(date.getFullYear(), 4)) + 94 | (showTime ? ' ' + 95 | date.getHours() + ':' + 96 | $.zTools.numToStr(date.getMinutes(), 2) 97 | : ''); 98 | }, 99 | id : function(zoneCode, dateId, tmNumber) { 100 | return 'z' + zoneCode + 101 | 'z' + ('' + dateId).split('.').join('d') + 102 | 'z' + tmNumber; 103 | }, 104 | fromId : function(id) { 105 | var z = id.split('z'); 106 | return [ 107 | z[1], 108 | z[2].split('d').join('.'), 109 | z[3] 110 | ]; 111 | } 112 | }; -------------------------------------------------------------------------------- /www/js/wrap-lib.js: -------------------------------------------------------------------------------- 1 | $.doWrap = { 2 | table : function(id, s) { 3 | return '' + s + '
'; 4 | }, 5 | thead : function(s) { 6 | return '' + s + ''; 7 | }, 8 | tbody : function(s) { 9 | return '' + s + ''; 10 | }, 11 | tr : function(s, cls) { 12 | return '' + s + ''; 13 | }, 14 | zoneName : function(zone) { 15 | return zone.zone + (zone.price && zone.price > 0 ? ' ~' + zone.price + '' : ''); 16 | }, 17 | td : function(cls, colspan, rowspan, s, title) { 18 | return '' + s + ''; 24 | }, 25 | inputNumber : function(id, title, defaultVal, val) { 26 | return ''; 33 | }, 34 | zoneListItem : function(value, price, color) { 35 | return '
' + 36 | '' + 40 | '' + 44 | '
'; 45 | } 46 | }; -------------------------------------------------------------------------------- /www/maasdam.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | Просмотр расписания доставки 7 | 8 | 9 | 10 | 11 | 13 | 14 | 15 | 16 | 17 | 18 | 252 | 253 | 254 |
255 | 256 | --------------------------------------------------------------------------------