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> </td> <td> </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>*År:</td> <td><input name="year" type="text" maxlength="4" value="<?php echo $year; ?> " required /></td> </tr> <tr> <td>*Kvalité:</td> <td><?php printQualityOption($quality); ?> </td> </tr> <tr> <td>*Värde:</td> <td> <?php if ($value !== NULL) { ?> Absolut värde: <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ö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ör ä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> </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> </td> <td> </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>*År:</td> <td><input name="year" type="text" maxlength="4" value="<?php echo $year; ?> " required /></td> </tr> <tr> <td>*Kvalité:</td> <td><?php printQualityOption($quality); ?> </td> </tr> <tr> <td>*Värde:</td> <td> Absolut värde: <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ö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ör ä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> </td> </tr> </table> <br> <a href="edit.php?id=<?php echo $ida; ?> &type=normal">Vanlig redigering</a> <?php } }
<tr> <td> </td> <td> </td> </tr> <tr> <td>*Ark-ID:</td> <td><input name="A_ID" type="text" maxlength="5" required /></td> </tr> <tr> <td>*År:</td> <td><input name="year" type="text" maxlength="4" required /></td> </tr> <tr> <td>*Kvalité:</td> <td><?php printQualityOption(0); ?> </td> </tr> <tr> <td>Värde: <br /><a href="javascript:;" class="show_hide3">Basera värde endast på metallvärdet</a></td> <td>Absolut värde: <input name="value" type="text" /><br /> <hr /> Antal: <select name="quantity"><?php printNumbersOption(0); ?> </select> <div class="slidingDiv3" style="display: block;"><hr/> Metall: <select name="metal_id"><option value="0">Välj</option><?php printMetaltypes(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> </td> <td> </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>*År:</td> <td><input name="year" type="text" maxlength="4" value="<?php echo $eyear; ?> " required /></td> </tr> <tr> <td>*Kvalité:</td> <td><?php printQualityOption($equality); ?> </td> </tr> <tr> <td>*Värde:</td> <td> <?php if ($evalue !== NULL) { ?> Absolut värde: <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ö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ör ä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> </td> </tr> </table> <?php } }
<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é:</td> <td><?php printQualityOption($quality); ?> </td> <td>Land:</td> <td><select name="country"><option value="">Inget specificerat</option><?php printCountryOptions($country); ?> </select></td> </tr> <tr> <td class="table70">År:</td> <td><input type="text" name="year" value="<?php echo $year; ?> " /></td> <td class="table100">Är en rulle:</td>