123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834 |
- <?php
- defined('YII_DEBUG') or define('YII_DEBUG', true);
- defined('YII_ENV') or define('YII_ENV', 'dev');
- require __DIR__ . '/api/vendor/autoload.php';
- require __DIR__ . '/api/vendor/yiisoft/yii2/Yii.php';
- $config = require __DIR__ . '/api/config/web.php';
- (new yii\web\Application($config));
- require_once "doctrine/bootstrap.php";
- include 'CheckPoint.php';
- include 'CheckPointType.php';
- use CheckPoints\CheckPoint;
- use CheckPointTypes\CheckPointType;
- header("Expires: 0");
- header("Content-Type: text/html; charset=utf-8");
- session_start();
- if (isset($_SESSION['LAST_ACTIVITY']) && (time() - $_SESSION['LAST_ACTIVITY'] > 6000)) {
- // last request was more than 30 minutes ago
- session_unset(); // unset $_SESSION variable for the run-time
- session_destroy(); // destroy session data in storage
- }
- $_SESSION['LAST_ACTIVITY'] = time(); // update last activity time stamp
- $add = 'Login Area';
- foreach (array_keys($_REQUEST) as $var) {
- ${$var} = $_REQUEST[$var];
- //if ($name == "Admin12") {
- // echo "<b>$var:</b> ${$var} <br>";
- //}
- }
- if ($act == "exit")
- {
- session_unset();
- session_destroy();
- session_start();
- }
- if ($_SESSION['cmdlevel'])
- $cmdlevel = $_SESSION['cmdlevel'];
- if ($_SESSION['hostid'])
- $agent_id = $_SESSION['hostid'];
- if ($_SESSION['add'])
- $add = $_SESSION['add'];
- if ($_SESSION['id'])
- $id = $_SESSION['id'];
- if ($_SESSION['login'])
- $login = $_SESSION['login'];
- if ($_SESSION['name'])
- $name = $_SESSION['name'];
- foreach (array_keys($_SESSION) as $var) {
- ${$var} = $_SESSION[$var];
- //if ($name == "Admin12") {
- //echo "from session: <b>$var:</b> ${$var} <br>";
- //}
- }
- include 'functions.php';
- include 'auth.php';
- $logged_me_in_successfully234 = 0;
- $incl = '';
- if (!$_SESSION['pass'] && !$_SESSION['login'])
- {
- $table = 'accounts';
- $result=mysqli_query($link, "SELECT id, login, name, cmdlevel FROM $table WHERE login='".$login."' AND password='".md5($pass)."'");
- $res1 = mysqli_fetch_array($result);
- $cmdlevel = $res1['cmdlevel'];
- $name = $res1['name'];
- $id = $res1['id'];
- if ($cmdlevel == '10')
- {
- $add = "Head Administrator";
- }
- else if ($cmdlevel == '1')
- {
- $add = "Company Administrator";
- }
- else if ($cmdlevel == '2')
- {
- $add = "Company Operator";
- }
- if (mysqli_num_rows($result))
- {
- $_SESSION['pass']=$pass;
- $_SESSION['login']=$login;
- $_SESSION['name']=$name;
- $_SESSION['add']=$add;
- $_SESSION['cmdlevel']=$cmdlevel;
- $_SESSION['id']=$id;
- $logged_me_in_successfully234 = 1;
- }
- }
- else
- $logged_me_in_successfully234 = 1;
- $query = mysqli_query($link, "update accounts set last_seen_web =NOW() where id=".$id);
- $getincl = GetInclude($act, intval($cmdlevel));
- $incl = $getincl[0];
- $accnum = $getincl[1];
- $status_id = \Yii::$app->request->get('status');
- ?>
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <!-- Basic Page Needs
- –––––––––––––––––––––––––––––––––––––––––––––––––– -->
- <meta charset="utf-8">
- <title>ASUSG</title>
- <meta name="description" content="">
- <meta name="author" content="">
- <!-- Mobile Specific Metas
- –––––––––––––––––––––––––––––––––––––––––––––––––– -->
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <!-- FONT
- –––––––––––––––––––––––––––––––––––––––––––––––––– -->
-
-
- <link rel="stylesheet" href="/lte/bower_components/bootstrap/dist/css/bootstrap.min.css">
- <!-- Font Awesome -->
- <link rel="stylesheet" href="/lte/bower_components/font-awesome/css/font-awesome.min.css">
- <!-- Ionicons -->
- <link rel="stylesheet" href="/lte/bower_components/Ionicons/css/ionicons.min.css">
- <!-- Theme style -->
- <link rel="stylesheet" href="/lte/dist/css/AdminLTE.min.css">
- <!-- AdminLTE Skins. Choose a skin from the css/skins
- folder instead of downloading all of them to reduce the load. -->
- <link rel="stylesheet" href="/lte/dist/css/skins/_all-skins.min.css">
- <!-- Morris chart -->
- <link rel="stylesheet" href="/lte/bower_components/morris.js/morris.css">
- <!-- jvectormap -->
- <link rel="stylesheet" href="/lte/bower_components/jvectormap/jquery-jvectormap.css">
- <!-- Date Picker -->
- <link rel="stylesheet" href="/lte/bower_components/bootstrap-datepicker/dist/css/bootstrap-datepicker.min.css">
- <!-- Daterange picker -->
- <link rel="stylesheet" href="/lte/bower_components/bootstrap-daterangepicker/daterangepicker.css">
- <!-- bootstrap wysihtml5 - text editor -->
- <link rel="stylesheet" href="/lte/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css">
- <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,300italic,400italic,600italic">
- <link rel="stylesheet" href="/lte/bower_components/select2/dist/css/select2.min.css">
-
- </head>
- <body onload="accon(<? echo $accnum;?>)" >
- <!--<div style="min-width: 960px; height: 100%;">-->
- <?
- $post = \Yii::$app->request->post();
- $get_id = \Yii::$app->request->get('id');
- $mycompany = getCompanyByAccount($id);
- if (!isset($companyID))
- {
- // echo "ses com ".$_SESSION['company'];
- if ($_SESSION['company'])
- $companyID = $_SESSION['company'];
- else
- {
- $companyID = $mycompany[0];
- $_SESSION['company'] = $companyID;
- }
- }
- else
- {
- $_SESSION['company'] = $companyID;
- }
- $companyname = getCompanyByID($companyID)[1];
- if ((int)$_POST['appMykey'] == 123465) {$logged_me_in_successfully234 = 1;}
- if ($logged_me_in_successfully234 == 0)
- {
- echo "<center>";
- GetEnterForm();
- echo("<font color='red'><b>Access denied. Incorrect login or password</b><font>");
- echo "</center>";
- return;
- }
- //$asusgEmployeeEntity = \app\models\entity\AsusgEmployee::find()->orderBy(['name' => SORT_ASC])->all();
- $asusgEmployeeEntity = \app\models\entity\Accounts::find()->where(['company' => $companyID])->orderBy(['name' => SORT_ASC])->all();
- $asusgJobplanEntity = \app\models\entity\AsusgJobplan::find()->orderBy(['name' => SORT_ASC])->all();
- if ( null != $post['typefix'] and null != $post['loco_seria']) {
- $asusgProjectTypeEntity = \app\models\entity\AsusgProjectType::findOne(['repair_type' => explode('_',$post['typefix'])[0], 'loco_serie_id' => $post['loco_seria']]);
-
- $asusgJobsModel = (new \yii\db\Query())->select(['jobtype_id'])->from('asusg_job2command')->where(['asusg_projecttype_id' => $asusgProjectTypeEntity->id])->groupBy(['jobtype_id'])->all();
-
- $types = [];
- foreach( $asusgJobsModel as $model){
- $types[] = $model['jobtype_id'];
- }
-
- $jobtypesEntity = \app\models\entity\Jobtypes::find()->where(['id' => $types])->all();
-
- }
- else if( null != $get_id){
- $asusgJob2LaunchEntity = \app\models\entity\AsusgJob2Launch::find()->where(['asusg_project_id' => $get_id])->all();
- $asusgProjectsEntity = \app\models\entity\AsusgProject::findOne(['id' => $get_id]);
-
-
- $asusgProjectTypeEntity = \app\models\entity\AsusgProjectType::findOne(['repair_type' => $asusgProjectsEntity->repair_type, 'loco_serie_id' => $asusgProjectsEntity->loco_serie_id]);
- $asusgJobsModel = (new \yii\db\Query())->select(['jobtype_id'])->from('asusg_job2command')->where(['asusg_projecttype_id' => $asusgProjectTypeEntity->id])->groupBy(['jobtype_id'])->all();
- $types = [];
- foreach( $asusgJobsModel as $model){
- $types[] = $model['jobtype_id'];
- }
-
- $jobtypesEntity = \app\models\entity\Jobtypes::find()->where(['id' => $types])->all();
-
- }
- else {
- $asusgJob2ProjectEntity = \app\models\entity\AsusgJob2Project::find()->orderBy(['job_order' => SORT_ASC])->all();
-
- }
-
- $tasktypesEntity = \app\models\entity\Tasktypes::find()->where(['main_task' => 0,'company' => $companyID])->orderBy(['name' => SORT_ASC])->all();
- $locomotiveSeriesEntity = \app\models\entity\LocomotiveSeries::find()->orderBy(['name' => SORT_ASC])->all();
- $typeFix = \app\models\entity\Repairtypes::find()->all();
- //$typeFix = ['1' => 'TO-1','2' => 'TO-2','3' => 'TO-3','4' => 'TO-4','5' => 'TO-5',];
- //$projectsLocotechEntity = getLocomotiveList();
- $projectsLocotechEntity = \app\models\entity\ProjectsLocotech::find()->where(["!=", "uuid" , ''])->all();
- $series = LocoSeries::GetAllNames();
- $startPr = \Yii::$app->request->post('startPr');
- if( isset($startPr)) {
- $asusgProjectEntity = new \app\models\entity\AsusgProject();
- $asusgProjectEntity->loco_serie_id = \Yii::$app->request->post('loco_seria');
- $asusgProjectEntity->loco_number = \Yii::$app->request->post('loco_number');
- $asusgProjectEntity->repair_type = \Yii::$app->request->post('typefix');
- $asusgProjectEntity->section_a = \Yii::$app->request->post('section_a');
- $asusgProjectEntity->section_b = \Yii::$app->request->post('section_b');
- $asusgProjectEntity->section_c = \Yii::$app->request->post('section_c');
- try {
- $asusgProjectEntity->save();
- } catch (\yii\db\Exception $exception) {
- $loadFormError = 'Данные не сохранились.';
-
- }
-
-
- }
- ?>
- <!-- HTML -->
- <div class="wrapper">
- <header class="main-header">
- <!-- Logo -->
- <a href="/asusg_plan.php" class="logo">
- <!-- mini logo for sidebar mini 50x50 pixels -->
- <span class="logo-mini"><b>A</b>LT</span>
- <!-- logo for regular state and mobile devices -->
- <span class="logo-lg"><b>АСУ</b>СГ</span>
- </a>
- <!-- Header Navbar: style can be found in header.less -->
- <nav class="navbar navbar-static-top">
- <!-- Sidebar toggle button-->
- <a href="#" class="sidebar-toggle" data-toggle="push-menu" role="button">
- <span class="sr-only">Toggle navigation</span>
- </a>
- </nav>
- </header>
- <aside class="main-sidebar">
- <section class="sidebar">
- <form action="#" method="get" class="sidebar-form">
- <div class="input-group">
- <input type="text" name="q" class="form-control" placeholder="Search...">
- <span class="input-group-btn">
- <button type="submit" name="search" id="search-btn" class="btn btn-flat"><i class="fa fa-search"></i>
- </button>
- </span>
- </div>
- </form>
- <?php require_once 'asusg_menu.php';?>
- </section>
- </aside>
- <div class="content-wrapper">
- <section class="content-header">
- <h1>Список задач</h1>
- <ol class="breadcrumb">
- <li><a href="#"><i class="fa fa-dashboard"></i> Home</a></li>
- <li class="active">Dashboard</li>
- </ol>
- </section>
- <section class="content">
- <div class="row">
- <div class="col-md-12">
- <div class="nav-tabs-custom">
- <ul class="nav nav-tabs">
- <li class="active"><a href="#tab_1" data-toggle="tab">Новый вариант</a></li>
- <li><a href="#tab_2" data-toggle="tab">Альтернативный вариант</a></li>
- <li class="pull-right"><a href="#" class="text-muted"><i class="fa fa-gear"></i></a></li>
- </ul>
- <div class="tab-content">
- <!-- НАЧАЛО ПЕРВОЙ ВКЛАДКИ -->
- <div class="tab-pane active" id="tab_1">
- <div class="row">
- <div class="col-xs-12">
- <? //foreach( $asusgJobplanEntity as $template ):?>
- <div class="box box-primary">
- <div class="box-header with-border">
- <h3 class="box-title"><?php// echo $template->name;?></h3>
- <div class="box-tools pull-right">
- <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
- </button>
- </div>
- </div>
- <div class="box-body">
- <?php //var_dump($post);?>
- <form id="submit_editor_start_form" active="post" method="post">
- <div class="row">
- <div class="col-xs-3">
- <div class="form-group">
- <label for="exampleInputPassword1">Вид ремонта</label>
- <p><?php echo $asusgProjectsEntity->repairtypes->name;?></p>
-
- </div>
- </div>
- <div class="col-xs-3">
- <div class="form-group">
- <label for="exampleInputEmail1">Серия локомотива</label>
- <p><?php echo $asusgProjectsEntity->locomotiveSeries->name;?></p>
- </div>
- </div>
- <div class="col-xs-3">
- <div id="error_number_input" class="form-group">
- <label for="exampleInputPassword1">Номер локомотива</label>
- <p><?php echo $asusgProjectsEntity->loco_number;?></p>
-
- </div>
- </div>
- <div class="col-xs-3">
- <div class="form-group">
- <label for="exampleInputPassword1">8-ми знак: Секция А</label>
- <input type="text" class="form-control" id="numberA" name="section_a" value="<?php echo $asusgProjectsEntity->section_a;?>">
-
- </div>
- </div>
- <div class="col-xs-3">
-
- <!-- <div class="form-group">
- <label for="exampleInputPassword1">Редактировать проект</label>
- <button id="submit_editor_start" type="button" class="btn btn-block btn-primary bindProjectTypes" >Редактировать</button>
- </div>-->
- </div>
- <div class="col-xs-3 col-xs-offset-6">
- <div class="form-group">
- <label for="exampleInputPassword1">8-ми знак: Секция Б</label>
- <input type="text" class="form-control" id="numberB" name="section_b" value="<?php echo $asusgProjectsEntity->section_b;?>">
-
- </div>
- </div>
- <div class="col-xs-3 col-xs-offset-9">
- <div class="form-group">
- <label for="exampleInputPassword1">8-ми знак: Секция В</label>
- <input type="text" class="form-control" id="numberB" name="section_c" value="<?php echo $asusgProjectsEntity->section_c;?>">
-
- </div>
- </div>
- </div>
- <div class="row">
- <div class="col-xs-2">
-
- </div>
- </div>
- </form>
- <form id="start_proj" active="post">
- <div id="jobs_create_list" class="box-body" >
- <div class="row">
- <ul id="sortable" class="list-unstyled list_asusg_command_<?php echo $template->asusg_id;?> sortable job_container">
- <? $i = 100;?>
-
- <? foreach ($asusgJob2LaunchEntity as $item):?>
-
-
- <li id="li_<?php echo $item->asusg_project_id;?>_<?php echo $item->asusg_jobplan_id;?>_<? echo $i;?>" class="ui-state-default" data_id="<?php echo $item->asusg_project_id;?>_<?php echo $item->asusg_jobplan_id;?>_<? echo $i;?>">
- <span class="ui-icon ui-icon-arrowthick-2-n-s"></span>
- <div class="box box-warning">
- <div class="box-header with-border">
- <h3 class="box-title"><?php //echo $item->tasktypes->name;?></h3>
- <div class="box-tools pull-right">
- <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
- <button type="button" class="btn btn-box-tool remove_command_button" data-widget="remove" data_id="<?php echo $item->asusg_project_id;?>_<?php echo $item->asusg_jobplan_id;?>_<? echo $i;?>"><i class="fa fa-times"></i></button>
- <div class="col-xs-3 ">
- <div class="form-group">
- <label>Работы АСУ СГ</label>
- <select class="form-control select2" style="width: 100%;" <? if ( 1 == $status_id):?> name="newListJ_<? echo $i;?>"<? endif;?> >
- <? foreach( $asusgJobplanEntity as $plan):?>
- <option value="<?php echo $plan->id?>" <? if ( $plan->id == $item->asusgJobplan->id) { echo "selected=selected";}?>><?php echo $plan->name?></option>
- <? endforeach;?>
- </select>
- </div>
- </div>
- <div class="col-xs-2 col-xs-offset-2">
- <div class="form-group">
- <label>Сотрудник 1</label>
- <select class="form-control select2" style="width: 100%;" name="newList1_<? echo $i;?>">
- <option value='0'>-- Список сотрудников --</option>
- <? foreach( $asusgEmployeeEntity as $plan):?>
- <option value="<?php echo $plan->id?>" <?php echo ($item-> asusg_employee_id1 == $plan->id)?'selected="selected"':'';?>><?php echo $plan->name?></option>
- <? endforeach;?>
- </select>
- </div>
- <div class="form-group">
- <label>Должность 1</label>
- <select class="form-control select2" style="width: 100%;" name="newList1_<? echo $i;?>">
- <option value='0'>-- Список должностей --</option>
- <? foreach( $jobtypesEntity as $job):?>
- <option value="<?php echo $job->id?>" <?php echo ($item->jobtype_id1 == $job->id)?'selected="selected"':'';?>><?php echo $job->name?></option>
- <? endforeach;?>
- </select>
- </div>
- </div>
- <div class="col-xs-2 ">
- <div class="form-group">
- <label>Сотрудник 2</label>
- <select class="form-control select2" style="width: 100%;" name="newList2_<? echo $i;?>">
- <option value='0'>-- Список сотрудников --</option>
- <? foreach( $asusgEmployeeEntity as $plan):?>
- <option value="<?php echo $plan->id?>" <?php echo ($item-> asusg_employee_id2 == $plan->id)?'selected="selected"':'';?>><?php echo $plan->name?></option>
- <? endforeach;?>
- </select>
- </div>
- <div class="form-group">
- <label>Должность 2</label>
- <select class="form-control select2" style="width: 100%;" name="newList2_<? echo $i;?>">
- <option value='0'>-- Список должностей --</option>
- <? foreach( $jobtypesEntity as $job):?>
- <option value="<?php echo $job->id?>" <?php echo ($item->jobtype_id2 == $job->id)?'selected="selected"':'';?>><?php echo $job->name?></option>
- <? endforeach;?>
- </select>
- </div>
- </div>
- <div class="col-xs-2 ">
- <div class="form-group">
- <label>Сотрудник 3</label>
- <select class="form-control select2" style="width: 100%;" name="newList3_<? echo $i;?>">
- <option value='0'>-- Список сотрудников --</option>
- <? foreach( $asusgEmployeeEntity as $plan):?>
- <option value="<?php echo $plan->id?>" <?php echo ($item-> asusg_employee_id3 == $plan->id)?'selected="selected"':'';?>><?php echo $plan->name?></option>
- <? endforeach;?>
- </select>
- </div>
- <div class="form-group">
- <label>Должность 3</label>
- <select class="form-control select2" style="width: 100%;" name="newList2_<? echo $i;?>">
- <option value='0'>-- Список должностей --</option>
- <? foreach( $jobtypesEntity as $job):?>
- <option value="<?php echo $job->id?>" <?php echo ($item->jobtype_id3 == $job->id)?'selected="selected"':'';?>><?php echo $job->name?></option>
- <? endforeach;?>
- </select>
- </div>
- </div>
- </div>
- </div>
- </div>
- </li>
- <? $i++;?>
- <? endforeach;?>
-
- <? foreach ([]/*$asusgProjectTypeEntity->job2Project*/ as $item):?>
-
-
- <? //if ($item->asusg_job_id == $template->asusg_id):?>
- <li id="li_<?php echo $item->asusg_projecttype_id;?>_<?php echo $item->asusg_jobplan_id;?>_<? echo $i;?>" class="ui-state-default" data_id="<?php echo $item->asusg_projecttype_id;?>_<?php echo $item->asusg_jobplan_id;?>_<? echo $i;?>">
- <span class="ui-icon ui-icon-arrowthick-2-n-s"></span>
- <div class="box box-warning">
- <div class="box-header with-border">
- <h3 class="box-title"><?php //echo $item->tasktypes->name;?></h3>
- <div class="box-tools pull-right">
- <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
- <button type="button" class="btn btn-box-tool remove_command_button" data-widget="remove" data_id="<?php echo $item->asusg_projecttype_id;?>_<?php echo $item->asusg_jobplan_id;?>_<? echo $i;?>"><i class="fa fa-times"></i></button>
- <div class="col-xs-3 ">
- <div class="form-group">
- <label>Работы АСУ СГ</label>
- <select class="form-control select2" style="width: 100%;" name="newListJ_<? echo $i;?>">
- <? foreach( $asusgJobplanEntity as $plan):?>
- <option value="<?php echo $plan->id?>" <? if ( $plan->id == $item->jobplan->id) { echo "selected=selected";}?>><?php echo $plan->name?></option>
- <? endforeach;?>
- </select>
- </div>
- </div>
- <div class="col-xs-2 col-xs-offset-2">
- <div class="form-group">
- <label>Сотрудник 1</label>
- <select class="form-control select2" style="width: 100%;" name="newList1_<? echo $i;?>">
- <option value='0'>-- Список сотрудников --</option>
- <? foreach( $asusgEmployeeEntity as $plan):?>
- <option value="<?php echo $plan->id?>"><?php echo $plan->name?></option>
- <? endforeach;?>
- </select>
- </div>
- <div class="form-group">
- <label>Должность 1</label>
- <select class="form-control select2" style="width: 100%;" name="newList1_<? echo $i;?>">
- <option value='0'>-- Список должностей --</option>
- <? foreach( $jobtypesEntity as $job):?>
- <option value="<?php echo $job->id?>"><?php echo $job->name?></option>
- <? endforeach;?>
- </select>
- </div>
- </div>
- <div class="col-xs-2 ">
- <div class="form-group">
- <label>Сотрудник 2</label>
- <select class="form-control select2" style="width: 100%;" name="newList2_<? echo $i;?>">
- <option value='0'>-- Список сотрудников --</option>
- <? foreach( $asusgEmployeeEntity as $plan):?>
- <option value="<?php echo $plan->id?>"><?php echo $plan->name?></option>
- <? endforeach;?>
- </select>
- </div>
- <div class="form-group">
- <label>Должность 2</label>
- <select class="form-control select2" style="width: 100%;" name="newList2_<? echo $i;?>">
- <option value='0'>-- Список должностей --</option>
- <? foreach( $jobtypesEntity as $job):?>
- <option value="<?php echo $job->id?>"><?php echo $job->name?></option>
- <? endforeach;?>
- </select>
- </div>
- </div>
- <div class="col-xs-2 ">
- <div class="form-group">
- <label>Сотрудник 3</label>
- <select class="form-control select2" style="width: 100%;" name="newList3_<? echo $i;?>">
- <option value='0'>-- Список сотрудников --</option>
- <? foreach( $asusgEmployeeEntity as $plan):?>
- <option value="<?php echo $plan->id?>"><?php echo $plan->name?></option>
- <? endforeach;?>
- </select>
- </div>
- </div>
- </div>
- </div>
- </div>
- </li>
- <? //endif;?>
- <? $i++;?>
- <? endforeach;?>
- </ul>
- </div>
- </div>
- <div class="box-body" >
- <div class="row">
- <div class="col-xs-2">
- <div class="form-group">
- <button id="add_jobs_part" type="button" class="btn btn-block btn-success " >Добавить работу</button>
- </div>
- </div>
- </div>
-
- <div class="row">
- <div class="col-xs-2">
- <div class="form-group">
- <label for="exampleInputPassword1">Запустить команду</label>
- <button id="submit_start_proj" type="button" class="btn btn-block btn-danger bindProjectTypes" data="<?php echo \Yii::$app->request->get('id');?>">Спланировать</button>
- </div>
-
- <div class="form-group">
- <? if ($loadFormError):?>
- <p><?php echo $loadFormError;?></p>
- <? endif;?>
- <label for="exampleInputPassword1">Запустить проект</label>
- <button id="submit_go_go_proj" class="btn btn-block btn-primary disabled" user_id="<?php echo $id;?>" data="<?php echo \Yii::$app->request->get('id');?>">Запустить</button>
- </div>
-
- </div>
- </div>
- </div>
- </form>
- </div>
- </div>
- <? //endforeach;?>
- </div>
- </div>
- </div>
- <!-- КОНЕЦ ПЕРВОЙ ВКЛАДКИ -->
- <!-- НАЧАЛО ВТОРОЙ ВКЛАДКИ -->
- <div class="tab-pane" id="tab_2">
- dgdgfsdfg
- </div>
- <!-- КОНЕЦ ВТОРОЙ ВКЛАДКИ -->
- </div>
- </div>
- </div>
- </div>
- </section>
- <!-- /.content -->
- </div>
- <!-- /.content-wrapper -->
- <footer class="main-footer">
-
- </footer>
- <!-- Add the sidebar's background. This div must be placed
- immediately after the control sidebar -->
- <div class="control-sidebar-bg"></div>
- </div>
- <!-- HTML -->
- <div class="ASU_select0" style="display:none">
- <select class="form-control select2 hide_field_select_0" style="width: 100%;" name="newListJ_<? echo $i;?>">
- <? foreach( $asusgJobplanEntity as $plan):?>
- <option value="<?php echo $plan->id?>"><?php echo $plan->name?></option>
- <? endforeach;?>
- </select>
- </div>
- <div class="ASU_select1" style="display:none">
- <select class="form-control select2 hide_field_select_1" style="width: 100%;" name="newList1_<? echo $i;?>">
- <option value='0'>-- Список сотрудников --</option>
- <? foreach( $asusgEmployeeEntity as $plan):?>
- <option value="<?php echo $plan->id?>"><?php echo $plan->name?></option>
- <? endforeach;?>
- </select>
- </div>
- <div class="ASU_select1_j" style="display:none">
- <select class="form-control select2 hide_field_select_1_j" style="width: 100%;" name="newList1j_<? echo $i;?>">
- <option value='0'>-- Список должностей --</option>
- <? foreach( $jobtypesEntity as $job):?>
- <option value="<?php echo $job->id?>"><?php echo $job->name?></option>
- <? endforeach;?>
- </select>
- </div>
- <div class="ASU_select2" style="display:none">
- <select class="form-control select2 hide_field_select_2" style="width: 100%;" name="newList2_<? echo $i;?>">
- <option value='0'>-- Список сотрудников --</option>
- <? foreach( $asusgEmployeeEntity as $plan):?>
- <option value="<?php echo $plan->id?>"><?php echo $plan->name?></option>
- <? endforeach;?>
- </select>
- </div>
- <div class="ASU_select2_j" style="display:none">
- <select class="form-control select2 hide_field_select_2_j" style="width: 100%;" name="newList2j_<? echo $i;?>">
- <option value='0'>-- Список должностей --</option>
- <? foreach( $jobtypesEntity as $job):?>
- <option value="<?php echo $job->id?>"><?php echo $job->name?></option>
- <? endforeach;?>
- </select>
- </div>
- <div class="ASU_select3" style="display:none">
- <select class="form-control select2 hide_field_select_3" style="width: 100%;" name="newList3_<? echo $i;?>">
- <option value='0'>-- Список сотрудников --</option>
- <? foreach( $asusgEmployeeEntity as $plan):?>
- <option value="<?php echo $plan->id?>"><?php echo $plan->name?></option>
- <? endforeach;?>
- </select>
- </div>
- <div class="ASU_select3_j" style="display:none">
- <select class="form-control select2 hide_field_select_3_j" style="width: 100%;" name="newList3j_<? echo $i;?>">
- <option value='0'>-- Список должностей --</option>
- <? foreach( $jobtypesEntity as $job):?>
- <option value="<?php echo $job->id?>"><?php echo $job->name?></option>
- <? endforeach;?>
- </select>
- </div>
- <!-- End Document
- –––––––––––––––––––––––––––––––––––––––––––––––––– -->
-
- <script src="/lte/bower_components/jquery/dist/jquery.min.js"></script>
- <!-- jQuery UI 1.11.4 -->
- <script src="/lte/bower_components/jquery-ui/jquery-ui.min.js"></script>
- <!-- Resolve conflict in jQuery UI tooltip with Bootstrap tooltip -->
- <script>
- $.widget.bridge('uibutton', $.ui.button);
- </script>
- <!-- Bootstrap 3.3.7 -->
- <script src="/lte/bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
- <!-- Morris.js charts -->
- <script src="/lte/bower_components/raphael/raphael.min.js"></script>
- <script src="/lte/bower_components/morris.js/morris.min.js"></script>
- <!-- Sparkline -->
- <script src="/lte/bower_components/jquery-sparkline/dist/jquery.sparkline.min.js"></script>
- <!-- jvectormap -->
- <script src="/lte/plugins/jvectormap/jquery-jvectormap-1.2.2.min.js"></script>
- <script src="/lte/plugins/jvectormap/jquery-jvectormap-world-mill-en.js"></script>
- <!-- jQuery Knob Chart -->
- <script src="/lte/bower_components/jquery-knob/dist/jquery.knob.min.js"></script>
- <!-- daterangepicker -->
- <script src="/lte/bower_components/moment/min/moment.min.js"></script>
- <script src="/lte/bower_components/bootstrap-daterangepicker/daterangepicker.js"></script>
- <!-- datepicker -->
- <script src="/lte/bower_components/bootstrap-datepicker/dist/js/bootstrap-datepicker.min.js"></script>
- <!-- Bootstrap WYSIHTML5 -->
- <script src="/lte/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.min.js"></script>
- <!-- Slimscroll -->
- <script src="/lte/bower_components/jquery-slimscroll/jquery.slimscroll.min.js"></script>
- <!-- FastClick -->
- <script src="/lte/bower_components/fastclick/lib/fastclick.js"></script>
- <!-- AdminLTE App -->
- <script src="/lte/dist/js/adminlte.min.js"></script>
- <!-- AdminLTE dashboard demo (This is only for demo purposes) -->
- <script src="/lte/dist/js/pages/dashboard.js"></script>
- <!-- AdminLTE for demo purposes -->
- <script src="/lte/dist/js/demo.js"></script>
- <script src="/loco.js"></script>
- <script src="/mail.js"></script>
- <script src="/lte/bower_components/select2/dist/js/select2.full.min.js"></script>
- <script>
- $( function() {
- $( ".sortable" ).sortable();
- $( ".sortable" ).disableSelection();
- } );
- </script>
- </body>
- </html>
- <?php
- function GetEnterForm()
- {
- echo "<article>
- <form method='post' action='?login'>
- <table>
- <tr>
- <td width=70>
- <b>Login</b>
- </td>
- <td>
-
- </td>
- <td>
- <input type='text' name=login value=''><br/>
- </td>
- </tr>
- <tr>
- <td>
- <b>Password </b>
- </td>
- <td>
-
- </td>
- <td>
- <input type='password' name=pass value=''>
- </td>
- </tr>
- <tr>
- <td></td>
- <td> </td>
- <td>
- <input type='submit' value='Enter'>
- </td>
- </tr>
- </table>
- </form>
- </article>";
- }
- function getLocomotiveList(){
-
- $result = [];
- //var_dump($companyID);
- $projectsLocotechEntity = \app\models\entity\ProjectsLocotech::find()->where(['company' => 2] )->orderBy(['id' => SORT_DESC])->all();
- $listArray = [];
- foreach( $projectsLocotechEntity as $item){ //var_dump($item->projecttypes->name);echo "\n";
- //$tempArray = GetTasksForProject($item->id);
- $status = GetProjectStatus($item->id);
- if ($status != 2 && $status != 1) {continue;}
- $countDone = ['done' => 0, 'all' => 0 ];
- foreach( GetTasksForProject($item->id) as $proj) { //var_dump($proj);echo "<br>";
- $countDone['all']++;
- $tempArray = $proj;
- $tempArray['status'] = CheckAcceptedStatus($proj);
- $tempArray['name'] = GetTaskNameAndDesc($proj['type'])[0];
- //$tempArray['listAccounts'] = $this->getAccountListForTask($proj['type']);
- if ( 5 == $tempArray['status'] ) {$countDone['done']++;}
- //$countDone['all'] ." / " . $countDone['done'];
- $listArray[] = $tempArray;
-
- }
- $result[$item->id]['countDone'] = [ 'done' => $countDone['done'], 'all' => $countDone['all'] ];
- //$tempArray['name'] = GetTaskNameAndDesc($tempArray['type'])[0];
-
- $result[$item->id]['arr'] = $listArray;//GetTasksForProject($item->id);
- $result[$item->id]['obj'] = $item;
- $listArray = [];
- }
- //exit;
- return $result;
-
- }
- function CheckAcceptedStatus($task) {
-
- $result = false;
- $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
- from (select count(t.id) as total,
- sum(if(t.accepted_time is not null, 1, 0)) as accepted,
- sum(if(t.finished_time is not null, 1, 0)) as finished,
- sum(if(t.finished_time is null, if(timestampdiff(MINUTE, t.accepted_time, NOW()) > tt.time_to_complete_minutes, 1, 0), 0)) as attention
- from tasks t
- right join tasktypes tt on t.type = tt.id
- where t.parent_id = ".$task['id'].") tx;";
- $result = \Yii::$app->db->createCommand($query)->queryAll();
- $result = $result[0]["taskstatus"];
-
- return $result;
- }
- ?>
|