Example #1
0
function getEdittable($ida, $type = 'normal')
{
    if ($type == 'normal') {
        include 'function/metal_functions.php';
        include 'function/db_connect.php';
        $query = "SELECT * FROM coin_bases WHERE id = ?";
        if ($stmt = $mysqli->prepare($query)) {
            $stmt->bind_param('i', $ida);
            $stmt->execute();
            $stmt->bind_result($id, $A_ID, $rowd, $year, $quality, $value, $type, $country, $country_id, $notes, $weight, $quantity, $metal_id, $metal_value, $file_folder, $is_roll);
            $stmt->fetch();
            $stmt->store_result();
            $stmt->close();
        }
        $mysqli->close();
        if ($id) {
            ?>
        <form action="function/process_edit.php" method="post">
        <input type="hidden" name="id" value="<?php 
            echo $id;
            ?>
" />
        <table width="400" border="0" class="smalltable">
            <tr>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
            </tr>
            <tr>
                <td>*Ark-ID:</td>
                <td><input name="A_ID" type="text" maxlength="5" value="<?php 
            echo $A_ID;
            ?>
" required /></td>
            </tr>

            <?php 
            if ($rowd !== NULL) {
                ?>
            <tr>
                <td>*Rad:</td>
                <td><input name="row" type="text" maxlength="3" value="<?php 
                echo $rowd;
                ?>
" required /></td>
            </tr>
            <?php 
            }
            ?>

            <tr>
                <td>*&Aring;r:</td>
                <td><input name="year" type="text" maxlength="4" value="<?php 
            echo $year;
            ?>
" required /></td>
            </tr>
            <tr>
                <td>*Kvalit&eacute;:</td>
                <td><?php 
            printQualityOption($quality);
            ?>
</td>
            </tr>
            <tr>
                <td>*V&auml;rde:</td>
                <td>
                    <?php 
            if ($value !== NULL) {
                ?>
                    Absolut värde:&nbsp;
                    <input type="text" name="value" value="<?php 
                if ($value == 0) {
                    echo "";
                } else {
                    echo $value;
                }
                ?>
" />
                    <?php 
            }
            if ($metal_id !== NULL) {
                ?>
                    Antal:  <select name="quantity">
                                    <?php 
                echo "<option value=\"\">Ej valt</option>";
                printNumbersOption($quantity);
                ?>
                            </select>
                    <hr/>
                    Metall: <select name="metal_id">
                                <?php 
                echo "<option value=\"\">Ej valt</option>";
                printMetaltypes($metal_id);
                ?>
                            </select>
                    <br/>
                    Vikt (ex: 0.875): <input name="weight" type="text" value="<?php 
                echo $weight;
                ?>
" />
                    <?php 
            }
            ?>
                </td>
            </tr>
            <tr>
                <td>*Val&ouml;r:<br /><a href="javascript:;" class="show_hide">Lägg till en ny valör</a></td>
                <td>
                    <select name="type">
                        <?php 
            printTypeOptions($type);
            ?>
                    </select>
                    <br />
                    <div class="slidingDiv" style="display: block;">
                        <input name="type_new" type="text" />
                    </div>
                </td>
            </tr>
            <tr>
                <td>*Land:<br /> <a href="javascript:;" class="show_hide1">Lägg till ett nytt land</a></td>
                <td>
                    <select name="country">
                        <?php 
            printCountryOptions($country);
            ?>
                    </select>
                    <br />
                    <div class="slidingDiv1" style="display: block;">
                        <input name="country_new" type="text" />
                    </div>
                </td>
            </tr>
            <tr>
                <td>Notering:</td>
                <td><input type="text" name="notes" value="<?php 
            echo $notes;
            ?>
" /></td>
            </tr>
            <tr>
                <td>
                    <input type="submit" value="Genomf&ouml;r &auml;ndring"></form><br /><br />
                    <a href="javascript:;" class="show_hide3">Ta bort</a><br /><br />
                    <div class="slidingDiv3" style="display: block;">
                        <b>Detta kan inte ångras</b>
                        <form action="function/process_remove.php" method="post">
                            <input type="hidden" name="id" value="<?php 
            echo $ida;
            ?>
" />
                            <input type="submit" value="Jag förstår">
                        </form>
                    </div>
                </td>
                <td>&nbsp;</td>
            </tr>
        </table>
        <br>
        <a href="edit.php?id=<?php 
            echo $ida;
            ?>
&type=admin">Administrativ redigering</a>
    <?php 
        }
    }
    if ($type == 'admin') {
        include 'function/metal_functions.php';
        include 'function/db_connect.php';
        $query = "SELECT * FROM coin_bases WHERE id = ?";
        if ($stmt = $mysqli->prepare($query)) {
            $stmt->bind_param('i', $ida);
            $stmt->execute();
            $stmt->bind_result($id, $A_ID, $rowd, $year, $quality, $value, $type, $country, $country_id, $notes, $weight, $quantity, $metal_id, $metal_value, $file_folder, $is_roll);
            $stmt->fetch();
            $stmt->store_result();
            $stmt->close();
        }
        $mysqli->close();
        if ($id) {
            ?>
        <form action="function/process_edit.php" method="post">
            <input type="hidden" name="id" value="<?php 
            echo $id;
            ?>
" />
            <table width="400" border="0" class="smalltable">
                <tr>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                </tr>
                <tr>
                    <td>*Ark-ID:</td>
                    <td><input name="A_ID" type="text" maxlength="5" value="<?php 
            echo $A_ID;
            ?>
" required /></td>
                </tr>

                    <tr>
                        <td>*Rad:</td>
                        <td><input name="row" type="text" maxlength="3" value="<?php 
            echo $rowd;
            ?>
" /></td>
                    </tr>

                <tr>
                    <td>*&Aring;r:</td>
                    <td><input name="year" type="text" maxlength="4" value="<?php 
            echo $year;
            ?>
" required /></td>
                </tr>
                <tr>
                    <td>*Kvalit&eacute;:</td>
                    <td><?php 
            printQualityOption($quality);
            ?>
</td>
                </tr>
                <tr>
                    <td>*V&auml;rde:</td>
                    <td>
                            Absolut värde:&nbsp;
                            <input type="text" name="value" value="<?php 
            if ($value == 0) {
                echo "";
            } else {
                echo $value;
            }
            ?>
" />
                            Antal:  <select name="quantity">
                                <?php 
            if ($quantity === NULL) {
                echo "<option value=\"\">Ej valt</option>";
            }
            printNumbersOption($quantity);
            ?>
                            </select>
                            <hr/>
                            Metall: <select name="metal_id">
                                <?php 
            if ($metal_id === NULL) {
                echo "<option value=\"\">Ej valt</option>";
            }
            printMetaltypes($metal_id);
            ?>
                            </select>
                            <br/>
                            Vikt (ex: 0.875): <input name="weight" type="text" value="<?php 
            echo $weight;
            ?>
" />
                        <?php 
        }
        ?>
                    </td>
                </tr>
                <tr>
                    <td>*Val&ouml;r:<br /><a href="javascript:;" class="show_hide">Lägg till en ny valör</a></td>
                    <td>
                        <select name="type">
                            <?php 
        printTypeOptions($type);
        ?>
                        </select>
                        <br />
                        <div class="slidingDiv" style="display: block;">
                            <input name="type_new" type="text" />
                        </div>
                    </td>
                </tr>
                <tr>
                    <td>*Land:<br /> <a href="javascript:;" class="show_hide1">Lägg till ett nytt land</a></td>
                    <td>
                        <select name="country">
                            <?php 
        printCountryOptions($country_id);
        ?>
                        </select>
                        <br />
                        <div class="slidingDiv1" style="display: block;">
                            <input name="country_new" type="text" />
                        </div>
                    </td>
                </tr>
                <tr>
                    <td>Notering:</td>
                    <td><input type="text" name="notes" value="<?php 
        echo $notes;
        ?>
" /></td>
                </tr>
                <tr>
                    <td>
                        <input type="submit" value="Genomf&ouml;r &auml;ndring"></form><br /><br />
        <a href="javascript:;" class="show_hide3">Ta bort</a><br /><br />
        <div class="slidingDiv3" style="display: block;">
            <b>Detta kan inte ångras</b>
            <form action="function/process_remove.php" method="post">
                <input type="hidden" name="id" value="<?php 
        echo $ida;
        ?>
" />
                <input type="submit" value="Jag förstår">
            </form>
        </div>
        </td>
        <td>&nbsp;</td>
        </tr>
        </table>
        <br>
        <a href="edit.php?id=<?php 
        echo $ida;
        ?>
&type=normal">Vanlig redigering</a>
    <?php 
    }
}
Example #2
0
        Vikt (ex: 0.875): <input name="weight" type="text" />
        </div></td>
	</tr>
    <tr>
        <td>*Land:</td>
        <td><select name="country">
                <?php 
printCountryOptions('Sverige');
?>
            </select>
        </td>
    </tr>
	<tr>
		<td>*Val&ouml;r:</td>
		<td><select name="type"><?php 
printTypeOptions(0);
?>
</select>
        </td>
	</tr>
	<tr>
		<td>Notering:</td>
		<td><input type="text" name="notes" /></td>
	</tr>
	<tr>
		<td><input type="submit" value="L&auml;gg till mynt" /></td>
		<td></td>
	</tr></table></form><br />
Förslag på nytt ID för rulle:<?php 
getAIDplusoneroll();
?>
Example #3
0
function edit($ide)
{
    if ($ide) {
        ?>
        <form action="function/process_edit.php" method="post">
            <input type="hidden" name="id" value="<?php 
        echo $ide;
        ?>
" />
            <table width="400" border="0" class="smalltable">
                <tr>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                </tr>
                <tr>
                    <td>*Ark-ID:</td>
                    <td><input name="A_ID" type="text" maxlength="5" value="<?php 
        echo $eA_ID;
        ?>
" required /></td>
                </tr>

                <?php 
        if ($erow !== NULL) {
            ?>
                    <tr>
                        <td>*Rad:</td>
                        <td><input name="row" type="text" maxlength="3" value="<?php 
            echo $erow;
            ?>
" required /></td>
                    </tr>
                <?php 
        }
        ?>

                <tr>
                    <td>*&Aring;r:</td>
                    <td><input name="year" type="text" maxlength="4" value="<?php 
        echo $eyear;
        ?>
" required /></td>
                </tr>
                <tr>
                    <td>*Kvalit&eacute;:</td>
                    <td><?php 
        printQualityOption($equality);
        ?>
</td>
                </tr>
                <tr>
                    <td>*V&auml;rde:</td>
                    <td>
                        <?php 
        if ($evalue !== NULL) {
            ?>
                            Absolut värde:&nbsp;
                            <input type="text" name="value" value="<?php 
            if ($evalue == 0) {
                echo "";
            } else {
                echo $evalue;
            }
            ?>
" />
                        <?php 
        }
        if ($metal_id !== NULL) {
            ?>
                            Antal:  <select name="quantity">
                                <?php 
            if ($equantity === NULL) {
                echo "<option value=\"\">Ej valt</option>";
            }
            printNumbersOption($equantity);
            ?>
                            </select>
                            <hr/>
                            Metall: <select name="metal_id">
                                <?php 
            if ($metal_id === NULL) {
                echo "<option value=\"\">Ej valt</option>";
            }
            printMetaltypes($metal_id);
            ?>
                            </select>
                            <br/>
                            Vikt (g, ex: 875): <input name="weight" type="text" value="<?php 
            echo $eweight;
            ?>
" />
                        <?php 
        }
        ?>
                    </td>
                </tr>
                <tr>
                    <td>*Val&ouml;r:<br /><a href="javascript:;" class="show_hide">Lägg till en ny valör</a></td>
                    <td>
                        <select name="type">
                            <?php 
        printTypeOptions($etype);
        ?>
                        </select>
                        <br />
                        <div class="slidingDiv" style="display: block;">
                            <input name="type_new" type="text" />
                        </div>
                    </td>
                </tr>
                <tr>
                    <td>*Land:<br /> <a href="javascript:;" class="show_hide1">Lägg till ett nytt land</a></td>
                    <td>
                        <select name="country">
                            <?php 
        printCountryOptions($ecountry);
        ?>
                        </select>
                        <br />
                        <div class="slidingDiv1" style="display: block;">
                            <input name="country_new" type="text" />
                        </div>
                    </td>
                </tr>
                <tr>
                    <td>Notering:</td>
                    <td><input type="text" name="notes" value="<?php 
        echo $enotes;
        ?>
" /></td>
                </tr>
                <tr>
                    <td>
                        <input type="submit" value="Genomf&ouml;r &auml;ndring"></form><br /><br />
        <a href="javascript:;" class="show_hide3">Ta bort</a><br /><br />
        <div class="slidingDiv3" style="display: block;">
            <b>Detta kan inte ångras</b>
            <form action="function/process_remove.php" method="post">
                <input type="hidden" name="id" value="<?php 
        echo $ide;
        ?>
" />
                <input type="submit" value="Jag förstår">
            </form>
        </div>
        </td>
        <td>&nbsp;</td>
        </tr>
        </table>
    <?php 
    }
}
Example #4
0
<table class="searchtableoption">
	<tr>
		<td><h2 style="margin:9px">Sök</h2><hr /></td>
		<td>&nbsp;</td>
		<td>&nbsp;</td>
		<td>&nbsp;</td>
	</tr>
	<tr>
		<td class="table70">Ark-ID:</td>
		<td class="table200"><input type="text" name="A_ID" value="<?php 
echo $A_ID;
?>
" /></td>
		<td>Valör:</td>
		<td><select name="type"><option value="">Inget specificerat</option><?php 
printTypeOptions($type);
?>
</select></td>
	</tr>
	<tr>
		<td class="table70">Kvalit&eacute;:</td>
		<td><?php 
printQualityOption($quality);
?>
</td>
		<td>Land:</td>
		<td><select name="country"><option value="">Inget specificerat</option><?php 
printCountryOptions($country);
?>
</select></td>
	</tr>