<?php
        session_cache_expire(1440);
        session_start();
        session_name("insys");
        include "include/config.php";
        include "include/functions.php";
        include "class/UctVw.php";
        $ssql="select ftemployee_code,fdstart_date,fnstatus 
                        from tlemployee
                        where ftemployee_code like '%-%'
                order by fnid ";
        $rs=mysql_query($ssql);
        $ssql1=array();
         mysql_query("BEGIN");
        while($r=mysql_fetch_assoc($rs)) {
            $_REQUEST['fnstatus']=$r['fnstatus'];
            $fttrans_no=getAutoNumber("hrd008","tlemployee","ftemployee_code",CDateRev($r['fdstart_date']));
            $ssql="update tlemployee set ftemployee_code='{$fttrans_no}' where  ftemployee_code='{$r['ftemployee_code']}'";
             $ssql1[]=$ssql;
            mysql_query($ssql);
            $ssql="update tlemployee_load set ftemployee_code='{$fttrans_no}' where  ftemployee_code='{$r['ftemployee_code']}'";
             $ssql1[]=$ssql;
            mysql_query($ssql);
            $ssql="update tlemployee_notes set ftemployee_code='{$fttrans_no}' where  ftemployee_code='{$r['ftemployee_code']}'";
             $ssql1[]=$ssql;
            mysql_query($ssql);
            $ssql="update tlemployee_salary_inc set ftemployee_code='{$fttrans_no}' where  ftemployee_code='{$r['ftemployee_code']}'";
             $ssql1[]=$ssql;
            mysql_query($ssql);
             $ssql="update tlemployee_salary_dec set ftemployee_code='{$fttrans_no}' where  ftemployee_code='{$r['ftemployee_code']}'";

            $ssql1[]=$ssql;
            mysql_query($ssql);
        }
          #mysql_query("COMMIT");
          pr($ssql1);