Example #1
0
 }
 if ($page > $total_pages) {
     $page = $total_pages;
 }
 $start = $limit * $page - $limit;
 $SQL = "SELECT * FROM bp_xml  {$where} ORDER BY {$sidx} {$sord} LIMIT {$start} , {$limit}";
 //echo "!$SQL!";
 $result = $sqlcn->ExecuteSQL($SQL) or die("Не могу выбрать сформировать список задач!" . mysqli_error($sqlcn->idsqlconnection));
 $responce = new stdClass();
 $responce->page = $page;
 $responce->total = $total_pages;
 $responce->records = $count;
 $i = 0;
 while ($row = mysqli_fetch_array($result)) {
     $responce->rows[$i]['id'] = $row['id'];
     $dt = MySQLDateTimeToDateTime($row['dt']);
     if ($row['status'] == '0') {
         $status = 'Создано';
     }
     if ($row['status'] == '1') {
         $status = 'В работе';
     }
     if ($row['status'] == '2') {
         $status = 'Утверждено';
     }
     if ($row['status'] == '3') {
         $status = 'Отменено';
     }
     if ($row['status'] == '4') {
         $status = 'Доработать';
     }
Example #2
0
        }
        if ($myrow['result'] == $myrow['two']) {
            $rz = 'Выбран вариант 2';
        }
        if ($myrow['result'] == $myrow['three']) {
            $rz = 'Выбран вариант 3';
        }
        if ($myrow['result'] == $myrow['four']) {
            $rz = 'Выбран вариант 4';
        }
        if ($myrow['node'] == $bp->node) {
            echo "<tr class='error'>";
        } else {
            echo "<tr>";
        }
        echo "<td>{$numid}</td>";
        $tt = MySQLDateTimeToDateTime($myrow['dtend']);
        echo "<td>{$tt}</td>";
        echo "<td>{$uname}</td>";
        echo "<td><strong>{$bpnodetitle}</strong><br>{$bpnodecomment}</td>";
        echo "<td>{$rz}</td>";
        echo "<td>{$cm}</td>";
        echo "</tr>";
        unset($uz);
    }
} else {
    die('Неверный запрос при выборке шагов БП: ' . mysqli_error($sqlcn->idsqlconnection));
}
?>
</tbody>     
</table>
Example #3
0
    $responce->records = $count;
    $i = 0;
    while ($row = mysqli_fetch_array($result)) {
        $responce->rows[$i]['id'] = $row['eqid'];
        if ($row['eqactive'] == '1') {
            $active = '<img src="controller/client/themes/' . $cfg->theme . '/ico/accept.png">';
        } else {
            $active = '<img src="controller/client/themes/' . $cfg->theme . '/ico/cancel.png">';
        }
        if ($row['eqrepair'] == '1') {
            $active = $active . '<img src="controller/client/themes/' . $cfg->theme . '/ico/error.png">';
        }
        $os = $row['os'] == 0 ? 'No' : 'Yes';
        $eqmode = $row['eqmode'] == 0 ? 'No' : 'Yes';
        $eqmapyet = $row['eqmapyet'] == 0 ? 'No' : 'Yes';
        $dtpost = MySQLDateTimeToDateTime($row['datepost']);
        $dtendgar = MySQLDateToDate($row['dtendgar']);
        $row['tmcgo'] = $row['tmcgo'] == 0 ? 'No' : 'Yes';
        $responce->rows[$i]['cell'] = array($active, $row['eqid'], $row['placesname'], $row['nomename'], $row['grnome'], $row['tmcgo'], $row['vname'], $row['buhname'], $row['sernum'], $row['invnum'], $row['shtrihkod'], $row['orgname'], $row['fio'], $dtpost, $row['cost'], $row['currentcost'], $os, $eqmode, $row['eqmapyet'], $row['eqcomment'], $row['eqrepair'], $dtendgar, $row['kntname']);
        $i++;
    }
    echo json_encode($responce);
}
if ($oper == 'edit') {
    $os = $os == 'Yes' ? 1 : 0;
    $tmcgo = $tmcgo == 'Yes' ? 1 : 0;
    $mode = $mode == 'Yes' ? 1 : 0;
    $mapyet = $mapyet == 'Yes' ? 1 : 0;
    $buhname = mysqli_real_escape_string($sqlcn->idsqlconnection, $buhname);
    $SQL = "UPDATE equipment SET buhname='{$buhname}',sernum='{$sernum}'," . " invnum='{$invnum}',shtrihkod='{$shtrihkod}',cost='{$cost}'," . " currentcost='{$currentcost}',os='{$os}',mode='{$mode}'," . " mapyet='{$mapyet}',comment='{$comment}',tmcgo='{$tmcgo}' WHERE id='{$id}'";
    $sqlcn->ExecuteSQL($SQL) or die('Не смог обновить оргтехнику!' . mysqli_error($sqlcn->idsqlconnection));
Example #4
0
    $responce->total = $total_pages;
    $responce->records = $count;
    $i = 0;
    while ($row = mysqli_fetch_array($result)) {
        $responce->rows[$i]['id'] = $row['id'];
        if ($row['work'] == 0) {
            $row['work'] = 'No';
        } else {
            $row['work'] = 'Yes';
        }
        $dateend = $row['dateend'] . ' 00:00:00';
        $datestart = $row['datestart'] . ' 00:00:00';
        if ($row['active'] == "1") {
            $responce->rows[$i]['cell'] = array("<img src=controller/client/themes/" . $cfg->theme . "/ico/accept.png>", $row['id'], $row['num'], $row['name'], MySQLDateTimeToDateTime($datestart), MySQLDateTimeToDateTime($dateend), $row['work'], $row['comment']);
        } else {
            $responce->rows[$i]['cell'] = array("<img src=controller/client/themes/" . $cfg->theme . "/ico/cancel.png>", $row['id'], $row['num'], $row['name'], MySQLDateTimeToDateTime($datestart), MySQLDateTimeToDateTime($dateend), $row['work'], $row['comment']);
        }
        $i++;
    }
    echo json_encode($responce);
}
if ($oper == 'edit') {
    if ($work == 'Yes') {
        $work = '1';
    } else {
        $work = '0';
    }
    $datestart = DateToMySQLDateTime2($datestart);
    $dateend = DateToMySQLDateTime2($dateend);
    $SQL = "UPDATE contract SET num='{$num}',name='{$name}',comment='{$comment}',datestart='{$datestart}',dateend='{$dateend}',work='{$work}' WHERE id='{$id}'";
    $result = $sqlcn->ExecuteSQL($SQL) or die("Не могу обновить данные по договору!" . mysqli_error($sqlcn->idsqlconnection));
Example #5
0
 *   Сергей Солодягин (solodyagin@gmail.com)
 *   (добавляйте себя если что-то делали)
 * http://грибовы.рф
 */
// Запрещаем прямой вызов скрипта.
defined('WUO_ROOT') or die('Доступ запрещён');
$id = GetDef('id');
$step = GetDef('step');
$comment = '';
echo "<script>orgid={$user->orgid};</script>";
echo "<script>placesid='';</script>";
echo "<script>userid={$user->id};</script>";
include_once WUO_ROOT . '/class/equipment.php';
$tmptmc = new Tequipment();
$tmptmc->GetById($id);
$dtpost = MySQLDateTimeToDateTime($tmptmc->datepost);
$orgid = $tmptmc->orgid;
echo "<script>orgid1='{$tmptmc->orgid}';</script>";
$placesid = $tmptmc->placesid;
echo "<script>placesid1='{$tmptmc->placesid}';</script>";
$userid = $tmptmc->usersid;
echo "<script>userid1='{$tmptmc->usersid}';</script>";
?>
<script>
	$(document).ready(function () {
		// навесим на форму 'myForm' обработчик отлавливающий сабмит формы и передадим функцию callback.
		$('#myForm').ajaxForm(function (msg) {
			if (msg != 'ok') {
				$('#messenger').html(msg);
			} else {
				$('#pg_add_edit').html('');
Example #6
0
    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>
 $(function(){
    $sql = "SELECT * FROM contract {$where} ORDER BY {$sidx} {$sord} LIMIT {$start}, {$limit}";
    $result = $sqlcn->ExecuteSQL($sql) or die('Не могу выбрать список договоров!' . mysqli_error($sqlcn->idsqlconnection));
    $responce = new stdClass();
    $responce->page = $page;
    $responce->total = $total_pages;
    $responce->records = $count;
    $i = 0;
    while ($row = mysqli_fetch_array($result)) {
        $responce->rows[$i]['id'] = $row['id'];
        $work = $row['work'] == 0 ? 'No' : 'Yes';
        $dateend = $row['dateend'] . ' 00:00:00';
        $datestart = $row['datestart'] . ' 00:00:00';
        if ($row['active'] == '1') {
            $responce->rows[$i]['cell'] = array('<i class="fa fa-check-circle-o" aria-hidden="true"></i>', $row['id'], $row['num'], $row['name'], MySQLDateTimeToDateTime($datestart), MySQLDateTimeToDateTime($dateend), $work, $row['comment']);
        } else {
            $responce->rows[$i]['cell'] = array('<i class="fa fa-ban" aria-hidden="true"></i>', $row['id'], $row['num'], $row['name'], MySQLDateTimeToDateTime($datestart), MySQLDateTimeToDateTime($dateend), $work, $row['comment']);
        }
        $i++;
    }
    jsonExit($responce);
}
if ($oper == 'add') {
    // Проверяем может ли пользователь добавлять?
    $user->TestRoles('1,4') or die('Недостаточно прав');
    $work = $work == 'Yes' ? '1' : '0';
    $datestart = DateToMySQLDateTime2($datestart);
    $dateend = DateToMySQLDateTime2($dateend);
    $sql = <<<TXT
INSERT INTO contract
            (id,kntid,num,name,comment,datestart,dateend,work,active)
VALUES      (NULL,'{$idknt}','{$num}','{$name}','{$comment}','{$datestart}','{$dateend}','{$work}',1)