asusg_settings.php 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783
  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()->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. $tasksEntity = \app\models\entity\Tasktypes::find()->where(['main_task' => 0])->orderBy(['name' => SORT_ASC])->all();
  165. //$tasksEntity = \app\models\entity\Tasks::find()->all();
  166. $chatEntity = \app\models\entity\Chat::find()->where(['company_id' => $companyID])->orderBy(['date_massage' => SORT_ASC])->all();
  167. //$projectsLocotechEntity = getLocomotiveList();
  168. $projectsLocotechEntity = \app\models\entity\ProjectsLocotech::find()->where(["!=", "uuid" , ''])->all();
  169. $series = LocoSeries::GetAllNames();
  170. $subtasks=0;
  171. ?>
  172. <!-- HTML -->
  173. <div class="wrapper">
  174. <header class="main-header">
  175. <!-- Logo -->
  176. <a href="/asusg_plan.php" class="logo">
  177. <!-- mini logo for sidebar mini 50x50 pixels -->
  178. <span class="logo-mini"><b>A</b>LT</span>
  179. <!-- logo for regular state and mobile devices -->
  180. <span class="logo-lg"><b>АСУ</b>СГ</span>
  181. </a>
  182. <!-- Header Navbar: style can be found in header.less -->
  183. <nav class="navbar navbar-static-top">
  184. <!-- Sidebar toggle button-->
  185. <a href="#" class="sidebar-toggle" data-toggle="push-menu" role="button">
  186. <span class="sr-only">Toggle navigation</span>
  187. </a>
  188. <div class="navbar-custom-menu">
  189. <ul class="nav navbar-nav">
  190. <li class="dropdown messages-menu">
  191. <a id="new_massage_dropdown" href="#" data-toggle="control-sidebar" data-toggle="control-sidebar">
  192. <i class="fa fa-envelope-o"></i>
  193. <span id="new_massage_count" class="label label-success">0</span>
  194. </a>
  195. <ul class="dropdown-menu" style="width: 420px;">
  196. <div class="row">
  197. <div class="col-md-12">
  198. <div class="box box-primary direct-chat direct-chat-primary">
  199. <div class="box-header with-border">
  200. <h3 class="box-title">Чат компании</h3>
  201. <div class="box-tools pull-right">
  202. <span data-toggle="tooltip" title="3 New Messages" class="badge bg-light-blue">0</span>
  203. <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
  204. </button>
  205. <button type="button" class="btn btn-box-tool" data-toggle="tooltip" title="Contacts" data-widget="chat-pane-toggle">
  206. <i class="fa fa-comments"></i></button>
  207. <button type="button" class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i></button>
  208. </div>
  209. </div>
  210. <!-- /.box-header -->
  211. <div class="box-body">
  212. <!-- Conversations are loaded here -->
  213. <div id="scrollFieldChat" class="direct-chat-messages">
  214. <? foreach( $chatEntity as $msg ):?>
  215. <? if ( $id == $msg->acc_id ):?>
  216. <div id="<?php echo $msg->id;?>_msgId" class="direct-chat-msg right">
  217. <div class="direct-chat-info clearfix">
  218. <span class="direct-chat-name pull-right"><?php echo $msg->accounts->login;?></span>
  219. <span class="direct-chat-timestamp pull-left">
  220. <?php echo date("d M H:i",strtotime($msg->date_massage));?>
  221. </span>
  222. </div>
  223. <!-- /.direct-chat-info -->
  224. <i class="fa fa-3x fa-user direct-chat-img"></i><!-- /.direct-chat-img -->
  225. <div class="direct-chat-text">
  226. <? if ( null != $msg->file ):?>
  227. <a href="<?php echo "/uploads/chat/" . $msg->file ?> " target='_blank' style="color: #fff;">
  228. <?php echo $msg->file_name ?><br>
  229. <i class="fa fa-2x fa-file direct-chat-img" style="color: #fff;float: left;"></i>
  230. </a><br><br>
  231. <?php endif;?>
  232. <?php echo $msg->msg;?>
  233. </div>
  234. <!-- /.direct-chat-text -->
  235. </div>
  236. <? else:?>
  237. <!-- Message. Default to the left -->
  238. <div id="<?php echo $msg->id;?>_msgId" class="direct-chat-msg">
  239. <div class="direct-chat-info clearfix">
  240. <span class="direct-chat-name pull-left"><?php echo $msg->accounts->login;?></span>
  241. <span class="direct-chat-timestamp pull-right"><?php echo date("d M H:i",strtotime($msg->date_massage));?><!--23 Jan 2:00 pm--></span>
  242. </div>
  243. <!-- /.direct-chat-info -->
  244. <!-- /.direct-chat-img -->
  245. <i class="fa fa-3x fa-user direct-chat-img"></i>
  246. <div class="direct-chat-text">
  247. <? if ( null != $msg->file ):?>
  248. <a href="<?php echo "/uploads/chat/" . $msg->file ?> " target='_blank' style="color: #fff;">
  249. <?php echo $msg->file_name ?><br>
  250. <i class="fa fa-2x fa-file direct-chat-img" style="color: #fff;float: left;"></i>
  251. </a><br><br>
  252. <?php endif;?>
  253. <?php echo $msg->msg;?>
  254. </div>
  255. <!-- /.direct-chat-text -->
  256. </div>
  257. <!-- /.direct-chat-msg -->
  258. <? endif;?>
  259. <? endforeach;?>
  260. </div>
  261. <!--/.direct-chat-messages-->
  262. <!-- Contacts are loaded here -->
  263. <div class="direct-chat-contacts">
  264. <ul class="contacts-list">
  265. <li>
  266. <a href="#">
  267. <img class="contacts-list-img" src="../dist/img/user1-128x128.jpg" alt="User Image">
  268. <div class="contacts-list-info">
  269. <span class="contacts-list-name">
  270. Count Dracula
  271. <small class="contacts-list-date pull-right">2/28/2015</small>
  272. </span>
  273. <span class="contacts-list-msg">How have you been? I was...</span>
  274. </div>
  275. <!-- /.contacts-list-info -->
  276. </a>
  277. </li>
  278. <!-- End Contact Item -->
  279. </ul>
  280. <!-- /.contatcts-list -->
  281. </div>
  282. <!-- /.direct-chat-pane -->
  283. </div>
  284. <!-- /.box-body -->
  285. <div class="box-footer">
  286. <form id="chat_form" action="response.php" method="post" enctype="multipart/form-data">
  287. <div class="input-group">
  288. <input id="massage_field" type="text" name="message" placeholder="Сообщение ..." class="form-control">
  289. <span class="input-group-btn">
  290. <button id="massage_chat_send" type="submit" class="btn btn-primary btn-flat"><i class="fa fa-fw fa-send-o"></i></button>
  291. </span>
  292. <span class="input-group-btn">
  293. <div class="btn btn-default btn-file">
  294. <i class="fa fa-paperclip"></i>
  295. <input id="file_v" type="file" name="attachment" >
  296. </div>
  297. </span>
  298. </div>
  299. </form>
  300. </div>
  301. <!-- /.box-footer-->
  302. </div>
  303. </div>
  304. </div>
  305. <!-- /.content -->
  306. </ul>
  307. </li>
  308. </ul>
  309. </div>
  310. </nav>
  311. </header>
  312. <!-- Left side column. contains the logo and sidebar -->
  313. <aside class="main-sidebar">
  314. <!-- sidebar: style can be found in sidebar.less -->
  315. <section class="sidebar">
  316. <!-- Sidebar user panel -->
  317. <!-- search form -->
  318. <form action="#" method="get" class="sidebar-form">
  319. <div class="input-group">
  320. <input type="text" name="q" class="form-control" placeholder="Search...">
  321. <span class="input-group-btn">
  322. <button type="submit" name="search" id="search-btn" class="btn btn-flat"><i class="fa fa-search"></i>
  323. </button>
  324. </span>
  325. </div>
  326. </form>
  327. <!-- /.search form -->
  328. <!-- sidebar menu: : style can be found in sidebar.less -->
  329. <ul class="sidebar-menu" data-widget="tree">
  330. <li class="header">Главное меню</li>
  331. <li class="active treeview">
  332. <a href="#">
  333. <i class="fa fa-dashboard"></i> <span>Настройки</span>
  334. <span class="pull-right-container">
  335. <i class="fa fa-angle-left pull-right"></i>
  336. </span>
  337. </a>
  338. <ul class="treeview-menu">
  339. <li class="active"><a href="asusg_settings.php"><i class="fa fa-circle-o"></i>Соответствие работ</a></li>
  340. <li><a href="asusg_settings_employees.php"><i class="fa fa-circle-o"></i>Cоответствие сотрудников</a></li>
  341. </ul>
  342. </li>
  343. </ul>
  344. </section>
  345. <!-- /.sidebar -->
  346. </aside>
  347. <!-- Content Wrapper. Contains page content -->
  348. <div class="content-wrapper">
  349. <!-- Content Header (Page header) -->
  350. <section class="content-header">
  351. <h1>
  352. Страница настройки маппинга
  353. </h1>
  354. <ol class="breadcrumb">
  355. <li><a href="#"><i class="fa fa-dashboard"></i> Home</a></li>
  356. <li class="active">Dashboard</li>
  357. </ol>
  358. </section>
  359. <!-- Main content -->
  360. <section class="content">
  361. <div class="row">
  362. <div class="col-xs-12">
  363. <div class="box">
  364. <div class="box-header">
  365. <h3 class="box-title">Список работ</h3>
  366. </div>
  367. <!-- /.box-header -->
  368. <div class="box-body">
  369. <table id="example2" class="table table-bordered table-hover">
  370. <thead>
  371. <tr>
  372. <th style="width: 520px;">Работа АСУ СГ</th>
  373. <th style="width: 80px;">ИД работы АСУ СГ</th>
  374. <th>Задача SMoPP</th>
  375. </tr>
  376. </thead>
  377. <tbody>
  378. <? foreach($asusgJobplanEntity as $job):?>
  379. <tr>
  380. <td><?php echo "[". $job->smopp_jt_id."] " . $job->name?></td>
  381. <td><?php echo $job->asusg_id;?>
  382. </td>
  383. <td>
  384. <div class="row">
  385. <div class="col-xs-8">
  386. <select id="bindTaskType_<?php echo $job->asusg_id ?>" class="form-control select2 select2-hidden-accessible">
  387. <?php foreach( $tasksEntity as $type):?>
  388. <option <?php echo ($job->smopp_jt_id == $type->id)?'selected=selected':'';?> value="<?php echo $type->id;?>" ><?php echo "[".$type->id."] ".$type->name;?></option>
  389. <? endforeach;?>
  390. </select>
  391. </div>
  392. <div class="col-xs-3">
  393. <button type="button" data_id="<?php echo $job->asusg_id ?>" class="btn btn-block btn-primary bindTaskType">Привязать</button>
  394. </div>
  395. </div>
  396. </td>
  397. </tr>
  398. <? endforeach;?>
  399. </tbody>
  400. </table>
  401. </div>
  402. <!-- /.box-body -->
  403. </div>
  404. </div>
  405. <!-- /.box -->
  406. </div>
  407. </div>
  408. </section>
  409. </div>
  410. <!-- /.content-wrapper -->
  411. <footer class="main-footer">
  412. </footer>
  413. <aside class="control-sidebar" style="width: 420px; display:none">
  414. <!-- Create the tabs -->
  415. <!-- Tab panes -->
  416. <div class="tab-content">
  417. <div class="row">
  418. <div class="col-md-12">
  419. <div class="box box-primary direct-chat direct-chat-primary">
  420. <div class="box-header with-border">
  421. <h3 class="box-title">Чат компании</h3>
  422. <div class="box-tools pull-right">
  423. <span data-toggle="tooltip" title="3 New Messages" class="badge bg-light-blue">0</span>
  424. <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
  425. </button>
  426. <button type="button" class="btn btn-box-tool" data-toggle="tooltip" title="Contacts" data-widget="chat-pane-toggle">
  427. <i class="fa fa-comments"></i></button>
  428. <button type="button" class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i></button>
  429. </div>
  430. </div>
  431. <!-- /.box-header -->
  432. <div class="box-body">
  433. <!-- Conversations are loaded here -->
  434. <div id="scrollFieldChat" class="direct-chat-messages">
  435. <? foreach( $chatEntity as $msg ):?>
  436. <? if ( $id == $msg->acc_id ):?>
  437. <div id="<?php echo $msg->id;?>_msgId" class="direct-chat-msg right">
  438. <div class="direct-chat-info clearfix">
  439. <span class="direct-chat-name pull-right"><?php echo $msg->accounts->login;?></span>
  440. <span class="direct-chat-timestamp pull-left">
  441. <?php echo date("d M H:i",strtotime($msg->date_massage));?>
  442. </span>
  443. </div>
  444. <!-- /.direct-chat-info -->
  445. <i class="fa fa-3x fa-user direct-chat-img"></i><!-- /.direct-chat-img -->
  446. <div class="direct-chat-text">
  447. <? if ( null != $msg->file ):?>
  448. <a href="<?php echo "/uploads/chat/" . $msg->file ?> " target='_blank' style="color: #fff;">
  449. <?php echo $msg->file_name ?><br>
  450. <i class="fa fa-2x fa-file direct-chat-img" style="color: #fff;float: left;"></i>
  451. </a><br><br>
  452. <?php endif;?>
  453. <?php echo $msg->msg;?>
  454. </div>
  455. <!-- /.direct-chat-text -->
  456. </div>
  457. <? else:?>
  458. <!-- Message. Default to the left -->
  459. <div id="<?php echo $msg->id;?>_msgId" class="direct-chat-msg">
  460. <div class="direct-chat-info clearfix">
  461. <span class="direct-chat-name pull-left"><?php echo $msg->accounts->login;?></span>
  462. <span class="direct-chat-timestamp pull-right"><?php echo date("d M H:i",strtotime($msg->date_massage));?><!--23 Jan 2:00 pm--></span>
  463. </div>
  464. <!-- /.direct-chat-info -->
  465. <!-- /.direct-chat-img -->
  466. <i class="fa fa-3x fa-user direct-chat-img"></i>
  467. <div class="direct-chat-text">
  468. <? if ( null != $msg->file ):?>
  469. <a href="<?php echo "/uploads/chat/" . $msg->file ?> " target='_blank' style="color: #fff;">
  470. <?php echo $msg->file_name ?><br>
  471. <i class="fa fa-2x fa-file direct-chat-img" style="color: #fff;float: left;"></i>
  472. </a><br><br>
  473. <?php endif;?>
  474. <?php echo $msg->msg;?>
  475. </div>
  476. <!-- /.direct-chat-text -->
  477. </div>
  478. <!-- /.direct-chat-msg -->
  479. <? endif;?>
  480. <? endforeach;?>
  481. </div>
  482. <!--/.direct-chat-messages-->
  483. <!-- Contacts are loaded here -->
  484. <div class="direct-chat-contacts">
  485. <ul class="contacts-list">
  486. <li>
  487. <a href="#">
  488. <img class="contacts-list-img" src="../dist/img/user1-128x128.jpg" alt="User Image">
  489. <div class="contacts-list-info">
  490. <span class="contacts-list-name">
  491. Count Dracula
  492. <small class="contacts-list-date pull-right">2/28/2015</small>
  493. </span>
  494. <span class="contacts-list-msg">How have you been? I was...</span>
  495. </div>
  496. <!-- /.contacts-list-info -->
  497. </a>
  498. </li>
  499. <!-- End Contact Item -->
  500. </ul>
  501. <!-- /.contatcts-list -->
  502. </div>
  503. <!-- /.direct-chat-pane -->
  504. </div>
  505. <!-- /.box-body -->
  506. <div class="box-footer">
  507. <form id="chat_form" action="response.php" method="post" enctype="multipart/form-data">
  508. <div class="input-group">
  509. <input id="massage_field" type="text" name="message" placeholder="Сообщение ..." class="form-control">
  510. <span class="input-group-btn">
  511. <button id="massage_chat_send" type="submit" class="btn btn-primary btn-flat"><i class="fa fa-fw fa-send-o"></i></button>
  512. </span>
  513. <span class="input-group-btn">
  514. <div class="btn btn-default btn-file">
  515. <i class="fa fa-paperclip"></i>
  516. <input id="file_v" type="file" name="attachment" >
  517. </div>
  518. </span>
  519. </div>
  520. </form>
  521. </div>
  522. <!-- /.box-footer-->
  523. </div>
  524. </div>
  525. </div>
  526. <!-- /.content -->
  527. </div>
  528. </aside>
  529. <!-- Add the sidebar's background. This div must be placed
  530. immediately after the control sidebar -->
  531. <div class="control-sidebar-bg"></div>
  532. </div>
  533. <!-- HTML -->
  534. <!-- End Document
  535. –––––––––––––––––––––––––––––––––––––––––––––––––– -->
  536. <script src="/lte/bower_components/jquery/dist/jquery.min.js"></script>
  537. <!-- jQuery UI 1.11.4 -->
  538. <script src="/lte/bower_components/jquery-ui/jquery-ui.min.js"></script>
  539. <!-- Resolve conflict in jQuery UI tooltip with Bootstrap tooltip -->
  540. <script>
  541. $.widget.bridge('uibutton', $.ui.button);
  542. </script>
  543. <!-- Bootstrap 3.3.7 -->
  544. <script src="/lte/bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
  545. <!-- Morris.js charts -->
  546. <script src="/lte/bower_components/raphael/raphael.min.js"></script>
  547. <script src="/lte/bower_components/morris.js/morris.min.js"></script>
  548. <!-- Sparkline -->
  549. <script src="/lte/bower_components/jquery-sparkline/dist/jquery.sparkline.min.js"></script>
  550. <!-- jvectormap -->
  551. <script src="/lte/plugins/jvectormap/jquery-jvectormap-1.2.2.min.js"></script>
  552. <script src="/lte/plugins/jvectormap/jquery-jvectormap-world-mill-en.js"></script>
  553. <!-- jQuery Knob Chart -->
  554. <script src="/lte/bower_components/jquery-knob/dist/jquery.knob.min.js"></script>
  555. <!-- daterangepicker -->
  556. <script src="/lte/bower_components/moment/min/moment.min.js"></script>
  557. <script src="/lte/bower_components/bootstrap-daterangepicker/daterangepicker.js"></script>
  558. <!-- datepicker -->
  559. <script src="/lte/bower_components/bootstrap-datepicker/dist/js/bootstrap-datepicker.min.js"></script>
  560. <!-- Bootstrap WYSIHTML5 -->
  561. <script src="/lte/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.min.js"></script>
  562. <!-- Slimscroll -->
  563. <script src="/lte/bower_components/jquery-slimscroll/jquery.slimscroll.min.js"></script>
  564. <!-- FastClick -->
  565. <script src="/lte/bower_components/fastclick/lib/fastclick.js"></script>
  566. <!-- AdminLTE App -->
  567. <script src="/lte/dist/js/adminlte.min.js"></script>
  568. <!-- AdminLTE dashboard demo (This is only for demo purposes) -->
  569. <script src="/lte/dist/js/pages/dashboard.js"></script>
  570. <!-- AdminLTE for demo purposes -->
  571. <script src="/lte/dist/js/demo.js"></script>
  572. <script src="/loco.js"></script>
  573. <script src="/mail.js"></script>
  574. <script src="/lte/bower_components/select2/dist/js/select2.full.min.js"></script>
  575. </body>
  576. </html>
  577. <?php
  578. function GetEnterForm()
  579. {
  580. echo "<article>
  581. <form method='post' action='?login'>
  582. <table>
  583. <tr>
  584. <td width=70>
  585. <b>Login</b>
  586. </td>
  587. <td>
  588. &nbsp;
  589. </td>
  590. <td>
  591. <input type='text' name=login value=''><br/>
  592. </td>
  593. </tr>
  594. <tr>
  595. <td>
  596. <b>Password </b>
  597. </td>
  598. <td>
  599. &nbsp;
  600. </td>
  601. <td>
  602. <input type='password' name=pass value=''>
  603. </td>
  604. </tr>
  605. <tr>
  606. <td></td>
  607. <td>&nbsp;</td>
  608. <td>
  609. <input type='submit' value='Enter'>
  610. </td>
  611. </tr>
  612. </table>
  613. </form>
  614. </article>";
  615. }
  616. function getLocomotiveList(){
  617. $result = [];
  618. //var_dump($companyID);
  619. $projectsLocotechEntity = \app\models\entity\ProjectsLocotech::find()->where(['company' => 2] )->orderBy(['id' => SORT_DESC])->all();
  620. $listArray = [];
  621. foreach( $projectsLocotechEntity as $item){ //var_dump($item->projecttypes->name);echo "\n";
  622. //$tempArray = GetTasksForProject($item->id);
  623. $status = GetProjectStatus($item->id);
  624. if ($status != 2 && $status != 1) {continue;}
  625. $countDone = ['done' => 0, 'all' => 0 ];
  626. foreach( GetTasksForProject($item->id) as $proj) { //var_dump($proj);echo "<br>";
  627. $countDone['all']++;
  628. $tempArray = $proj;
  629. $tempArray['status'] = CheckAcceptedStatus($proj);
  630. $tempArray['name'] = GetTaskNameAndDesc($proj['type'])[0];
  631. //$tempArray['listAccounts'] = $this->getAccountListForTask($proj['type']);
  632. if ( 5 == $tempArray['status'] ) {$countDone['done']++;}
  633. //$countDone['all'] ." / " . $countDone['done'];
  634. $listArray[] = $tempArray;
  635. }
  636. $result[$item->id]['countDone'] = [ 'done' => $countDone['done'], 'all' => $countDone['all'] ];
  637. //$tempArray['name'] = GetTaskNameAndDesc($tempArray['type'])[0];
  638. $result[$item->id]['arr'] = $listArray;//GetTasksForProject($item->id);
  639. $result[$item->id]['obj'] = $item;
  640. $listArray = [];
  641. }
  642. //exit;
  643. return $result;
  644. }
  645. function CheckAcceptedStatus($task) {
  646. $result = false;
  647. $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
  648. from (select count(t.id) as total,
  649. sum(if(t.accepted_time is not null, 1, 0)) as accepted,
  650. sum(if(t.finished_time is not null, 1, 0)) as finished,
  651. sum(if(t.finished_time is null, if(timestampdiff(MINUTE, t.accepted_time, NOW()) > tt.time_to_complete_minutes, 1, 0), 0)) as attention
  652. from tasks t
  653. right join tasktypes tt on t.type = tt.id
  654. where t.parent_id = ".$task['id'].") tx;";
  655. $result = \Yii::$app->db->createCommand($query)->queryAll();
  656. $result = $result[0]["taskstatus"];
  657. return $result;
  658. }
  659. ?>