123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- <?php
- echo "<h3>Алгоритмы для проектов:</h3>";
- echo "<div id='addalgo' title='Добавить алгоритм' style='display: inline-block; margin-top: -10px; font-size: 25px;' class='round deepskyblue'>+</div><br><br>";
- echo "<div id='result_cont'></div>";
- //echo "companyID $companyID";
- $ptypes = FindActions();
- //\Doctrine\Common\Util\Debug::dump($ptypes);
- //var_dump();
- echo "<select id='pt_list'>
- <option value='0'><Выберите тип проекта></option>";
- foreach ($ptypes as $pt)
- {
- echo "<option value='$pt->id'>$pt->id. $pt->name</option>";
- }
- echo "</select><p></p>";
- //
- //$algos;
- //$algos = algoList('project_type');
- //var_dump($algos);
- echo "<select id='algo_list'>";
- echo "</select><p></p>";
- ?>
- <div id="addbutton_template" style="display: none">
- <input type='button' id='add' value='Добавить'>
- </div>
- <div id="cont"
- style="display:none; float:left;border: solid; width: 500px; border-width: 1px; border-color: #9cb2c4; border-radius: 15px; margin-right:20px; padding: 15px">
- <p style="margin-bottom: 0"><b>Создать новый алгоритм</b>
- <br><br>
- <form method='post' action='' id="ajax_form">
- <div id="cp_desc" style="color: green"></div>
- <p><?php
- $conds = GetConditions('project_type');
- $actions = GetActions();
- echo "<b>Условие</b> <select id='cond_list'>
- <option value='0'><Выберите условие></option>";
- foreach ($conds as $cond)
- {
- echo "<option value='$cond->c_id'>$cond->c_id. $cond->c_name</option>";
- }
- echo "</select><br>";
- echo "<b>Действие</b> <select id='act_list'>
- <option value='0'><Выберите действие></option>";
- foreach ($actions as $act)
- {
- echo "<option value='$act->a_id'>$act->a_id. $act->a_name</option>";
- }
- echo "</select><p></p>";
- ?>
- <input type='button' id='send' value='Создать'>
- <input type='button' id='close' value='Закрыть'>
- </p>
- <div id="cbresult"></div>
- </form>
- </p>
- </div>
- <div id="result"></div>
- <!--<input type='button' id='setlast' value='Посл. элемент'>-->
- <?php
- function GetConditions($condition_target)
- {
- global $link;
- $query = mysqli_query($link, "select * from algo_conditions where condition_target='$condition_target'");
- for ($data = []; $row = mysqli_fetch_object($query); $data[] = $row);
- return $data;
- }
- function GetActions()
- {
- global $link;
- $query = mysqli_query($link, "select * from algo_actions");
- for ($data = []; $row = mysqli_fetch_object($query); $data[] = $row);
- return $data;
- }
- ?>
|