123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101 |
- <?php
- include "auth.php";
- if(isset($_POST['machine'])){
- $idmachine =$_POST['machine'];
- echo"
- <form action='?act=typeobject' method='POST'>
-
- <input type='hidden' name='hiddenid' value='$idmachine'>
-
- <select id='machinetypelink' name='machinetypelink'>
- <option value='typetext'>text</option>
- <option value='typeint'>int</option>
- <option value='typefloat'>float</option>
- <option value='typebinary'>binary</option>
- </select>
-
-
- <input type='text' name='namelink' id='namelink'>
- <input type='text' name='textlink' id='textlink'>
-
- <input id='machinebut' type='submit' name='machinebut' value='Добавить поле'>
- </form>
-
-
- <form action='?act=typeobject' id='my_form' method='POST'>
- <input type='hidden' name='hiddenid' value='$idmachine'> ";
- $query = mysqli_query($link,"select * from type_detals where id_type='$idmachine'");
- while ($res = mysqli_fetch_array($query)) {
- $nameid=$res['id'];
- $namedetals=$res['name_detals'];
- $type=$res['type'];
- $typeid="type".$nameid;
- $count=$res[$type];
- echo "<select id='$typeid' name='$typeid'>";
- switch($type)
- {
- case 'typetext' : echo"
- <option value='typetext' selected >text</option>
- <option value='typeint'>int</option>
- <option value='typefloat'>float</option>
- <option value='typebinary'>binary</option>
- "; break;
- case 'typeint' : echo"
- <option value='typetext'>text</option>
- <option value='typeint' selected >int</option>
- <option value='typefloat'>float</option>
- <option value='typebinary'>binary</option>
-
- "; break;
- case 'typefloat' : echo"
- <option value='typetext'>text</option>
- <option value='typeint'>int</option>
- <option value='typefloat' selected >float</option>
- <option value='typebinary'>binary</option>
- "; break;
- case 'typebinary' : echo"
- <option value='typetext'>text</option>
- <option value='typeint'>int</option>
- <option value='typefloat'>float</option>
- <option value='typebinary' selected >binary</option>
- "; break;
- default: echo"
- <option value='typetext' selected>text</option>
- <option value='typeint'>int</option>
- <option value='typefloat'>float</option>
- <option value='typebinary'>binary</option>
- "; break;
- }
- echo"
- </select>
-
- <input id='detals".$nameid."' type='text' name='detals".$nameid."' value ='$namedetals' >
- <input id='count".$nameid."' type='text' name='count".$nameid."' value ='$count' >
-
- <a href='?act=typeobject&delete=".$nameid."'><button type='button'>Удалить</button></a>
- <br>";
- }
- echo " <input id='save' type='submit' name='save' value='Сохранить'>
- </form>";
- }
- ?>
|