<table class="table table-condensed table-hover table-striped"> <thead> <tr> <th>№</th> <th>Дата</th> <th>Исполнитель</th> <th>Задача</th> <th>Результат</th> <th>Комментарий</th> </tr> </thead> <tbody> <?php $bpid = _GET("bpid"); $bp = new Tbp(); $bp->GetById($bpid); $sql = "SELECT * FROM bp_xml_userlist WHERE bpid='{$bpid}' order by id"; $result = $sqlcn->ExecuteSQL($sql); if ($result != '') { while ($myrow = mysqli_fetch_array($result)) { $numid = $myrow['id']; $cm = $myrow['comment']; $uz = new Tusers(); $uz->GetById($myrow['userid']); $uname = $uz->fio; $bpnode = $bp->GetTitleAndCommentNode($myrow['node']); $bpnodetitle = $bpnode['title']; $bpnodecomment = $bpnode['comment']; $rz = 'Пока не определено'; if ($myrow['result'] == $myrow['accept']) { $rz = 'Утвердить';
} if ($row2['result'] == $row2['four']) { $cnt_four++; } $cancel = $row2['cancel']; $accept = $row2['accept']; $thinking = $row2['thinking']; $yes = $row2['yes']; $no = $row2['no']; $one = $row2['one']; $two = $row2['two']; $three = $row2['three']; $four = $row2['four']; } $bb = new Tbp(); $bb->GetById($row['id']); // если в БП проголосовали все, то думаем "Чё делать" if ($cnt == $st1) { // если хоть ктото нажал "Отмена" то if ($cnt_cancel != 0) { // если в случае отмены завершаем БП, то завершаем... if ($cancel == -1) { $bb->SetStatus(3); } else { $bb->SetNodeToBase($cancel); } } // если хоть ктото нажал "Нет" то if ($cnt_no != 0) { // если в случае отмены завершаем БП, то завершаем... if ($no == -1) {
$zxxx = new Tbp(); $zxxx->GetLast(); $zxxx->SetNodeToBase(1); } } } // ну или еслиредактируем, то обнавляем БП if ($step == "edit") { if (count($err) == 0) { $id = $_GET["id"]; $sql = "UPDATE bp_xml SET title='{$title}',bodytxt='{$bodytxt}',status='{$status}',xml='{$bpshema}' WHERE id='{$id}'"; $result = $sqlcn->ExecuteSQL($sql, $cfg->base_id); if ($result == '') { die('Не смог изменить БП!: ' . mysqli_error($sqlcn->idsqlconnection)); } // если стартуем процесс, то добавляем участников процесса if ($status == 1) { $zxxx = new Tbp(); $zxxx->GetById($id); $zxxx->SetNodeToBase(1); } } } if (count($err) == 0) { echo "ok"; } else { echo '<script>$("#messenger").addClass("alert alert-error");</script>'; for ($i = 0; $i <= count($err); $i++) { echo "{$err[$i]}<br>"; } }
$rs = array(); for ($i = 0; $i < count($fl); $i++) { $fname = $fl[$i]; $xml = simplexml_load_file("../../../../modules/bp/{$fname}"); $name = $xml->name; $rs[$i]['name'] = $name; $rs[$i]['file'] = $fl[$i]; } return $rs; } $step = _GET('mode'); $randomid = GetRandomId(60); $bpid = _GET('bpid'); if ($bpid != "") { $bp1 = new Tbp(); $bp1->GetById($bpid); $dt = MySQLDateTimeToDateTime($bp1->dt); $title = $bp1->title; $bodytxt = $bp1->bodytxt; $status = $bp1->status; $bpshema = $bp1->xml; } else { $dt = Date("d.m.Y H:i:s"); $title = ""; $bodytxt = ""; $status = "0"; $bpshema = "1"; } ?> <script>