4e9fed755c
New static qr types: - App Link: Android intent:// links (with package + optional browser fallback) or a generic custom-scheme URI. iOS Universal Links need no special encoding (they're just plain https:// URLs). - Bluetooth: device name + MAC address. Purely informational, since unlike WIFI:/vCard there's no OS-native "scan to pair" convention. SVG export: already worked (format whitelist/dropdown existed since Fase 1), verified rather than reimplemented. Copy-to-clipboard button next to the download button on both qr list tables, using the Clipboard API against a fetched blob. Optional frame text label rendered below the qr code via GD after generation (raster formats only, no-op for svg/eps). Batch CSV upload (batch_qrcode.php): filename,link rows create dynamic qr codes with sane defaults, downloadable as a zip. Required refactoring Qrcode-intchil.php's generation path (previously always redirected/exited via failure()/success(), which can't run in a loop) into a private renderAndStore() that throws instead, shared by addQrcode() and the new addQrcodeBatch(). Qrcode.php's addQrcodeBatch() is a separate, deliberately duplicated implementation instead, since its generation logic is small enough that duplication carries less risk than refactoring the working external-API code path.
129 lines
5.0 KiB
PHP
129 lines
5.0 KiB
PHP
<div class="col-sm-12 mb-2">
|
|
<div class="row">
|
|
<div class="col-6 col-md-3">
|
|
<label for="foreground">Foreground:</label>
|
|
<div class="input-group my-colorpicker2">
|
|
<div class="input-group-prepend">
|
|
<span class="input-group-text"><i class="fa fa-qrcode"></i></span>
|
|
</div>
|
|
|
|
<input type="text" class="form-control" id="foreground" name="foreground" value="#000000">
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-6 col-md-3">
|
|
<label for="background">Background:</label>
|
|
<div class="input-group my-colorpicker2">
|
|
<div class="input-group-prepend">
|
|
<span class="input-group-text"><i class="fa fa-qrcode"></i></span>
|
|
</div>
|
|
|
|
<input type="text" class="form-control" id="background" name="background" value="#ffffff">
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-6 col-md-3">
|
|
<label for="level">Precision</label>
|
|
<select name="level" class="form-control">
|
|
<option value="L">L - Smallest</option>
|
|
<option value="M">M - Medium</option>
|
|
<option value="Q">Q - High</option>
|
|
<option value="H">H - Best</option>
|
|
</select>
|
|
</div>
|
|
|
|
<div class="col-6 col-md-3">
|
|
<label for="size">Size (px)</label>
|
|
<select name="size" class="form-control">
|
|
<option value="100">100</option>
|
|
<option value="200">200</option>
|
|
<option value="300">300</option>
|
|
<option value="400">400</option>
|
|
<option value="500">500</option>
|
|
<option value="600">600</option>
|
|
<option value="700">700</option>
|
|
<option value="800">800</option>
|
|
<option value="900">900</option>
|
|
<option value="1000">1000</option>
|
|
<?php
|
|
if (QRCODE_GENERATOR === "internal-chillerlan.qrcode") {
|
|
echo ' <option value="2000">2000</option>';
|
|
}
|
|
?>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Its use is not recommended. Read the documentation
|
|
<div class="form-group">
|
|
<label for="logo">Logo</label>
|
|
<?php //include 'logo.php' ?>
|
|
</div>
|
|
-->
|
|
|
|
<div class="col-sm-12 mb-2">
|
|
<div class="row">
|
|
<div class="col-sm-4">
|
|
<div class="form-group">
|
|
<label for="filename">Filename *</label>
|
|
<input type="text" name="filename" value="" placeholder="My first Qrcode" class="form-control error" required="required" id = "filename">
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-6 col-md-1">
|
|
<label for="format">Format</label>
|
|
<select name="format" class="form-control">
|
|
<option value="png">PNG</option>
|
|
<option value="gif">GIF</option>
|
|
<option value="jpeg">JPEG</option>
|
|
<option value="jpg">JPG</option>
|
|
<option value="svg">SVG</option>
|
|
<?php
|
|
if (QRCODE_GENERATOR === "internal-chillerlan.qrcode") {
|
|
echo ' <option value="svgbw">SVG (BW)</option>';
|
|
}
|
|
?>
|
|
<option value="eps">EPS</option>
|
|
</select>
|
|
</div>
|
|
|
|
<div class="col-sm-4">
|
|
<div class="form-group">
|
|
<label for="frame_text">Frame text</label>
|
|
<input type="text" name="frame_text" value="" placeholder="e.g. Scan me" maxlength="60" class="form-control" id="frame_text">
|
|
<small class="form-text text-muted">Optional label rendered below the code. Only applies to PNG/JPEG/GIF, not SVG/EPS.</small>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<?php if($_SESSION['type'] === 'super') { ?>
|
|
<div class="col-sm-12 mb-2">
|
|
<div class="row">
|
|
<div class="col-sm-4">
|
|
<div class="form-group">
|
|
<label for="id_owner">Owner *</label>
|
|
<select name="id_owner" class="form-control">
|
|
<option value="" selected>All</option>
|
|
<?php
|
|
|
|
require_once BASE_PATH . '/lib/Users/Users.php';
|
|
$users_instance = new Users();
|
|
$users = $users_instance->getAllUsers();
|
|
|
|
foreach ($users as $user) {
|
|
?>
|
|
<option value="<?php echo $user["id"];?>"><?php echo $user["username"];?></option>
|
|
<?php } ?>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<?php } else { ?>
|
|
<input type="hidden" name="id_owner" value="<?php echo $_SESSION["user_id"];?>"/>
|
|
<?php } ?>
|
|
<br>
|