<?php
include ("include/db.php");
$b_nos="00000";
 $sqls="SELECT * from jobcard_main where main_id>='875' order by main_id asc ";
$rs11=mysql_query($sqls);
while($row11=mysql_fetch_object($rs11))
{  
$main_id=$row11->main_id;
$date=date("Y");
$st_date=substr($date,2);
$month=date("m");	   
$datee=$st_date.$month;
       $b_nos=$b_nos+00001;
		if($b_nos<=9)
		{
		$billno = 'JC-'.$datee.'-000'.$b_nos;
		}
		if($b_nos>9)
		{
		$billno = 'JC-'.$datee.'-00'.$b_nos;
		}
		if($b_nos>99)
		{
		$billno = 'JC-'.$datee.'-0'.$b_nos;
		}
	
    $Upsql1="update jobcard_main set jobcard_no='$billno' where main_id='$main_id'";
    mysql_query($Upsql1);
}
?>