asusg_gantt_old.php 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639
  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. require_once 'PHPExcel-1.8.2/Classes/PHPExcel.php';
  17. $url = explode('?',$_SERVER["REQUEST_URI"])[0];
  18. if (isset($_SESSION['LAST_ACTIVITY']) && (time() - $_SESSION['LAST_ACTIVITY'] > 6000)) {
  19. // last request was more than 30 minutes ago
  20. session_unset(); // unset $_SESSION variable for the run-time
  21. session_destroy(); // destroy session data in storage
  22. }
  23. $_SESSION['LAST_ACTIVITY'] = time(); // update last activity time stamp
  24. $add = 'Login Area';
  25. foreach (array_keys($_REQUEST) as $var) {
  26. ${$var} = $_REQUEST[$var];
  27. //if ($name == "Admin12") {
  28. // echo "<b>$var:</b> ${$var} <br>";
  29. //}
  30. }
  31. $arr1 = array(
  32. [1,2,3],
  33. [2,2,5],
  34. [1,2,3],
  35. [1,2,3],
  36. [1,2,3,4]
  37. );
  38. $arr2 = array(
  39. [5,6],
  40. [1,2,3],
  41. [2,2,5],
  42. [1,2,3],
  43. [1,2,3],
  44. [1,2,3,4]
  45. );
  46. function merge($arr1,$arr2){
  47. $arr3 = array_merge($arr1,$arr2);
  48. foreach( $arr3 as &$item){
  49. $item = json_encode($item);
  50. }
  51. $arr3 = array_unique($arr3);
  52. foreach( $arr3 as &$item){
  53. $item = json_decode($item);
  54. }
  55. return $arr3;
  56. }
  57. echo "<pre>";
  58. var_dump(merge($arr1,$arr2));
  59. echo "</pre>";
  60. //echo "<pre>";
  61. // var_dump($arr3);
  62. // echo "</pre>";
  63. exit;
  64. if ($act == "exit")
  65. {
  66. session_unset();
  67. session_destroy();
  68. session_start();
  69. }
  70. if ($_SESSION['cmdlevel'])
  71. $cmdlevel = $_SESSION['cmdlevel'];
  72. if ($_SESSION['hostid'])
  73. $agent_id = $_SESSION['hostid'];
  74. if ($_SESSION['add'])
  75. $add = $_SESSION['add'];
  76. if ($_SESSION['id'])
  77. $id = $_SESSION['id'];
  78. if ($_SESSION['login'])
  79. $login = $_SESSION['login'];
  80. if ($_SESSION['name'])
  81. $name = $_SESSION['name'];
  82. foreach (array_keys($_SESSION) as $var) {
  83. ${$var} = $_SESSION[$var];
  84. //if ($name == "Admin12") {
  85. //echo "from session: <b>$var:</b> ${$var} <br>";
  86. //}
  87. }
  88. include 'functions.php';
  89. include 'auth.php';
  90. $logged_me_in_successfully234 = 0;
  91. $incl = '';
  92. if (!$_SESSION['pass'] && !$_SESSION['login'])
  93. {
  94. $table = 'accounts';
  95. $result=mysqli_query($link, "SELECT id, login, name, cmdlevel FROM $table WHERE login='".$login."' AND password='".md5($pass)."'");
  96. $res1 = mysqli_fetch_array($result);
  97. $cmdlevel = $res1['cmdlevel'];
  98. $name = $res1['name'];
  99. $id = $res1['id'];
  100. if ($cmdlevel == '10')
  101. {
  102. $add = "Head Administrator";
  103. }
  104. else if ($cmdlevel == '1')
  105. {
  106. $add = "Company Administrator";
  107. }
  108. else if ($cmdlevel == '2')
  109. {
  110. $add = "Company Operator";
  111. }
  112. if (mysqli_num_rows($result))
  113. {
  114. $_SESSION['pass']=$pass;
  115. $_SESSION['login']=$login;
  116. $_SESSION['name']=$name;
  117. $_SESSION['add']=$add;
  118. $_SESSION['cmdlevel']=$cmdlevel;
  119. $_SESSION['id']=$id;
  120. $logged_me_in_successfully234 = 1;
  121. }
  122. }
  123. else
  124. $logged_me_in_successfully234 = 1;
  125. $query = mysqli_query($link, "update accounts set last_seen_web =NOW() where id=".$id);
  126. $getincl = GetInclude($act, intval($cmdlevel));
  127. $incl = $getincl[0];
  128. $accnum = $getincl[1];
  129. $project_id = \Yii::$app->request->get('project_id');
  130. $taskEntity = \app\models\entity\Tasks::find()->where(['input_id' => $project_id])->orderBy(['parent_id' => SORT_ASC,'priority'=> SORT_ASC])->all();
  131. $data = '{
  132. "data": [';
  133. //date("Y-m-d H:i:s");
  134. $currentTime = strtotime(date("Y-m-d H:i:s"));
  135. //echo "<pre>";
  136. $start_date = $currentTime;
  137. $tempArrayForTasks = [];
  138. $parent_id = '';
  139. $tempArrayForStartTime = [];
  140. $start_date_str = date ( "d-m-Y H:i",$currentTime );
  141. $progress = 0;
  142. $counter = 0;
  143. foreach ( $taskEntity as $task ) {
  144. $readonly = 'true';
  145. if ( (null != $task->created) and (null == $task->accepted_time) and (null == $task->finished_time) ) {
  146. $readonly = 'false';
  147. }
  148. if ( 0 == $task->parent_id) {
  149. $tempArrayForStartTime[$task->id] = 0;
  150. if ( null != $task->accepted_time && null == $task->finished_time){
  151. $start_date_str = date ( "d-m-Y H:i",strtotime($task->accepted_time) );
  152. }
  153. } else {
  154. $start_date = $currentTime + ($tempArrayForStartTime[$task->parent_id] * 60 );
  155. $start_date_str = date ( "d-m-Y H:i",$start_date );
  156. if ( null != $task->finished_time ){
  157. $start_date_str = date ( "d-m-Y H:i",strtotime($task->accepted_time) );
  158. }
  159. if ( null != $task->accepted_time && null == $task->finished_time){
  160. $start_date_str = date ( "d-m-Y H:i",strtotime($task->accepted_time) );
  161. }
  162. $tempArrayForStartTime[$task->parent_id] += $task->tasktypes->time_to_complete_minutes;
  163. }
  164. if ( 0 != $task->parent_id) {
  165. $parent_id = ', "parent": "'.$task->parent_id.'"';
  166. }
  167. switch ($task->status) {
  168. case 5:
  169. $progress = 1.0;
  170. break;
  171. case 1:
  172. $progress = 0.0;
  173. break;
  174. default:
  175. $progress = 0.5;
  176. break;
  177. }
  178. $start_finish_time = '';
  179. $duration = $task->tasktypes->time_to_complete_minutes;
  180. if ( null != $task->accepted_time ){
  181. $start_finish_time = '/' . date ('H:i' , strtotime($task->accepted_time));
  182. }
  183. if ( 'true' === $readonly ) {
  184. $start_finish_time = '/' . date ('H:i' , strtotime($task->accepted_time)). ' - ' . date ('H:i' , strtotime($task->finished_time));
  185. //$duration = (strtotime($task->finished_time) - strtotime($task->accepted_time)) / 60 ;
  186. //$duration = floor($duration);
  187. //$start_date_str = date ( "d-m-Y H:i",$task->accepted_time );
  188. }
  189. // ЕСЛИ ККОМАНДА ЗАВЕРШЕНА НАЧАЛО
  190. if ( null != $task->finished_time ){
  191. $duration_sec = strtotime($task->finished_time) - strtotime($task->accepted_time);
  192. $duration = floor($duration_sec/60);
  193. }
  194. // ЕСЛИ ККОМАНДА ЗАВЕРШЕНА КОНЕЦ
  195. // ЕСЛИ ККОМАНДА ВЫПОЛНЯЕТСЯ НО НЕ ЗАВЕРШЕНА НАЧАЛО
  196. if ( null != $task->accepted_time && null == $task->finished_time){
  197. $duration_sec = $currentTime - strtotime($task->accepted_time);
  198. $duration = floor($duration_sec/60);
  199. }
  200. // ЕСЛИ ККОМАНДА ВЫПОЛНЯЕТСЯ НО НЕ ЗАВЕРШЕНА КОНЕЦ
  201. if ( 0 == $task->parent_id) {
  202. $query = 'SELECT min(coalesce(accepted_time, NOW())) as time FROM tasks WHERE parent_id = ' . $task->id;
  203. $res = \Yii::$app->db->createCommand($query)->queryOne();
  204. $start_date_str = date ('d-m-Y H:i' , strtotime($res['time']));
  205. //var_dump($res);
  206. //var_dump(date("Y-m-d H:i:s").' -'. $task->accepted_time);echo "<br>";
  207. //if ( null != $task->accepted_time && null == $task->finished_time){
  208. // $start_date_str = date ( "d-m-Y H:i",strtotime($task->accepted_time) );
  209. //}
  210. }
  211. //var_dump($start_date_str);
  212. //var_dump($duration);echo "<br>";
  213. //if ( $counter == 182 ){ continue; }
  214. $tasktypesName = \app\models\HelperModel::stripWhitespaces($task->tasktypes->name);
  215. $text = \app\models\HelperModel::stripWhitespaces($task->text);
  216. $tempArrayForTasks[] = '{ "id": ' . $task->id . ', "calendar_id": "global", "text": "' . $tasktypesName . ':' . $text . ''.$start_finish_time.' ", "type": "project", "start_date": "' . $start_date_str . '", "duration": "' . $duration . '","progress": '.$progress.', "open": true, "readonly" : '.$readonly.$parent_id.' }';
  217. //var_dump($task->tasktypes->name);
  218. $counter++;
  219. }
  220. //if ( $counter == 182 ){ echo '{ "id": ' . $task->id . ', "calendar_id": "global", "text": "'.$task->tasktypes->name.':' .$task->text. ''.$start_finish_time.' ", "type": "project", "start_date": "' . $start_date_str . '", "duration": "' . $duration . '","progress": '.$progress.', "open": true, "readonly" : '.$readonly.$parent_id.' }'; exit; }
  221. $data .= implode(',', $tempArrayForTasks);
  222. $data .= '],
  223. "links": []
  224. }';
  225. // echo "<pre>";
  226. // var_dump($data);
  227. //echo "</pre>";
  228. /*
  229. $data = '{
  230. "data": [
  231. { "id": 11, "calendar_id": "global", "text": "Project #1", "type": "project", "start_date": "28-03-2018 02:15", "duration": "11", "progress": 0.6, "open": true },
  232. { "id": 1, "calendar_id": "", "text": "Project #2", "type": "project", "start_date": "01-04-2018", "duration": "18", "progress": 0.4, "open": true },
  233. { "id": 2, "calendar_id": "", "text": "Task #1", "start_date": "28-03-2018 02:20", "duration": "8", "parent": "1", "progress": 0.5, "open": true , "readonly" : true },
  234. { "id": 3, "calendar_id": "", "text": "Task #2", "type": "project", "start_date": "28-03-2018 02:20", "duration": "8", "parent": "1", "progress": 0.6, "open": true , "editable" : false},
  235. { "id": 4, "calendar_id": "", "text": "Task #3", "type": "project", "start_date": "28-03-2018 02:20", "duration": "6", "parent": "1", "progress": 0.5, "open": true , "editable" : true},
  236. { "id": 5, "calendar_id": "", "text": "Task #1.1", "start_date": "02-04-2018", "duration": "7", "parent": "2", "progress": 0.6, "open": true },
  237. { "id": 6, "calendar_id": "", "text": "Task #1.2", "start_date": "03-04-2018", "duration": "7", "parent": "2", "progress": 0.6, "open": true },
  238. { "id": 7, "calendar_id": "", "text": "Task #2.1", "start_date": "11-04-2018", "duration": "8", "parent": "3", "progress": 0.6, "open": true },
  239. { "id": 8, "calendar_id": "", "text": "Task #3.1", "start_date": "14-04-2018", "duration": "5", "parent": "4", "progress": 0.5, "open": true },
  240. { "id": 9, "calendar_id": "", "text": "Task #3.2", "start_date": "14-04-2018", "duration": "4", "parent": "4", "progress": 0.5, "open": true },
  241. { "id": 10, "calendar_id": "", "text": "Task #3.3", "start_date": "14-04-2018", "duration": "3", "parent": "4", "progress": 0.5, "open": true },
  242. { "id": 12, "calendar_id": "", "text": "Task #1", "start_date": "03-04-2018", "duration": "5", "parent": "11", "progress": 1, "open": true },
  243. { "id": 13, "calendar_id": "", "text": "Task #2", "type": "project", "start_date": "02-04-2018", "duration": "7", "parent": "11", "progress": 0.5, "open": true },
  244. { "id": 14, "calendar_id": "", "text": "Task #3", "start_date": "02-04-2018", "duration": "6", "parent": "11", "progress": 0.8, "open": true },
  245. { "id": 15, "calendar_id": "", "text": "Task #4", "type": "project", "start_date": "02-04-2018", "duration": "5", "parent": "11", "progress": 0.2, "open": true },
  246. { "id": 16, "calendar_id": "", "text": "Task #5", "start_date": "02-04-2018", "duration": "7", "parent": "11", "progress": 0, "open": true },
  247. { "id": 17, "calendar_id": "", "text": "Task #2.1", "start_date": "03-04-2018", "duration": "3", "parent": "13", "progress": 1, "open": true },
  248. { "id": 18, "calendar_id": "", "text": "Task #2.2", "start_date": "06-04-2018", "duration": "3", "parent": "13", "progress": 0.8, "open": true },
  249. { "id": 19, "calendar_id": "", "text": "Task #2.3", "start_date": "11-04-2018", "duration": "4", "parent": "13", "progress": 0.2, "open": true },
  250. { "id": 20, "calendar_id": "", "text": "Task #2.4", "start_date": "13-04-2018", "duration": "4", "parent": "13", "progress": 0, "open": true },
  251. { "id": 21, "calendar_id": "", "text": "Task #4.1", "start_date": "03-04-2018", "duration": "4", "parent": "15", "progress": 0.5, "open": true },
  252. { "id": 22, "calendar_id": "", "text": "Task #4.2", "start_date": "03-04-2018", "duration": "4", "parent": "15", "progress": 0.1, "open": true },
  253. { "id": 23, "calendar_id": "", "text": "Task #4.3", "start_date": "03-04-2018", "duration": "5", "parent": "15", "progress": 0, "open": true }
  254. ],
  255. "links": []
  256. }';
  257. */
  258. //exit;
  259. ?>
  260. <!DOCTYPE html>
  261. <head>
  262. <meta http-equiv="Content-type" content="text/html; charset=utf-8">
  263. <title>Project level calendars</title>
  264. <script src="/gantt_source/codebase/dhtmlxgantt.js?v=6.2.7"></script>
  265. <!-- Basic Page Needs
  266. –––––––––––––––––––––––––––––––––––––––––––––––––– -->
  267. <meta charset="utf-8">
  268. <title>ASUSG</title>
  269. <meta name="description" content="">
  270. <meta name="author" content="">
  271. <!-- Mobile Specific Metas
  272. –––––––––––––––––––––––––––––––––––––––––––––––––– -->
  273. <meta name="viewport" content="width=device-width, initial-scale=1">
  274. <!-- FONT
  275. –––––––––––––––––––––––––––––––––––––––––––––––––– -->
  276. <link rel="stylesheet" href="/lte/bower_components/bootstrap/dist/css/bootstrap.min.css">
  277. <!-- Font Awesome -->
  278. <link rel="stylesheet" href="/lte/bower_components/font-awesome/css/font-awesome.min.css">
  279. <!-- Ionicons -->
  280. <link rel="stylesheet" href="/lte/bower_components/Ionicons/css/ionicons.min.css">
  281. <!-- Theme style -->
  282. <link rel="stylesheet" href="/lte/dist/css/AdminLTE.min.css">
  283. <!-- AdminLTE Skins. Choose a skin from the css/skins
  284. folder instead of downloading all of them to reduce the load. -->
  285. <link rel="stylesheet" href="/lte/dist/css/skins/_all-skins.min.css">
  286. <!-- Morris chart -->
  287. <link rel="stylesheet" href="/lte/bower_components/morris.js/morris.css">
  288. <!-- jvectormap -->
  289. <link rel="stylesheet" href="/lte/bower_components/jvectormap/jquery-jvectormap.css">
  290. <!-- Date Picker -->
  291. <link rel="stylesheet" href="/lte/bower_components/bootstrap-datepicker/dist/css/bootstrap-datepicker.min.css">
  292. <!-- Daterange picker -->
  293. <link rel="stylesheet" href="/lte/bower_components/bootstrap-daterangepicker/daterangepicker.css">
  294. <!-- bootstrap wysihtml5 - text editor -->
  295. <link rel="stylesheet" href="/lte/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css">
  296. <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,300italic,400italic,600italic">
  297. <link rel="stylesheet" href="/lte/bower_components/select2/dist/css/select2.min.css">
  298. <link rel="stylesheet" href="/gantt_source/codebase/dhtmlxgantt.css?v=6.2.7">
  299. <style>
  300. html,
  301. body {
  302. height: 100%;
  303. padding: 0px;
  304. margin: 0px;
  305. overflow: hidden;
  306. }
  307. </style>
  308. <style>
  309. .gantt_task_cell.week_end {
  310. background-color: #e8e8e8;
  311. }
  312. .gantt_task_row.gantt_selected .gantt_task_cell.week_end {
  313. background-color: #e0e0dd;
  314. }
  315. </style>
  316. </head>
  317. <body>
  318. <?
  319. $mycompany = getCompanyByAccount($id);
  320. if (!isset($companyID))
  321. {
  322. if ($_SESSION['company'])
  323. $companyID = $_SESSION['company'];
  324. else
  325. {
  326. $companyID = $mycompany[0];
  327. $_SESSION['company'] = $companyID;
  328. }
  329. }
  330. else
  331. {
  332. $_SESSION['company'] = $companyID;
  333. }
  334. $companyname = getCompanyByID($companyID)[1];
  335. if ((int)$_POST['appMykey'] == 123465) {$logged_me_in_successfully234 = 1;}
  336. if ($logged_me_in_successfully234 == 0)
  337. {
  338. echo "<center>";
  339. GetEnterForm();
  340. echo("<font color='red'><b>Access denied. Incorrect login or password</b><font>");
  341. echo "</center>";
  342. return;
  343. }
  344. ?>
  345. <div class="wrapper">
  346. <header class="main-header">
  347. <!-- Logo -->
  348. <a href="/asusg_plan.php" class="logo">
  349. <!-- mini logo for sidebar mini 50x50 pixels -->
  350. <span class="logo-mini"><b>A</b>LT</span>
  351. <!-- logo for regular state and mobile devices -->
  352. <span class="logo-lg"><b>АСУ</b>СГ</span>
  353. </a>
  354. <!-- Header Navbar: style can be found in header.less -->
  355. <nav class="navbar navbar-static-top">
  356. <!-- Sidebar toggle button-->
  357. <a href="#" class="sidebar-toggle" data-toggle="push-menu" role="button">
  358. <span class="sr-only">Toggle navigation</span>
  359. </a>
  360. </nav>
  361. </header>
  362. <div id="gantt_here" style='width:100%; height:90%;'></div>
  363. <div class="box-body">
  364. <div class="row">
  365. <div class="col-xs-2">
  366. <div class="form-group">
  367. <button id="gantt_compl_edit" type="button" class="btn btn-block btn-primary" data_id="<?php echo \Yii::$app->request->get('project_id');?>">Сохранить</button><br>
  368. </div>
  369. </div>
  370. </div>
  371. </div>
  372. </div>
  373. <script>
  374. gantt.config.work_time = false;
  375. gantt.config.scale_unit = "day";
  376. gantt.config.date_scale = "%D, %d";
  377. gantt.config.min_column_width = 15;
  378. gantt.config.duration_unit = "minute";
  379. gantt.config.scale_height = 20 * 3;
  380. gantt.config.row_height = 25;
  381. gantt.config.inherit_calendar = true;
  382. //gantt.config.smart_scales = true;
  383. gantt.config.smart_rendering = false;
  384. gantt.config.order_branch = "marker";
  385. gantt.config.order_branch_free = true;
  386. var weekScaleTemplate = function (date) {
  387. var dateToStr = gantt.date.date_to_str("%d %M");
  388. var weekNum = gantt.date.date_to_str("(week %W)");
  389. var endDate = gantt.date.add(gantt.date.add(date, 1, "week"), -1, "day");
  390. return dateToStr(date) + " - " + dateToStr(endDate) + " " + weekNum(date);
  391. };
  392. gantt.config.subscales = [
  393. //{ unit: "month", step: 1, date: "%F, %Y" },
  394. //{ unit: "week", step: 1, template: weekScaleTemplate },
  395. {unit: "hour", step: 1, date: "%G"},
  396. {unit: "minute", step: 5, date: "%i"}
  397. ];
  398. gantt.addCalendar({
  399. id: "custom",
  400. worktime: {
  401. hours: [8, 17],
  402. days: [1, 1, 1, 1, 1, 1, 1]
  403. }
  404. });
  405. gantt.templates.timeline_cell_class = function (task, date) {
  406. if (!gantt.isWorkTime({ date: date, task: task }))
  407. return "week_end";
  408. return "";
  409. };
  410. gantt.templates.task_text = function (syart, end, task) {
  411. var calendar = gantt.getTaskCalendar(task);
  412. return task.text ;//+ ", <b>" + (calendar.id == "custom" ? "Full week" : "Workweek") + "</b> calendar";
  413. };
  414. gantt.locale.labels.section_calendar = "Calendar";
  415. gantt.config.lightbox.project_sections = gantt.config.lightbox.sections = [
  416. { name: "description", height: 38, map_to: "text", type: "textarea", focus: true },
  417. {
  418. name: "calendar", height: 22, map_to: "calendar_id", type: "select", options: [
  419. { key: "", label: "Default" },
  420. { key: "global", label: "Workweek" },
  421. { key: "custom", label: "Full week" }
  422. ]
  423. },
  424. { name: "time", type: "duration", map_to: "auto" }
  425. ];
  426. function updateTaskTiming(task) {
  427. task.start_date = gantt.getClosestWorkTime({
  428. dir: "future",
  429. date: task.start_date,
  430. unit: gantt.config.duration_unit,
  431. task: task
  432. });
  433. task.end_date = gantt.calculateEndDate(task);
  434. }
  435. var summaryCalendarChanged = false;
  436. gantt.attachEvent("onLightboxSave", function (id, task, is_new) {
  437. summaryCalendarChanged = false;
  438. if (gantt.isSummaryTask(task) && gantt.getTaskCalendar(task).id != gantt.getTaskCalendar(gantt.getTask(id)).id) {
  439. summaryCalendarChanged = id;
  440. }
  441. updateTaskTiming(task);
  442. gantt.eachTask(function (child) {
  443. updateTaskTiming(child);
  444. }, id);
  445. return true;
  446. });
  447. gantt.attachEvent("onAfterTaskMove", function (id, parent, tindex) {
  448. var task = gantt.getTask(id);
  449. updateTaskTiming(task);
  450. return true;
  451. });
  452. gantt.attachEvent("onAfterTaskUpdate", function (id, task) {
  453. if (summaryCalendarChanged == id) {
  454. summaryCalendarChanged = false;
  455. gantt.eachTask(function (child) {
  456. updateTaskTiming(child);
  457. gantt.updateTask(child.id)
  458. }, id)
  459. }
  460. });
  461. var det = <?php echo $data;?>;
  462. gantt.init("gantt_here");
  463. gantt.parse(det);
  464. </script>
  465. <script src="/lte/bower_components/jquery/dist/jquery.min.js"></script>
  466. <!-- jQuery UI 1.11.4 -->
  467. <script src="/lte/bower_components/jquery-ui/jquery-ui.min.js"></script>
  468. <!-- Resolve conflict in jQuery UI tooltip with Bootstrap tooltip -->
  469. <script>
  470. $.widget.bridge('uibutton', $.ui.button);
  471. </script>
  472. <!-- Bootstrap 3.3.7 -->
  473. <script src="/lte/bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
  474. <!-- Morris.js charts -->
  475. <script src="/lte/bower_components/raphael/raphael.min.js"></script>
  476. <script src="/lte/bower_components/morris.js/morris.min.js"></script>
  477. <!-- Sparkline -->
  478. <script src="/lte/bower_components/jquery-sparkline/dist/jquery.sparkline.min.js"></script>
  479. <!-- jvectormap -->
  480. <script src="/lte/plugins/jvectormap/jquery-jvectormap-1.2.2.min.js"></script>
  481. <script src="/lte/plugins/jvectormap/jquery-jvectormap-world-mill-en.js"></script>
  482. <!-- jQuery Knob Chart -->
  483. <script src="/lte/bower_components/jquery-knob/dist/jquery.knob.min.js"></script>
  484. <!-- daterangepicker -->
  485. <script src="/lte/bower_components/moment/min/moment.min.js"></script>
  486. <script src="/lte/bower_components/bootstrap-daterangepicker/daterangepicker.js"></script>
  487. <!-- datepicker -->
  488. <script src="/lte/bower_components/bootstrap-datepicker/dist/js/bootstrap-datepicker.min.js"></script>
  489. <!-- Bootstrap WYSIHTML5 -->
  490. <script src="/lte/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.min.js"></script>
  491. <!-- Slimscroll -->
  492. <script src="/lte/bower_components/jquery-slimscroll/jquery.slimscroll.min.js"></script>
  493. <!-- FastClick -->
  494. <script src="/lte/bower_components/fastclick/lib/fastclick.js"></script>
  495. <!-- AdminLTE App -->
  496. <script src="/lte/dist/js/adminlte.min.js"></script>
  497. <!-- AdminLTE dashboard demo (This is only for demo purposes) -->
  498. <script src="/lte/dist/js/pages/dashboard.js"></script>
  499. <!-- AdminLTE for demo purposes -->
  500. <script src="/lte/dist/js/demo.js"></script>
  501. <script src="/loco.js"></script>
  502. <script src="/mail.js"></script>
  503. <script src="/lte/bower_components/select2/dist/js/select2.full.min.js"></script>
  504. <script>
  505. $( function() {
  506. $( ".sortable" ).sortable();
  507. $( ".sortable" ).disableSelection();
  508. } );
  509. </script>
  510. </body>
  511. <?php
  512. function GetEnterForm()
  513. {
  514. echo "<article>
  515. <form method='post' action='?login'>
  516. <table>
  517. <tr>
  518. <td width=70>
  519. <b>Login</b>
  520. </td>
  521. <td>
  522. &nbsp;
  523. </td>
  524. <td>
  525. <input type='text' name=login value=''><br/>
  526. </td>
  527. </tr>
  528. <tr>
  529. <td>
  530. <b>Password </b>
  531. </td>
  532. <td>
  533. &nbsp;
  534. </td>
  535. <td>
  536. <input type='password' name=pass value=''>
  537. </td>
  538. </tr>
  539. <tr>
  540. <td></td>
  541. <td>&nbsp;</td>
  542. <td>
  543. <input type='submit' value='Enter'>
  544. </td>
  545. </tr>
  546. </table>
  547. </form>
  548. </article>";
  549. }
  550. ?>