Project

General

Profile

Statistics
| Branch: | Revision:

colonymech / docs / www / colonyscout / internal / assembly_edit.php @ f59acf11

History | View | Annotate | Download (1.85 KB)

1 f59acf11 Dan Shope
<script type="text/javascript">
2
function submitForm()
3
{
4
  document.editForm.submit();
5
}
6
</script>
7
8
<?php
9
        if(!isset($_GET['q'])) {
10
                echo "<h1 style=\"color:#FF6600;\">Please search for a part..</h1>";
11
12
        } else {
13
14
        //must already be logged in
15
        $get_assembly_sql = "SELECT * FROM assemblyinstructions WHERE id='".$_GET['q']."' LIMIT 1";
16
        $get_assembly_res = mysqli_query($GLOBALS['mysqli'], $get_assembly_sql) or die(mysqli_error($GLOBALS['mysqli']));
17
18
        while ($r = mysqli_fetch_array($get_assembly_res)) {
19
                $assm["data"]                =        $r;
20
        }
21
?>        
22
23
<div  style="overflow:hidden;">
24
        <div class="box-row">
25
        <h1>Edit:</h1>
26
        </div>
27
28
29
        <form name="editForm" action="assembly_edit_steps.php" target="editframe" method="post" class="niceform">
30
                <fieldset>
31
                        <legend>Assembly Instruction Set</legend>
32
                        <dl>
33
                                <dt><label for="title">Title:</label></dt>
34
                                <dd><input type="text" name="title" value="<?php echo $assm['data']['Name']; ?>" id="email" size="50" maxlength="128" /></dd>
35
                        </dl>
36
                </fieldset>
37
                <fieldset>
38
                        <legend>Edit Steps</legend>
39
                        <SELECT name="stepNo" size="5" onChange="submit()" style="width:150px;font-size:20px;float:left;height:230px;">
40
<?php
41
        $get_assembly_sql = "SELECT ID, StepNo FROM assemblysteps WHERE AssemblyID=\"".$_GET['q']."\" ORDER BY StepNo ASC";
42
        $get_assembly_res = mysqli_query($GLOBALS['mysqli'], $get_assembly_sql) or die(mysqli_error($GLOBALS['mysqli']));
43
                                
44
        if (mysqli_num_rows($get_assembly_res)>0) {
45
                while ($r = mysqli_fetch_array($get_assembly_res)) {
46
                        echo "<OPTION value=\"".$r['ID']."\">Step ".$r['StepNo']."</OPTION>";
47
                }
48
        }
49
?>
50
                        </SELECT>
51
                <iframe name="editframe" src="assembly_edit_steps.php" width="100%" height="300" frameborder="0" scrolling="no" style="display:block; float:left; width:740px; height:230px;">
52
                  <p>Your browser does not support iframes.</p>
53
                </iframe>                        
54
                        
55
                </fieldset>                                        
56
                                </div>
57
</div>
58
</form>
59
60
<?php
61
}
62
?>
63
64
</div>