自动化收据号码
我正在尝试制作收据印刷网站。我希望能够递增收据号这是好的,因为我们倾向于忘记最后的数字。我一直在互联网上寻找解决方案,但没有找到任何解决方案。请给我一些帮助吗?这是我的收据的样子: 在说“ recu n 2839”的地方,我希望通过订单自动生成数字。 这是我的表单代码:
<!DOCTYPE html>
<html>
<head>
<title>Reçu</title>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-eOJMYsd53ii+scO/bJGFsiCZc+5NDVN2yr8+0RDqr0Ql0h+rP48ckxlpbzKgwra6" crossorigin="anonymous">
<link rel="stylesheet" href="PdfStyles.css">
<link rel="icon" type="image/x-icon" href="img/schoolicon.png">
</head>
<body>
<style>
body {
background-image: url('img/backo.jpg');
}
</style>
<br>
<br>
<div class="hero">
<div class="mt-5">
<form action="pdfmaker.php" method="post" class=" offset-md-3 col-md-6" style="text-align:center;">
<h1 style="color:white">Création de reçu</h1>
<div class="row mb-2 ">
<div class="col-md-6 mb-2"><input type="text" name="nrecu" placeholder="Numéro Reçu" class="form-control" required></div>
<div class="col-md-6"><input type="text" name="fname" placeholder="Élève" class="form-control" required></div>
<div class="col-md-6 mb-2"><input type="text" name="nClass" placeholder="Classe" class="form-control" required></div>
<div class="col-md-6 mb-2"><input type="text" name="Moi" placeholder="Mois" class="form-control" required></div>
<div class="col-md-6 mb-2"><input type="text" name="Mont" placeholder="Montant" class="form-control"></div>
<div class="col-md-6"><input type="text" name="anne" placeholder="Année scolaire" class="form-control" required></div>
<div class="col-md-6 mb-2"><input type="text" name="total" placeholder="Total" class="form-control" required></div>
<div class="col-md-6 mb-2"><form action="/pdfmaker.php">
<label style="font-family:fantasy;font-size:15px"for="cars">Mode de paimenet:</label>
<select name="mode" id="mod">
<option value="Espèce - نقدا">Espèce - نقدا</option>
<option value="Chèque - صك بنكي">Chèque - صك بنكي </option>
<option value="Carte Bancaire - بطاقة بنكية">Carte Bancaire - بطاقة بنكية</option>
</select>
<br><br>
</form></div>
<button style="background-color: #8064A2 !important; font-family:fantasy;font-size:30px" type="submit" class="btn btn-success btn-lg btn-block">Imprimer</button>
</form>
</div>
</div>
</body>
</html>
“ nrecu
” div是一个照顾数字的div:
<div class="col-md-6 mb-2"><input type="text" name="nrecu" placeholder="Numéro Reçu" class="form-control" required></div>
我相信我能够从此代码中实现我想要的东西,但是如果没有,我将包括生成PDF的PDF制造商代码。
这是处理该数字的PDF生成代码的一部分: 首先:
$nrecu=$_POST['nrecu'];
第二:
<p style="text-align:center;font-family:monospace;">Reçu N° '.$nrecu.' ايصال رقم </p>
任何帮助都将被提出。
I'm trying to make a receipt printing website. I want to be able to increment the receipt number each type a new receipt gets printed, for example, first time ever printing, the number will be 1, second time 2, etc. The numbers should not repeat automatically, because doing this manually wouldn't be good since we tend to forget the last number we were on. I have been looking on the Internet for solutions but I have not found any. Please may I have some help? here is what my receipt looks like:
in the place that says "recu n 2839" I want there to be an automatically generated number by order.
here is my form code:
<!DOCTYPE html>
<html>
<head>
<title>Reçu</title>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-eOJMYsd53ii+scO/bJGFsiCZc+5NDVN2yr8+0RDqr0Ql0h+rP48ckxlpbzKgwra6" crossorigin="anonymous">
<link rel="stylesheet" href="PdfStyles.css">
<link rel="icon" type="image/x-icon" href="img/schoolicon.png">
</head>
<body>
<style>
body {
background-image: url('img/backo.jpg');
}
</style>
<br>
<br>
<div class="hero">
<div class="mt-5">
<form action="pdfmaker.php" method="post" class=" offset-md-3 col-md-6" style="text-align:center;">
<h1 style="color:white">Création de reçu</h1>
<div class="row mb-2 ">
<div class="col-md-6 mb-2"><input type="text" name="nrecu" placeholder="Numéro Reçu" class="form-control" required></div>
<div class="col-md-6"><input type="text" name="fname" placeholder="Élève" class="form-control" required></div>
<div class="col-md-6 mb-2"><input type="text" name="nClass" placeholder="Classe" class="form-control" required></div>
<div class="col-md-6 mb-2"><input type="text" name="Moi" placeholder="Mois" class="form-control" required></div>
<div class="col-md-6 mb-2"><input type="text" name="Mont" placeholder="Montant" class="form-control"></div>
<div class="col-md-6"><input type="text" name="anne" placeholder="Année scolaire" class="form-control" required></div>
<div class="col-md-6 mb-2"><input type="text" name="total" placeholder="Total" class="form-control" required></div>
<div class="col-md-6 mb-2"><form action="/pdfmaker.php">
<label style="font-family:fantasy;font-size:15px"for="cars">Mode de paimenet:</label>
<select name="mode" id="mod">
<option value="Espèce - نقدا">Espèce - نقدا</option>
<option value="Chèque - صك بنكي">Chèque - صك بنكي </option>
<option value="Carte Bancaire - بطاقة بنكية">Carte Bancaire - بطاقة بنكية</option>
</select>
<br><br>
</form></div>
<button style="background-color: #8064A2 !important; font-family:fantasy;font-size:30px" type="submit" class="btn btn-success btn-lg btn-block">Imprimer</button>
</form>
</div>
</div>
</body>
</html>
the "nrecu
" div is the one that takes care of the number, this line:
<div class="col-md-6 mb-2"><input type="text" name="nrecu" placeholder="Numéro Reçu" class="form-control" required></div>
and I believe I'd be able to achieve what I wanted just from this code, but if not, i'll include the pdf maker code, that generates the pdf.
this is the part of the pdf generation code that handles that number:
first:
$nrecu=$_POST['nrecu'];
second:
<p style="text-align:center;font-family:monospace;">Reçu N° '.$nrecu.' ايصال رقم </p>
any help will be apperciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以尝试执行该php创建文件,如果不存在,并且在每个打印上都会更新其中的值。这应该看起来像:
现在您只需要在您的HTML中设置价值,
希望这对您有所帮助。
you could try to do that PHP create a file if not exists and on every print update the value in it. This should look like:
and now you just need to set the value in you html
Hope this helped.