<?
function set_num12($ems){
//echo "ems=".$ems;
//echo "<br>";
$num1=substr($ems,0,1);
$num2=substr($ems,1,1);
$num3=substr($ems,2,1);
$num4=substr($ems,3,1);
$num5=substr($ems,4,1);
$num6=substr($ems,5,1);
$num7=substr($ems,6,1);
$num8=substr($ems,7,1);
$num9=substr($ems,8,1);
$num10=substr($ems,9,1);
$num11=substr($ems,10,1);
$num12=substr($ems,11,1);
switch($num11){
case 0:
case 1:
case 2:
case 3:
case 4:
case 5:
case 6:
case 7:
case 8:
$num12+=9;
$num12=$num12%10;
//echo "num11=".$num11."<br>";
break;
case 9:
switch($num10){
case 0:
case 1:
case 2:
case 4:
case 5:
case 7:
case 8:
$num12+=6;
$num12=$num12%10;
break;
case 3:
case 6:
$num12+=5;
$num12=$num12%10;
break;
case 9:
switch($num9){
case 0:
case 2:
case 4:
case 6:
case 8:
$num12+=3;
$num12=$num12%10;
break;
case 1:
case 3:
case 5:
case 7:
$num12+=2;
$num12=$num12%10;
break;
case 9:
switch($num8){
php文件下载源码 case 0:
case 3:
case 6:
$num12+=0;
$num12=$num12%10;
break;
case 1:
case 2:
case 4:
case 5:
case 7:
case 8:
$num12+=9;
$num12=$num12%10;
break;
case 9:
switch($num7){
case 0:
$num12+=7;
$num12=$num12%10;
break;
case 1:
case 2:
case 3:
case 4:
case 5:
case 6:
case 7:
case 8:
$num12+=6;
$num12=$num12%10;
break;
case 9:
switch($num6){
case 0:
case 1:
case 2:
case 3:
case 4:
case 5:
case 6:
case 7:
case 8:
$num12+=3;
$num12=$num12%10;
break;
case 9:
switch($num5){
case 0:
case 1:
case 2:
case 4:
case 5:
case 7:
case 8:
$num12+=9;
$num12=$num12%10;
break;
case 3:
case 6:
$num12+=8;
$num12=$num12%10;
break;
case 9:
switch($num4){
case 0:
case 2:
case 4:
case 6:
case 8:
$num12+=5;
$num12=$num12%10;
break;
case 1:
case 3:
case 5:
case 7:
$num12+=4;
$num12=$num12%10;
break;
}
break;
}
break;
}
break;
}
break;
}
break;
}
break;
}
break;
}
return $num12;
}
function sf($ems,$num){
$num1=substr($ems,0,1);
$num12=substr($ems,11,1);
if($num1==0)$sf_dh=substr($ems,1,10);
else
$sf_dh=substr($ems,0,11);
$ok=$ems;
for($i=0;$i<$num;$i++){
//echo "num12=".$num12;
//echo "<br>";
if($num1==0){
$ok='0'.$sf_dh.$num12;
}
else{
$ok=$sf_dh.$num12;
}
$num12=set_num12($ok);
$sf_dh++;
echo "<tr><td>";
echo $ok;
echo "</td></tr>";
}
}
if($sc=="生成"){
echo "<table>";
sf($ems,$num);
echo "</table>";
}
>
<form name="ems" method="post" action="">
开始单号:<input type="text" value="" name="ems" size="12"> 生成数量:<input type="text" value="10" name="num" size="5"><input type="submit" name="sc" value="生成">
</form>
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论