ьмрепргмепргмтепргщтбмепщргбмеп. Проектирование и создание информационной системы для торговой организации
Скачать 3.33 Mb.
|
79 Выход >Торговая база > [org_name]--> ( -[user_post]-->) Продажи: Задачи: 80 81 /* Вставляем в шаблон данные по ключевым словам, заранее прописанными в шаблоне */ $template = str_replace('',$value,$template); } } /* trim - очищает начало и конец переменной от лишних пробелов */ return trim($template); } /* ##################################### Преобразование unix_timestamp в понятный человеку формат */ function time2date($timestamp, $variant) { global $isys_lang; $month = & $isys_lang['time2date']['month']; $month2 = & $isys_lang['time2date']['month2']; $week = & $isys_lang['time2date']['week']; switch($variant) { //1 июля в 12:55 case 1: $d=date("j",$timestamp); $m=$month[date('n',$timestamp)]; $time=date("H:i",$timestamp); return $d.' '.$m.' в '.$time; break; //1 июля 2014 case 2: $d=date('j',$timestamp); $m=$month[date('n',$timestamp)]; $y=date('Y',$timestamp);return $d.' '.$m.' '.$y; break; 82 //1 июля 2014 в 12:55 case 3: $d=date('j',$timestamp); $m=$month[date('n',$timestamp)]; $y=date('Y',$timestamp); $time=date('H:i',$timestamp); return $d.' '.$m.' '.$y.' в '.$time; break; //1 июля case 4: $d=date('j',$timestamp); $m=$month[date('n',$timestamp)]; return $d.' '.$m; break; //Пятница, 1 июля case 5: $d=date('j',$timestamp); $m=$month[date('n',$timestamp)]; $w=$week[date('N',$timestamp)]; return $w.', '.$d.' '.$m; break; //Июль 2014 case 6: $m=$month2[date('n',$timestamp)]; $y=date('Y',$timestamp); return $m.' '.$y; break; //23:55 case 7: return date('H:i',$timestamp); break; //01.02.2017 case 8: return date('d.m.Y',$timestamp); break; //18 ноября 22:07 83 case 9: $d=date('j',$timestamp); $m=$month[date('n',$timestamp)]; $time=date('H:i',$timestamp); return $d.' '.$m.' '.$time; break; //18 ноября 22:07, Пятница case 10: $d=date('j',$timestamp); $m=$month[date('n',$timestamp)]; $time=date('H:i',$timestamp); return $d.' '.$m.' '.$time.', '.$week[date('N',$timestamp)]; break; //1 июля в 12:55 case 11: $d=date('j',$timestamp); $m=$month[date('n',$timestamp)]; $time=date('H:i',$timestamp); return $d.' '.$m.' в '.$time; break; default: return 'неизвестный формат времени'; } } /* ##################################### Логирование действий пользователей */ function user_log($action, $type, $info = null) { global $db; global $isys_user; $db->query("INSERT INTO `logs` SET `time`=unix_timestamp(now()), `user`=?i,`action`=?i, `type`=?i, `info`=?s",$isys_user['id'], $action, $type, $info); } 84 /* ##################################### Определяем, является ли строка email-адресом */ function is_email($str) { return preg_match("/[a-z\d]\w*@[a-z\d]\w*\.[a-z]{2,4}/i",$str); } /* ##################################### Суммы прописью */ function num2str($num) { $nul='ноль'; $ten=array( array('','один','два','три','четыре','пять','шесть','семь', 'восемь','девять'), array('','одна','две','три','четыре','пять','шесть','семь', 'восемь','девять'), ); $a20=array('десять','одиннадцать','двенадцать','тринадцать','четырнадцат ь' ,'пятнадцать','шестнадцать','семнадцать','восемнадцать','девятнадцать'); $tens=array(2=>'двадцать','тридцать','сорок','пятьдесят','шестьдесят','сем ьдесят' ,'восемьдесят','девяносто'); $hundred=array('','сто','двести','триста','четыреста','пятьсот','шестьсот', 'семьсот','восемьсот','девятьсот'); $unit=array( // Units array('копейка' ,'копейки' ,'копеек', 1), array('рубль' ,'рубля' ,'рублей' ,0), array('тысяча' ,'тысячи' ,'тысяч' ,1), array('миллион' ,'миллиона','миллионов' ,0), array('миллиард','милиарда','миллиардов',0), ); // 85 list($rub,$kop) = explode('.',sprintf("%015.2f", floatval($num))); $out = array(); if (intval($rub)>0) { foreach(str_split($rub,3) as $uk=>$v) { // by 3 symbols if (!intval($v)) continue; $uk = sizeof($unit)-$uk-1; // unit key $gender = $unit[$uk][3]; list($i1,$i2,$i3) = array_map('intval',str_split($v,1)); // mega-logic $out[] = $hundred[$i1]; # 1xx-9xx if ($i2>1) $out[]= $tens[$i2].' '.$ten[$gender][$i3]; # 20-99 else $out[]= $i2>0 ? $a20[$i3] : $ten[$gender][$i3]; # 10-19 | 1- 9 // units without rub & kop if ($uk>1) $out[]= morph($v,$unit[$uk][0],$unit[$uk][1],$unit[$uk][2]); } //foreach } else $out[] = $nul; $out[] = morph(intval($rub), $unit[1][0],$unit[1][1],$unit[1][2]); // rub $out[] = $kop.' '.morph($kop,$unit[0][0],$unit[0][1],$unit[0][2]); // kop return trim(preg_replace('/ {2,}/', ' ', join(' ',$out))); } /* ##################################### Склонение словоформы */ function morph($n, $f1, $f2, $f5) { $n = abs(intval($n)) % 100; if ($n>10 && $n<20) return $f5; $n = $n % 10; if ($n>1 && $n<5) return $f2; if ($n==1) return $f1; 86 return $f5; } /* ##################################### Конвертер строки в ссылку */ function str2url($string) { $string = mb_strtolower($string); $pattern = array( 'а' => 'a', 'б' => 'b', 'в' => 'v', 'г' => 'g', 'д' => 'd', 'е' => 'e', 'ё' => 'e', 'ж' => 'zh', 'з' => 'z', 'и' => 'i', 'й' => 'y', 'к' => 'k', 'л' => 'l', 'м' => 'm', 'н' => 'n', 'о' => 'o', 'п' => 'p', 'р' => 'r', 'с' => 's', 'т' => 't', 'у' => 'u', 'ф' => 'f', 'х' => 'h', 'ц' => 'c', 'ч' => 'ch', 'ш' => 'sh', 'щ' => 'sch', 'ь' => null, 'ы' => 'y', 'ъ' => null, 'э' => 'e', 'ю' => 'yu', 'я' => 'ya', '(' => null, ')' => null, '[' => null, ']' => null, '{' => null, '}' => null, '/' => null, '\\'=> null, '|' => null ); $string = strtr($string, $pattern); $string = preg_replace('[^-a-z0-9_]+u', '-', $string); $string = preg_replace('/(?:[^-a-z0-9_]|(?<=-)-+)/i', '', $string); $string = trim($string, "-"); return $string; } ?> «./assets/base.css» - файл содержащий CSS правила. 87 @charset "utf-8"; .cf:before,.cf:after {content:" ";display:table;}.cf:after {clear:both;}.cf {*zoom:1;} html {font:normal normal 16px 'Open Sans',sans-serif;} body {background:#f0f0f0;} .clear{clear:both;} a {transition:all linear 0.3s;color:#840000;} a:hover {color:#E42106 !important;} blockquote {font:italic normal 0.9rem 'Verdana',sans-serif;color:#333;} .bold {font-weight:600;color:#222;} .underline {text-decoration:underline;} .hidden {display:none !important;} input.placeholder,textarea.placeholder,select.placeholder {color:#808080 !important;} ::-webkit-input-placeholder{color:#808080;}::-moz-placeholder{color:#808080;}:- moz-placeholder{color:#808080;}:-ms-input-placeholder{color:#808080;} input[placeholder]{text-overflow:ellipsis;}input::-moz-placeholder{text- overflow:ellipsis;}input:-moz-placeholder{text-overflow:ellipsis;}input:-ms-input- placeholder {text-overflow:ellipsis;} :focus::-webkit-input-placeholder{color:#969696}:focus::-moz- placeholder{color:#969696}:focus:-moz-placeholder{color:#969696}:focus:-ms- input-placeholder{color:#969696;} ul.defUl-bull li {list-style:disc outside;} ul.defUl-num li {list-style:decimal outside;} ul.defUl-square li {list-style:square outside;} ul.defUl-circle li {list-style:circle outside;} ul.defUl-bull,ul.defUl-num,ul.defUl-square,ul.defUl-circle {margin-bottom:10px;} 88 ul.defUl-bull li,ul.defUl-num li,ul.defUl-square li,ul.defUl-circle li {margin- left:18px;} .defForm {width:500px;box-sizing:border-box;border: solid 1px #e6e6e6;padding:10px 20px 0;margin-bottom:10px;} .defFormSave {float:right;margin: 10px 0px -15px 0;background: #49CC3D;border: none;padding: 5px 20px;font-weight: 600;font-size: 0.95rem;transition: 0.2s;color: #fff;} .defFormSave:hover {cursor:pointer;background: #39BA2D;} .defInput {width:436px;border:solid 1px #f7f7f7;background-color:#f7f7f7;font- size: 0.95rem;padding: 3px 10px;margin-top:3px;} .defInput:focus {border-color:#000;background-color:#fff;} .defSelect {width:458px;border:solid 1px #f7f7f7;background-color:#f7f7f7;font- size: 0.95rem;padding: 3px 10px;margin-top:3px;} .defSelect:focus {border-color:#000;background-color:#fff;} .defTextarea {width:458px;border:solid 1px #000;font-size: 0.95rem;padding: 3px 10px;margin-top:3px;} .defRadio {font-size: 0.95rem;padding: 3px 10px;margin-top:3px;margin- right:2px;} .defInputWrap {margin-bottom:15px;} .defInputLabel {font-size:0.9rem;font-weight:600;margin-left:3px;} .defButton {margin: 20px 15px 15px 0;background: #fff;border: solid 2px #414aff;padding: 4px 20px;font-weight: 600;font-size:0.95rem;transition:0.2s;} .defButton:hover {cursor:pointer;background:#414aff;color:#fff;} .defTable {width:100%;box-sizing:border-box;} .defTable caption {font-size:1.05rem;font-weight:600;margin:15px 0 10px 0;color:#111;text-align:left;} .defTable td {padding:2px 10px;border:solid 1px #dadada;font-size:0.95rem;} 89 .defTable thead td {font-weight:600;border-bottom:solid 1px #b1b1b1;} .defTable tbody tr:nth-child(2n) {background:#f8f8f8;} .defTable tbody tr:hover {background:#ffe99b;} .width-wrapper {width:1200px;margin:0 auto;} header {height:84px;background-color:#fff;box-shadow:0 0 1px 1px #e6e6e6;margin-top:15px;} .header_top {height:44px;border-bottom:solid 1px #dad8d8;position:relative;} .header_title {float:left;padding:0 15px 0;font-weight: 600;margin-top:4px;} .header_title_is {font-size:0.85rem;} .header_title_org {font-size:0.8rem;} .header_user {float:left;margin: 12px 0 0 40px;font-size:0.8rem;} .header_info {margin:11px 40px 0 40px;font-size:0.9rem;float:left;} .header_menu {background:#fff;margin:9px 20px 0 0;right:0;position:absolute;transition:all ease-out 120ms;} .header_menu a {font-size:0.8rem;color:#7A0F04 !important;} .header_pages {font-size:0.95rem;} .header_pages a {color: #000 !important;} .header_pages li.current a {color: #C51B00 !important;} .header_pages li {display:inline-block;padding:0;margin:0;width:171px;} .header_pages li div {text-align:center;width:170px;box-sizing:border- box;padding:8px 0 9px;border-right:solid 1px #e6e4e4;} .header_pages li div:hover {background:#f7f7f7;} .header_pages li:last-child div {border-right:none;width:174px;} h1 {font-size:1.2rem;font-weight:normal;padding:0;margin:13px 0;text- align:center;text-shadow: 1px 1px #f6f6f6;} 90 .content {background:#fff;border-radius:2px;padding:20px;min-height:500px;box- shadow:0px 0px 1px 1px #ededed;} .content .wrap-h1 {font-size:1.25rem;font-weight:normal;border-bottom:1px solid #CACACA;color:#333;padding:0 0px 5px;margin:10px 0 0 0;} .content h2 {font:normal normal 1.25rem 'Roboto Condensed';margin:15px 0 10px 0;color:#111;} .content p {margin-bottom:9px;font-size:0.95rem;} .content img {max-width:100%;} .pgChpass-result {font-size:1rem;margin-top:20px;color:red;font-weight:600;} .pgGoods_aside {float:right;width:295px;padding-top:10px;font-size: 0.95rem;} .pgGoods_asideDelimiter {margin:15px 0;height: 1px;background: #f2f2f2;} .pgGoods_asideMenu li {margin-bottom:10px;} .pgGoods_asideMenu li a {background: #f3f3f3;padding: 1px 8px 2px;border- radius: 2px;} .pgGoods_asideNewGoods li {margin-bottom:3px;font-size:0.85rem;} .pgGoods_main {float:left;width:800px;min-height:400px;padding- right:50px;border-right:solid 1px #dedede;} .pgGoods_goodsTable {display:none;} .pgGoods_groupsTable a {color:#000 !important;} .pgGoods_groupsTable img, .pgGoods_goodsTable img {vertical- align:middle;margin:0 10px;} .pgGoods_groupsTable tr td:nth-child(2), .pgGoods_goodsTable tr td:nth-child(5) {width:80px;} .pgGoods_goodsTable tr td:nth-child(3) {word-break:keep-all;} .pgGoods_groupsTableNum {float: right;font-size: 0.9rem;color:666;} .pgGoodsEdit_form {margin:0 auto 10px;} 91 .pgGroupEdit_form {margin:0 auto 10px;} .pgBrands_table img, .pgGoods_goodsTable img {vertical-align:middle;margin:0 10px;} .pgBrands_table tr td:nth-child(2) {width:80px;} .pgBrand_form {float:right;width:500px;} .pgBrand_info {float:left;width:620px;display:none;} .pgBrand_delete {border-color:#ff4141;} .pgBrand_delete:hover {background-color:#ff4141;} .pgProviders_table img {vertical-align:middle;margin:0 10px;} .pgProviders_table tr td:nth-child(6) {width:80px;} .pgProvider_form {float:right;width:500px;} .pgProvider_info {float:left;display:none;width:620px;} .pgProvider_delete {border-color:#ff4141;} .pgProvider_delete:hover {background-color:#ff4141;} .pgProvider_add {float:right;margin-top:20px;color:#000;} .pgClients_tableAll img {vertical-align:middle;margin:0 10px;} .pgClients_tableAll tr td:nth-child(6) {width:115px;} .pgClients_favorites {width:100%;} .pgClients_favorites td {padding:3px 0;} .pgClient_right {float:right;width:500px;} .pgClient_left {float:left;width:620px;} .pgClient_delete {border-color:#ff4141;} 92 .pgClient_delete:hover {background-color:#ff4141;} .pgClients_aside {float:right;width:295px;padding-top:10px;font-size: 0.95rem;} .pgClients_asideDelimiter {margin:15px 0;height: 1px;background: #f2f2f2;} .pgClients_asideList {} .pgClients_asideList li {} .pgClients_asideList li a {background: #f3f3f3;padding: 1px 8px 2px;border- radius: 2px;} .pgClients_main {float:left;width:800px;min-height:400px;padding- right:50px;border-right:solid 1px #dedede;} .pgClients_tableActive img {vertical-align:middle;margin:0 10px;} .pgClients_tableActive tr td:nth-child(4) {width:115px;} .pgClients_tableNew {width:100%;} .pgClients_tableNew tr td:first-child {width:130px;} .pgOrders_tableAll img {vertical-align:middle;margin:0 10px;} .pgOrders_tableAll tr td:nth-child(1) {text-align:center;} .pgOrders_tableAll tr td:nth-child(7) {width:80px;} .pgOrders_aside {float:right;width:295px;padding-top:10px;font-size: 0.95rem;} .pgOrders_asideDelimiter {margin:15px 0;height: 1px;background: #f2f2f2;} .pgOrders_asideList {} .pgOrders_asideList li {} .pgOrders_asideList li a {background: #f3f3f3;padding: 1px 8px 2px;border- radius: 2px;} .pgOrders_main {float:left;width:800px;min-height:400px;padding- right:50px;border-right:solid 1px #dedede;} 93 .pgOrders_tableActive td {font-size:0.9rem;} .pgOrders_tableActive img {vertical-align:middle;margin:0 10px;} .pgOrders_tableActive tr td:nth-child(1) {text-align:center;} .pgOrders_tableActive tr td:nth-child(7) {width:80px;} .pgOrders_tableStat {width:100%;} .pgOrders_tableStat tr td:first-child {width:130px;} .pgOrders_tableStat td {border-bottom: solid 1px #ececec;padding: 2px 0px;} .pgOrders_tableStat tr:last-child td {border:none;} .pgOrder_right {float:right;width:350px;} .pgOrder_addTime {float:right;} .pgOrder_id {float:left;} .pgOrder_delimiter {margin:8px 0;height: 1px;background: #f2f2f2;} .pgOrder_marksForm {border:none;width:100%;padding:0;} .pgOrder_marks {min-height:130px;background:#f9f9f9;margin-top:5px;} .pgOrder_marks:focus {background:#fff;} .pgOrder_left {float:left;width:790px;} .pgOrder_table {margin: 0 0 40px 0;font-size:0.85rem;} .pgOrder_table table {width:100%;} .pgOrder_table td {padding: 8px 15px;border: solid 1px #dadada;} .pgOrder_table td:first-child {width:150px;} .pgOrder_table input[type="text"] {width:95%;padding: 2px 10px;margin-top: 3px;} .pgOrder_table select {padding: 3px 10px;margin-top: 3px;} .pgOrder_table input[type="submit"] {margin-top:-4px;margin-right:15px;} .pgOrder_delete {border-color:#ff4141;} 94 .pgOrder_delete:hover {background-color:#ff4141;} .pgLogs_aside {float:right;width:295px;padding-top:10px;font-size: 0.95rem;} .pgLogs_asideDelimiter {margin:5px 0 10px;height: 1px;background: #f2f2f2;} .pgLogs_asideMenu li {margin-bottom:10px;} .pgLogs_asideMenu li a {background: #f3f3f3;padding: 1px 8px 2px;border- radius: 2px;} .pgLogs_main {float:left;width:800px;min-height:400px;padding- right:50px;border-right:solid 1px #dedede;} .pgLogs_table {width:100%;} .pgLogs_table thead td {font-weight:600;} .pgLogs_table caption {font-size:1.05rem;font-weight:600;margin:15px 0 10px 0;color:#111;text-align:left;} .pgLogs_table td {padding:2px 10px;border:solid 1px #dadada;font-size:0.95rem;} .pgLogs_table tr td:nth-child(7) {width:80px;} .pgLogs_table tr:nth-child(2n) {background: #f8f8f8;} .pgLogs_table tbody tr:hover {background:#ffe99b;} .pgGroupEdit_delete, .pgGoodsEdit_delete {border-color:#ff4141;margin-top: 10px;} .pgGroupEdit_delete:hover, .pgGoodsEdit_delete:hover {background- color:#ff4141;} .pgGoodsEdit_delete, .pgGoodsEdit_delete {border-color:#ff4141;} .pgGoodsEdit_delete:hover, .pgGoodsEdit_delete:hover {background- color:#ff4141;} .pgMain_aside {float:right;width:295px;font-size: 0.95rem;} .pgMain_main {float:left;width:800px;min-height:400px;padding- right:50px;border-right:solid 1px #dedede;} 95 .pgMain_valutesRate {margin-bottom:60px;} .pgMain_valutesRate_now {text-align:center;margin:20px 0 0;} .pgMain_valutesRate_chart {} .pgMain_docs {padding-left:10px;line-height:1.6rem;margin-bottom:40px;} .pgMain_stat {margin-left:10px;} .pgMain_stat_block {border:solid 1px #ccc;padding:15px 10px 5px 10px;margin:25px 0 10px 0;font-size:0.9rem;} .pgMain_stat_block p {font-size:0.9rem;margin-bottom:0;} .pgMain_stat_title {position: absolute;margin:-25px 0 5px 5px;background:#fff;display:inline-block;padding:0 8px;} .pgMain_chat {} .pgMain_chat_msgs {font-size:0.85rem;height: 300px;overflow-y: scroll;border: solid 1px #ccc;padding: 5px 10px;} .pgMain_chat_msg {margin-bottom:10px;} .pgMain_chat_form {} .pgMain_chat_form input[type="text"] {font-size: 0.9rem;height: 29px;width: 500px;padding-left:10px;} .pgReports_table {margin-top:50px;} .pgReports_detailTable {display:none;width:100%;margin-bottom:40px;} .pgReports_detailForm select {width:110px;} .pgTasks_table {} .pgTasks_table tr.active a {font-weight: 600;} .pgTask_aside {float:right;width:375px;font-size: 0.95rem;} 96 .pgTask_aside p {margin-bottom:8px;padding-bottom:8px;border-bottom:solid 1px #D6D6D6;} .pgTask_main {float:left;width:730px;min-height:400px;padding- right:35px;border-right:solid 1px #dedede;} .pgTask_main h2 {border-bottom:solid 1px #ccc;padding-bottom:3px;margin- top:30px;} .pgTask_main h2:first-child {margin-top:0;} .pgTask_main h2:nth-of-type(3) {border-bottom:none;} .pgTask_asideList {margin-left:10px;} .pgTask_asideList li {margin-bottom:8px;} .pgTask_delete {display:none;margin-left: 100px;} .pgTask_chat {} .pgTask_chat_msgs {font-size:0.85rem;height: 300px;overflow-y: scroll;border: solid 1px #ccc;padding: 5px 10px;} .pgTask_chat_msg {margin-bottom:10px;} .pgTask_chat_form {} .pgTask_chat_form input[type="text"] {font-size: 0.9rem;height: 29px;width: 500px;padding-left:10px;} .pgTask_aside .defSelect {width:350px;} .pgTask_aside .defInput {width:330px;} .pgTask_checkBox {margin:5px 0;} .pgTask_checkBox {} .pgTask_save {margin:20px 0;float:left;} .pgTask_edit {display:none;margin:30px 0;color:#000;} .pgTask_add {float:right;margin-top:20px;color:#000;} .pgConfig_setWrap {float:left;vertical-align:top;} 97 .pgConfig_setWrap .defForm {margin-bottom:20px;padding-top:0;} .pgConfig_usersWrap {float:right;width:645px;padding-top:0;vertical-align:top;} .pgConfig_user {padding-bottom:25px;margin:35px 0;border-bottom:dashed 1px #ccc;} .pgConfig_user .defFormSave {font-size: 0.85rem;padding: 4px 10px;margin:10px 250px 0 0;} .pgConfig_newUserWrap {float:right;width:645px;padding-top:0;vertical- align:top;margin-top:10px;} .pgConfig_newUserWrap .defFormSave {font-size: 0.85rem;padding: 4px 10px;margin:10px 250px 20px 0;} .pgConfig_userTitle {margin-bottom:10px;} .pgConfig_userTitle img {vertical-align:middle;} .pgConfig_userInputs {margin-bottom:10px;font-size:0.9rem;} .pgConfig_userInputs input {width:130px;height:18px;border:solid 1px #f7f7f7;background-color:#f7f7f7;padding:2px 1px 3px 5px;} .pgConfig_userInputs select {width:120px;height:26px;border:solid 1px #f7f7f7;background-color:#f7f7f7;padding: 0px 3px 3px;} .pgConfig_userInputs input:focus, .pgConfig_userInputs select:focus {border- color:#000;background-color:#fff;} .pgConfig_viewLogs {float:right;color:#000;} footer {margin:10px 15px 30px;font-size:0.8rem;text-align:right;} footer a {color:#333 !important;} .ck-editor__editable { min-height: 200px; } /* modal windows*/ 98 @keyframes modalOpening {0% {opacity:0.5;box-shadow:0px 0px 4px rgba(19, 75, 171, 0.8);}100% {opacity:1;box-shadow:none;}} div#modalNotice {display:none;position:fixed;z- index:900;bottom:15%;left:2%;padding:20px 10px;width:300px;color:#fff;border- radius:2px;font-size:1.1rem;font-weight:400;text-align:center;} div#modalNotice.red {background:rgba(120, 15, 15, 0.8);} div#modalNotice.blue {background:rgba(15, 79, 120, 0.8);box-shadow:0px 0px 2px 0px rgba(0, 21, 57, 0.4);} |