asusg_plan.php 41 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887
  1. <?php
  2. defined('YII_DEBUG') or define('YII_DEBUG', true);
  3. defined('YII_ENV') or define('YII_ENV', 'dev');
  4. require __DIR__ . '/api/vendor/autoload.php';
  5. require __DIR__ . '/api/vendor/yiisoft/yii2/Yii.php';
  6. $config = require __DIR__ . '/api/config/web.php';
  7. (new yii\web\Application($config));
  8. require_once "doctrine/bootstrap.php";
  9. include 'CheckPoint.php';
  10. include 'CheckPointType.php';
  11. use CheckPoints\CheckPoint;
  12. use CheckPointTypes\CheckPointType;
  13. header("Expires: 0");
  14. header("Content-Type: text/html; charset=utf-8");
  15. session_start();
  16. if (isset($_SESSION['LAST_ACTIVITY']) && (time() - $_SESSION['LAST_ACTIVITY'] > 6000)) {
  17. // last request was more than 30 minutes ago
  18. session_unset(); // unset $_SESSION variable for the run-time
  19. session_destroy(); // destroy session data in storage
  20. }
  21. $_SESSION['LAST_ACTIVITY'] = time(); // update last activity time stamp
  22. $add = 'Login Area';
  23. foreach (array_keys($_REQUEST) as $var) {
  24. ${$var} = $_REQUEST[$var];
  25. //if ($name == "Admin12") {
  26. // echo "<b>$var:</b> ${$var} <br>";
  27. //}
  28. }
  29. if ($act == "exit")
  30. {
  31. session_unset();
  32. session_destroy();
  33. session_start();
  34. }
  35. if ($_SESSION['cmdlevel'])
  36. $cmdlevel = $_SESSION['cmdlevel'];
  37. if ($_SESSION['hostid'])
  38. $agent_id = $_SESSION['hostid'];
  39. if ($_SESSION['add'])
  40. $add = $_SESSION['add'];
  41. if ($_SESSION['id'])
  42. $id = $_SESSION['id'];
  43. if ($_SESSION['login'])
  44. $login = $_SESSION['login'];
  45. if ($_SESSION['name'])
  46. $name = $_SESSION['name'];
  47. foreach (array_keys($_SESSION) as $var) {
  48. ${$var} = $_SESSION[$var];
  49. //if ($name == "Admin12") {
  50. //echo "from session: <b>$var:</b> ${$var} <br>";
  51. //}
  52. }
  53. include 'functions.php';
  54. include 'auth.php';
  55. $logged_me_in_successfully234 = 0;
  56. $incl = '';
  57. if (!$_SESSION['pass'] && !$_SESSION['login'])
  58. {
  59. $table = 'accounts';
  60. $result=mysqli_query($link, "SELECT id, login, name, cmdlevel FROM $table WHERE login='".$login."' AND password='".md5($pass)."'");
  61. $res1 = mysqli_fetch_array($result);
  62. $cmdlevel = $res1['cmdlevel'];
  63. $name = $res1['name'];
  64. $id = $res1['id'];
  65. if ($cmdlevel == '10')
  66. {
  67. $add = "Head Administrator";
  68. }
  69. else if ($cmdlevel == '1')
  70. {
  71. $add = "Company Administrator";
  72. }
  73. else if ($cmdlevel == '2')
  74. {
  75. $add = "Company Operator";
  76. }
  77. if (mysqli_num_rows($result))
  78. {
  79. $_SESSION['pass']=$pass;
  80. $_SESSION['login']=$login;
  81. $_SESSION['name']=$name;
  82. $_SESSION['add']=$add;
  83. $_SESSION['cmdlevel']=$cmdlevel;
  84. $_SESSION['id']=$id;
  85. $logged_me_in_successfully234 = 1;
  86. }
  87. }
  88. else
  89. $logged_me_in_successfully234 = 1;
  90. $query = mysqli_query($link, "update accounts set last_seen_web =NOW() where id=".$id);
  91. $getincl = GetInclude($act, intval($cmdlevel));
  92. $incl = $getincl[0];
  93. $accnum = $getincl[1];
  94. ?>
  95. <!DOCTYPE html>
  96. <html lang="en">
  97. <head>
  98. <!-- Basic Page Needs
  99. –––––––––––––––––––––––––––––––––––––––––––––––––– -->
  100. <meta charset="utf-8">
  101. <title>ASUS</title>
  102. <meta name="description" content="">
  103. <meta name="author" content="">
  104. <!-- Mobile Specific Metas
  105. –––––––––––––––––––––––––––––––––––––––––––––––––– -->
  106. <meta name="viewport" content="width=device-width, initial-scale=1">
  107. <!-- FONT
  108. –––––––––––––––––––––––––––––––––––––––––––––––––– -->
  109. <link rel="stylesheet" href="/lte/bower_components/bootstrap/dist/css/bootstrap.min.css">
  110. <!-- Font Awesome -->
  111. <link rel="stylesheet" href="/lte/bower_components/font-awesome/css/font-awesome.min.css">
  112. <!-- Ionicons -->
  113. <link rel="stylesheet" href="/lte/bower_components/Ionicons/css/ionicons.min.css">
  114. <!-- Theme style -->
  115. <link rel="stylesheet" href="/lte/dist/css/AdminLTE.min.css">
  116. <!-- AdminLTE Skins. Choose a skin from the css/skins
  117. folder instead of downloading all of them to reduce the load. -->
  118. <link rel="stylesheet" href="/lte/dist/css/skins/_all-skins.min.css">
  119. <!-- Morris chart -->
  120. <link rel="stylesheet" href="/lte/bower_components/morris.js/morris.css">
  121. <!-- jvectormap -->
  122. <link rel="stylesheet" href="/lte/bower_components/jvectormap/jquery-jvectormap.css">
  123. <!-- Date Picker -->
  124. <link rel="stylesheet" href="/lte/bower_components/bootstrap-datepicker/dist/css/bootstrap-datepicker.min.css">
  125. <!-- Daterange picker -->
  126. <link rel="stylesheet" href="/lte/bower_components/bootstrap-daterangepicker/daterangepicker.css">
  127. <!-- bootstrap wysihtml5 - text editor -->
  128. <link rel="stylesheet" href="/lte/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css">
  129. <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,300italic,400italic,600italic">
  130. <link rel="stylesheet" href="/lte/bower_components/select2/dist/css/select2.min.css">
  131. </head>
  132. <body onload="accon(<? echo $accnum;?>)" >
  133. <!--<div style="min-width: 960px; height: 100%;">-->
  134. <?
  135. $mycompany = getCompanyByAccount($id);
  136. if (!isset($companyID))
  137. {
  138. // echo "ses com ".$_SESSION['company'];
  139. if ($_SESSION['company'])
  140. $companyID = $_SESSION['company'];
  141. else
  142. {
  143. $companyID = $mycompany[0];
  144. $_SESSION['company'] = $companyID;
  145. }
  146. }
  147. else
  148. {
  149. $_SESSION['company'] = $companyID;
  150. }
  151. $companyname = getCompanyByID($companyID)[1];
  152. if ((int)$_POST['appMykey'] == 123465) {$logged_me_in_successfully234 = 1;}
  153. if ($logged_me_in_successfully234 == 0)
  154. {
  155. echo "<center>";
  156. GetEnterForm();
  157. echo("<font color='red'><b>Access denied. Incorrect login or password</b><font>");
  158. echo "</center>";
  159. return;
  160. }
  161. $asusgTaskTemplatesEntity = \app\models\entity\AsusgTasktemplate::find()->orderBy(['id' => SORT_ASC])->all();
  162. $asusgEmployeeEntity = \app\models\entity\AsusgEmployee::find()->orderBy(['name' => SORT_ASC])->all();
  163. $asusgJobplanEntity = \app\models\entity\AsusgJobplan::find()->orderBy(['name' => SORT_ASC])->all();
  164. $asusgJob2CommandEntity = \app\models\entity\AsusgJob2Command::find()->orderBy(['cmd_order' => SORT_ASC])->all();
  165. $tasktypesEntity = \app\models\entity\Tasktypes::find()->where(['main_task' => 0,'company' => $companyID])->orderBy(['name' => SORT_ASC])->all();
  166. $locomotiveSeriesEntity = \app\models\entity\LocomotiveSeries::find()->orderBy(['name' => SORT_ASC])->all();
  167. //$projectsLocotechEntity = getLocomotiveList();
  168. $projectsLocotechEntity = \app\models\entity\ProjectsLocotech::find()->where(["!=", "uuid" , ''])->all();
  169. $series = LocoSeries::GetAllNames();
  170. ?>
  171. <!-- HTML -->
  172. <div class="wrapper">
  173. <header class="main-header">
  174. <!-- Logo -->
  175. <a href="/asusg_plan.php" class="logo">
  176. <!-- mini logo for sidebar mini 50x50 pixels -->
  177. <span class="logo-mini"><b>A</b>LT</span>
  178. <!-- logo for regular state and mobile devices -->
  179. <span class="logo-lg"><b>АСУ</b>СГ</span>
  180. </a>
  181. <!-- Header Navbar: style can be found in header.less -->
  182. <nav class="navbar navbar-static-top">
  183. <!-- Sidebar toggle button-->
  184. <a href="#" class="sidebar-toggle" data-toggle="push-menu" role="button">
  185. <span class="sr-only">Toggle navigation</span>
  186. </a>
  187. </nav>
  188. </header>
  189. <!-- Left side column. contains the logo and sidebar -->
  190. <aside class="main-sidebar">
  191. <!-- sidebar: style can be found in sidebar.less -->
  192. <section class="sidebar">
  193. <!-- Sidebar user panel -->
  194. <!-- search form -->
  195. <form action="#" method="get" class="sidebar-form">
  196. <div class="input-group">
  197. <input type="text" name="q" class="form-control" placeholder="Search...">
  198. <span class="input-group-btn">
  199. <button type="submit" name="search" id="search-btn" class="btn btn-flat"><i class="fa fa-search"></i>
  200. </button>
  201. </span>
  202. </div>
  203. </form>
  204. <!-- /.search form -->
  205. <!-- sidebar menu: : style can be found in sidebar.less -->
  206. <ul class="sidebar-menu" data-widget="tree">
  207. <li class="header">Главное меню</li>
  208. <li class="active treeview">
  209. <a href="#">
  210. <i class="fa fa-dashboard"></i> <span>Настройки</span>
  211. <span class="pull-right-container">
  212. <i class="fa fa-angle-left pull-right"></i>
  213. </span>
  214. </a>
  215. <ul class="treeview-menu">
  216. <li class="active"><a href="asusg_settings.php"><i class="fa fa-circle-o"></i>Соответствие работ</a></li>
  217. <li><a href="asusg_settings_employees.php"><i class="fa fa-circle-o"></i>Соответствие сотрудников</a></li>
  218. </ul>
  219. </li>
  220. </ul>
  221. </section>
  222. <!-- /.sidebar -->
  223. </aside>
  224. <!-- Content Wrapper. Contains page content -->
  225. <div class="content-wrapper">
  226. <!-- Content Header (Page header) -->
  227. <section class="content-header">
  228. <h1>
  229. Список задач
  230. </h1>
  231. <ol class="breadcrumb">
  232. <li><a href="#"><i class="fa fa-dashboard"></i> Home</a></li>
  233. <li class="active">Dashboard</li>
  234. </ol>
  235. </section>
  236. <!-- Main content -->
  237. <section class="content">
  238. <div class="row">
  239. <!-- START CUSTOM TABS -->
  240. <div class="col-md-12">
  241. <!-- Custom Tabs -->
  242. <div class="nav-tabs-custom">
  243. <ul class="nav nav-tabs">
  244. <li class="active"><a href="#tab_1" data-toggle="tab">Новый вариант</a></li>
  245. <li><a href="#tab_2" data-toggle="tab">Альтернативный вариант</a></li>
  246. <li class="pull-right"><a href="#" class="text-muted"><i class="fa fa-gear"></i></a></li>
  247. </ul>
  248. <div class="tab-content">
  249. <!-- НАЧАЛО ПЕРВОЙ ВКЛАДКИ -->
  250. <div class="tab-pane active" id="tab_1">
  251. <div class="row">
  252. <div class="col-xs-5">
  253. <? foreach( $asusgJobplanEntity as $template):?>
  254. <div class="box box-primary">
  255. <div class="box-header with-border">
  256. <h3 class="box-title"><?php echo $template->name?></h3>
  257. <div class="box-tools pull-right">
  258. <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
  259. </button>
  260. </div>
  261. </div>
  262. <div class="box-body">
  263. <div class="row">
  264. <div class="col-xs-5">
  265. <div class="form-group">
  266. <div class="form-group">
  267. <label for="exampleInputPassword1">Список команд</label>
  268. <select id="command_list_<?php echo $template->asusg_id?>" class="form-control select2" style="width: 100%;">
  269. <? foreach( $tasktypesEntity as $plan):?>
  270. <option data_id="<?php echo $plan->id?>_<?php echo $template->asusg_id;?>" value="<?php echo $plan->id?>"><?php echo $plan->name?></option>
  271. <? endforeach;?>
  272. </select>
  273. </div>
  274. </div>
  275. </div>
  276. <div class="col-xs-5 col-xs-offset-2">
  277. <div class="form-group">
  278. <label for="exampleInputPassword1">Привязать команду</label>
  279. <button type="button" class="btn btn-block btn-primary bindProjectTypes" data_id="<?php echo $template->asusg_id;?>">Привязать</button>
  280. <button type="button" class="btn btn-block btn-warning saveProjectTypes" data_id="<?php echo $template->asusg_id;?>">Сохранить</button>
  281. <button id="button_plan_<?php echo $template->asusg_id;?>" type="button" class="btn btn-block btn-danger startProjectType" data_id="<?php echo $template->asusg_id;?>" >Спланировать</button>
  282. </div>
  283. </div>
  284. <div id="project_list_<?php echo $template->asusg_id?>">
  285. <? $query = "select projecttype_id from asusg_task2project where asusg_tasktemplate_id = " . $template->asusg_id . " and project_id is null";
  286. $res = Yii::$app->db->createCommand($query)->queryAll();
  287. if( 0 < count($res) ) {
  288. echo "<div class='box-body'><ul class='list-unstyled'>";
  289. foreach($res as $item){
  290. echo "<li>";
  291. echo "Проект №" . $item['projecttype_id']. " привязан.";
  292. echo "</li>";
  293. }
  294. echo "</ul></div>";
  295. }
  296. ?>
  297. </div>
  298. <div class="col-xs-8">
  299. <ul id="sortable" class="list-unstyled list_asusg_command_<?php echo $template->asusg_id;?> sortable">
  300. <? foreach ($asusgJob2CommandEntity as $item):?>
  301. <? if ($item->asusg_job_id == $template->asusg_id):?>
  302. <li id="li_<?php echo $template->asusg_id;?>_<?php echo $item->smopp_cmd_id;?>" class="ui-state-default" data_id="<?php echo $template->asusg_id;?>_<?php echo $item->smopp_cmd_id;?>"><span class="ui-icon ui-icon-arrowthick-2-n-s"></span>
  303. <div class="box box-warning">
  304. <div class="box-header with-border">
  305. <h3 class="box-title"><?php echo $item->tasktypes->name;?></h3>
  306. <div class="box-tools pull-right">
  307. <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
  308. </button>
  309. <button type="button" class="btn btn-box-tool remove_command_button" data-widget="remove" data_id="<?php echo $template->asusg_id;?>_<?php echo $item->smopp_cmd_id;?>"><i class="fa fa-times"></i></button>
  310. </div>
  311. </div>
  312. </div>
  313. </li>
  314. <? endif;?>
  315. <? endforeach;?>
  316. </ul>
  317. </div>
  318. </div>
  319. </div>
  320. </div>
  321. <? endforeach;?>
  322. <div class="box">
  323. <!-- /.box-header -->
  324. <div class="box-body table-responsive ">
  325. <div class="form-group">
  326. <label>Укрупненные работы АСУ СГ</label>
  327. <select class="form-control select2" style="width: 100%;">
  328. <? foreach( $asusgTaskTemplatesEntity as $template):?>
  329. <option><?php echo $template->name?></option>
  330. <? endforeach;?>
  331. </select>
  332. </div>
  333. <div class="row">
  334. <div class="col-xs-3 col-xs-offset-9">
  335. <button type="button" class="btn btn-block btn-primary">Добавить</button>
  336. </div>
  337. </div>
  338. <div class="form-group">
  339. <label>Работы АСУ СГ</label>
  340. <select class="form-control select2" style="width: 100%;">
  341. <? foreach( $asusgJobplanEntity as $plan):?>
  342. <option><?php echo $plan->name?></option>
  343. <? endforeach;?>
  344. </select>
  345. </div>
  346. <div class="row">
  347. <div class="col-xs-3 col-xs-offset-9">
  348. <button type="button" class="btn btn-block btn-primary">Добавить</button>
  349. </div>
  350. </div>
  351. <div class="form-group">
  352. <label>Сотрудники</label>
  353. <select class="form-control select2" style="width: 100%;">
  354. <? foreach( $asusgEmployeeEntity as $employee):?>
  355. <option><?php echo $employee->name?></option>
  356. <? endforeach;?>
  357. </select>
  358. </div>
  359. <div class="row">
  360. <div class="col-xs-3 col-xs-offset-9">
  361. <button type="button" class="btn btn-block btn-primary">Добавить</button>
  362. </div>
  363. </div>
  364. </div>
  365. <!-- /.box-body -->
  366. </div>
  367. </div>
  368. <div class="col-xs-7">
  369. <div class="box">
  370. <div class="row">
  371. <div class="col-xs-5">
  372. <div class="form-group">
  373. <label for="exampleInputEmail1">Серия локомотива</label>
  374. <select id="loco_series_command" name="loco_series" class="form-control select2" style="width: 100%;">
  375. <? foreach( $locomotiveSeriesEntity as $loco):?>
  376. <option value="<?php echo $loco->name?>"><?php echo $loco->name;?></option>
  377. <? endforeach;?>
  378. </select>
  379. </div>
  380. </div>
  381. <div class="col-xs-5 col-xs-offset-2">
  382. <div id="error_number_input" class="form-group">
  383. <label for="exampleInputPassword1">Номер локомотива</label>
  384. <input type="text" class="form-control" id="loco_number_command" name="loco_number" pattern="[0-9]">
  385. <span id="loco_number_massage" class="help-block" style="display:none">Должно быть четыре цифры</span>
  386. </div>
  387. </div>
  388. </div>
  389. <!-- /.box-header -->
  390. <ul>
  391. <? foreach( $projectsLocotechEntity as $jobplan):?>
  392. <li>
  393. <?php echo $jobplan->id;?>
  394. <?php echo $jobplan->projecttypes->name;?> <br>
  395. <?php echo "<b>Серия:</b> " .$jobplan->loco_type;?> <?php echo "<b> Номер: </b>" .$jobplan->loco_number;?><br>
  396. <i><?php echo $jobplan->uuid;?></i>
  397. </li>
  398. <? endforeach;?>
  399. </ul>
  400. <!--
  401. <div class="box-body table-responsive ">
  402. <div class="row">
  403. <div class="col-md-6">
  404. <div class="form-group">
  405. <label>Проекты</label>
  406. <select id='projecttypes' class="form-control select2" style="width: 100%;">
  407. <option><Выберите проект></option>
  408. <?// foreach( $projectsLocotechEntity as $key => $jobplan):?>
  409. <? //var_dump($jobplan['obj']->projecttypes->name);?>
  410. <option value='<?php// echo $jobplan['obj']->id;?>'><?php //echo $jobplan['obj']->id .' '. $jobplan['obj']->projecttypes->name?></option>
  411. <? //endforeach;?>
  412. </select>
  413. </div>
  414. <div class="row">
  415. <div class="col-xs-5">
  416. <div class="form-group">
  417. <label for="exampleInputEmail1">Серия локомотива</label>
  418. <input type="text" class="form-control" id="loco_series" name="loco_series">
  419. </div>
  420. </div>
  421. <div class="col-xs-5 col-xs-offset-2">
  422. <div class="form-group">
  423. <label for="exampleInputPassword1">Номер локомотива</label>
  424. <input type="text" class="form-control" id="loco_number" name="loco_number">
  425. </div>
  426. </div>
  427. </div>
  428. <div class="form-group">
  429. <label for="exampleInputPassword1">8-ми знак</label>
  430. <input type="text" class="form-control" id="number" name="number">
  431. </div>
  432. </div>
  433. </div>
  434. </div>
  435. -->
  436. </div>
  437. <!-- /.box-body -->
  438. </div>
  439. </div>
  440. </div>
  441. <!-- КОНЕЦ ПЕРВОЙ ВКЛАДКИ -->
  442. <!-- НАЧАЛО ВТОРОЙ ВКЛАДКИ -->
  443. <div class="tab-pane" id="tab_2">
  444. <div class="row">
  445. <div class="col-xs-6">
  446. <div class="box">
  447. <!-- /.box-header -->
  448. <div class="box-body table-responsive ">
  449. <div class="form-group">
  450. <label>Работы АСУ СГ</label>
  451. <select class="form-control select2" style="width: 100%;">
  452. <? foreach( $asusgJobplanEntity as $plan):?>
  453. <option><?php echo $plan->name?></option>
  454. <? endforeach;?>
  455. </select>
  456. </div>
  457. <div class="form-group">
  458. <label>Сотрудники</label>
  459. <select class="form-control select2" style="width: 100%;">
  460. <? foreach( $asusgEmployeeEntity as $employee):?>
  461. <option><?php echo $employee->name?></option>
  462. <? endforeach;?>
  463. </select>
  464. </div>
  465. <div class="row">
  466. <div class="col-xs-3 col-xs-offset-9">
  467. <button type="button" class="btn btn-block btn-primary">Добавить</button>
  468. </div>
  469. </div>
  470. </div>
  471. <!-- /.box-body -->
  472. </div>
  473. </div>
  474. <div class="col-xs-5">
  475. <div class="row">
  476. <div class="col-xs-5">
  477. <div class="form-group">
  478. <label for="exampleInputEmail1">Серия локомотива</label>
  479. <input type="text" class="form-control" id="loco_series" name="loco_series">
  480. </div>
  481. </div>
  482. <div class="col-xs-5 col-xs-offset-2">
  483. <div class="form-group">
  484. <label for="exampleInputPassword1">Номер локомотива</label>
  485. <input type="text" class="form-control" id="loco_number" name="loco_number" pattern="[0-9]">
  486. </div>
  487. </div>
  488. <div class="col-xs-5">
  489. <div class="form-group">
  490. <label for="exampleInputPassword1">8-ми значный код</label>
  491. <input type="text" class="form-control" id="loco_number" name="loco_number" >
  492. </div>
  493. </div>
  494. </div>
  495. <div class="row">
  496. <div class="box">
  497. <div class="box-body table-responsive ">
  498. <ul id="sortable" class="list-unstyled">
  499. <li class="ui-state-default"><span class="ui-icon ui-icon-arrowthick-2-n-s"></span>
  500. <div class="box box-warning">
  501. <div class="box-header with-border">
  502. <h3 class="box-title">Item 1 </h3>
  503. <div class="box-tools pull-right">
  504. <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
  505. </button>
  506. </div>
  507. </div>
  508. <div class="box-body">
  509. The body of the box
  510. </div>
  511. </div>
  512. </li>
  513. <li class="ui-state-default"><span class="ui-icon ui-icon-arrowthick-2-n-s"></span>
  514. <div class="box box-warning">
  515. <div class="box-header with-border">
  516. <h3 class="box-title">Item 2 </h3>
  517. <div class="box-tools pull-right">
  518. <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
  519. </button>
  520. </div>
  521. </div>
  522. <div class="box-body">
  523. The body of the box
  524. </div>
  525. </div>
  526. </li>
  527. <li class="ui-state-default"><span class="ui-icon ui-icon-arrowthick-2-n-s"></span>
  528. <div class="box box-warning">
  529. <div class="box-header with-border">
  530. <h3 class="box-title">Item 3 </h3>
  531. <div class="box-tools pull-right">
  532. <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
  533. </button>
  534. </div>
  535. </div>
  536. <div class="box-body">
  537. The body of the box
  538. </div>
  539. </div>
  540. </li>
  541. <li class="ui-state-default"><span class="ui-icon ui-icon-arrowthick-2-n-s"></span>
  542. <div class="box box-warning">
  543. <div class="box-header with-border">
  544. <h3 class="box-title">Item 4 </h3>
  545. <div class="box-tools pull-right">
  546. <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
  547. </button>
  548. </div>
  549. </div>
  550. <div class="box-body">
  551. The body of the box
  552. </div>
  553. </div>
  554. </li>
  555. <li class="ui-state-default"><span class="ui-icon ui-icon-arrowthick-2-n-s"></span>
  556. <div class="box box-warning">
  557. <div class="box-header with-border">
  558. <h3 class="box-title">Item 5 </h3>
  559. <div class="box-tools pull-right">
  560. <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
  561. </button>
  562. </div>
  563. </div>
  564. <div class="box-body">
  565. The body of the box
  566. </div>
  567. </div>
  568. </li>
  569. </ul>
  570. <div class="row">
  571. <div class="col-xs-3 col-xs-offset-9">
  572. <button type="button" class="btn btn-block btn-primary">Отправить в SMOPP</button>
  573. </div>
  574. </div>
  575. </div>
  576. </div>
  577. </div>
  578. </div>
  579. </div>
  580. </div>
  581. <!-- КОНЕЦ ВТОРОЙ ВКЛАДКИ -->
  582. <!-- /.tab-pane -->
  583. </div>
  584. <!-- /.tab-content -->
  585. </div>
  586. <!-- nav-tabs-custom -->
  587. </div>
  588. <!-- /.row -->
  589. <!-- END CUSTOM TABS -->
  590. <!-- /.box -->
  591. </div>
  592. </div>
  593. </section>
  594. <!-- /.content -->
  595. </div>
  596. <!-- /.content-wrapper -->
  597. <footer class="main-footer">
  598. </footer>
  599. <!-- Add the sidebar's background. This div must be placed
  600. immediately after the control sidebar -->
  601. <div class="control-sidebar-bg"></div>
  602. </div>
  603. <!-- HTML -->
  604. <!-- End Document
  605. –––––––––––––––––––––––––––––––––––––––––––––––––– -->
  606. <script src="/lte/bower_components/jquery/dist/jquery.min.js"></script>
  607. <!-- jQuery UI 1.11.4 -->
  608. <script src="/lte/bower_components/jquery-ui/jquery-ui.min.js"></script>
  609. <!-- Resolve conflict in jQuery UI tooltip with Bootstrap tooltip -->
  610. <script>
  611. $.widget.bridge('uibutton', $.ui.button);
  612. </script>
  613. <!-- Bootstrap 3.3.7 -->
  614. <script src="/lte/bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
  615. <!-- Morris.js charts -->
  616. <script src="/lte/bower_components/raphael/raphael.min.js"></script>
  617. <script src="/lte/bower_components/morris.js/morris.min.js"></script>
  618. <!-- Sparkline -->
  619. <script src="/lte/bower_components/jquery-sparkline/dist/jquery.sparkline.min.js"></script>
  620. <!-- jvectormap -->
  621. <script src="/lte/plugins/jvectormap/jquery-jvectormap-1.2.2.min.js"></script>
  622. <script src="/lte/plugins/jvectormap/jquery-jvectormap-world-mill-en.js"></script>
  623. <!-- jQuery Knob Chart -->
  624. <script src="/lte/bower_components/jquery-knob/dist/jquery.knob.min.js"></script>
  625. <!-- daterangepicker -->
  626. <script src="/lte/bower_components/moment/min/moment.min.js"></script>
  627. <script src="/lte/bower_components/bootstrap-daterangepicker/daterangepicker.js"></script>
  628. <!-- datepicker -->
  629. <script src="/lte/bower_components/bootstrap-datepicker/dist/js/bootstrap-datepicker.min.js"></script>
  630. <!-- Bootstrap WYSIHTML5 -->
  631. <script src="/lte/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.min.js"></script>
  632. <!-- Slimscroll -->
  633. <script src="/lte/bower_components/jquery-slimscroll/jquery.slimscroll.min.js"></script>
  634. <!-- FastClick -->
  635. <script src="/lte/bower_components/fastclick/lib/fastclick.js"></script>
  636. <!-- AdminLTE App -->
  637. <script src="/lte/dist/js/adminlte.min.js"></script>
  638. <!-- AdminLTE dashboard demo (This is only for demo purposes) -->
  639. <script src="/lte/dist/js/pages/dashboard.js"></script>
  640. <!-- AdminLTE for demo purposes -->
  641. <script src="/lte/dist/js/demo.js"></script>
  642. <script src="/loco.js"></script>
  643. <script src="/mail.js"></script>
  644. <script src="/lte/bower_components/select2/dist/js/select2.full.min.js"></script>
  645. <script>
  646. $( function() {
  647. $( ".sortable" ).sortable();
  648. $( ".sortable" ).disableSelection();
  649. } );
  650. </script>
  651. </body>
  652. </html>
  653. <?php
  654. function GetEnterForm()
  655. {
  656. echo "<article>
  657. <form method='post' action='?login'>
  658. <table>
  659. <tr>
  660. <td width=70>
  661. <b>Login</b>
  662. </td>
  663. <td>
  664. &nbsp;
  665. </td>
  666. <td>
  667. <input type='text' name=login value=''><br/>
  668. </td>
  669. </tr>
  670. <tr>
  671. <td>
  672. <b>Password </b>
  673. </td>
  674. <td>
  675. &nbsp;
  676. </td>
  677. <td>
  678. <input type='password' name=pass value=''>
  679. </td>
  680. </tr>
  681. <tr>
  682. <td></td>
  683. <td>&nbsp;</td>
  684. <td>
  685. <input type='submit' value='Enter'>
  686. </td>
  687. </tr>
  688. </table>
  689. </form>
  690. </article>";
  691. }
  692. function getLocomotiveList(){
  693. $result = [];
  694. //var_dump($companyID);
  695. $projectsLocotechEntity = \app\models\entity\ProjectsLocotech::find()->where(['company' => 2] )->orderBy(['id' => SORT_DESC])->all();
  696. $listArray = [];
  697. foreach( $projectsLocotechEntity as $item){ //var_dump($item->projecttypes->name);echo "\n";
  698. //$tempArray = GetTasksForProject($item->id);
  699. $status = GetProjectStatus($item->id);
  700. if ($status != 2 && $status != 1) {continue;}
  701. $countDone = ['done' => 0, 'all' => 0 ];
  702. foreach( GetTasksForProject($item->id) as $proj) { //var_dump($proj);echo "<br>";
  703. $countDone['all']++;
  704. $tempArray = $proj;
  705. $tempArray['status'] = CheckAcceptedStatus($proj);
  706. $tempArray['name'] = GetTaskNameAndDesc($proj['type'])[0];
  707. //$tempArray['listAccounts'] = $this->getAccountListForTask($proj['type']);
  708. if ( 5 == $tempArray['status'] ) {$countDone['done']++;}
  709. //$countDone['all'] ." / " . $countDone['done'];
  710. $listArray[] = $tempArray;
  711. }
  712. $result[$item->id]['countDone'] = [ 'done' => $countDone['done'], 'all' => $countDone['all'] ];
  713. //$tempArray['name'] = GetTaskNameAndDesc($tempArray['type'])[0];
  714. $result[$item->id]['arr'] = $listArray;//GetTasksForProject($item->id);
  715. $result[$item->id]['obj'] = $item;
  716. $listArray = [];
  717. }
  718. //exit;
  719. return $result;
  720. }
  721. function CheckAcceptedStatus($task) {
  722. $result = false;
  723. $query = "select if(tx.total = tx.finished, 5, if (tx.accepted <> tx.finished, if(tx.attention > 0, 7, 2), if (tx.accepted = 0, 1, 3))) as taskstatus
  724. from (select count(t.id) as total,
  725. sum(if(t.accepted_time is not null, 1, 0)) as accepted,
  726. sum(if(t.finished_time is not null, 1, 0)) as finished,
  727. sum(if(t.finished_time is null, if(timestampdiff(MINUTE, t.accepted_time, NOW()) > tt.time_to_complete_minutes, 1, 0), 0)) as attention
  728. from tasks t
  729. right join tasktypes tt on t.type = tt.id
  730. where t.parent_id = ".$task['id'].") tx;";
  731. $result = \Yii::$app->db->createCommand($query)->queryAll();
  732. $result = $result[0]["taskstatus"];
  733. return $result;
  734. }
  735. ?>