a:2:{i:0;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:4:"menu";s:4:"nome";s:0:"";s:4:"tipo";s:0:"";s:5:"parms";s:0:"";s:6:"codigo";s:968:"$update_sql = "
UPDATE doit
SET invoice='{invoice}', it='{item}',status='$'
WHERE smit='$smit'";
sc_exec_sql($update_sql);

$update_sql = "
UPDATE n3case
SET invoice='[var_invoice]', it='[var_item]'
WHERE smit='$smit'";
sc_exec_sql($update_sql);

$filename='/var/www/veratex.vrtxinc.com/myfile_'.date('m-d-Y_hisa');
	$output_sql = "
select 'Invoice','Dye Order','Dye Lot','Style','Color','Width','-----Case----',' ','-Yds' 
union 
select invoice,p_o_number,dye_lot,style,color,width,`case`,suffix,yds 
INTO OUTFILE '$filename' 
FROM n3case where n3case.invoice='[var_invoice]' and n3case.it='[var_item]'
";
sc_exec_sql($output_sql);
$save_outfile="	
UPDATE item
SET memo = LOAD_FILE('$filename'),
cases=(select count(*) from n3case where invoice = '[var_invoice]' and item='[var_item]')
WHERE invoice = '[var_invoice]' and item='[var_item]'
";
sc_exec_sql($save_outfile);	
sc_redir(fv2_billing_item_single_form,invoice='[var_invoice]');

";}i:1;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:4:"menu";s:4:"nome";s:9:"onExecute";s:4:"tipo";s:1:"E";s:5:"parms";s:0:"";s:6:"codigo";s:1435:"$clear_table = 'Truncate table fairlanevrtx2.dyeorder';
$import_table = 'INSERT INTO fairlanevrtx2.dyeorder SELECT * FROM fairlanevrtx.dyeorder';
sc_exec_sql($clear_table);
sc_exec_sql($import_table);

$clear_table = 'Truncate table fairlanevrtx2.dorec';
$import_table = 'INSERT INTO fairlanevrtx2.dorec SELECT * FROM fairlanevrtx.dorec';
sc_exec_sql($clear_table);
sc_exec_sql($import_table);

$clear_table = 'Truncate table fairlanevrtx2.fgstock';
$import_table = 'INSERT INTO fairlanevrtx2.fgstock SELECT * FROM fairlanevrtx.fgstock';
sc_exec_sql($clear_table);
sc_exec_sql($import_table);




$clear_table = 'Truncate table fairlanevrtx2.n3case';
$import_table = 'INSERT INTO fairlanevrtx2.n3case SELECT * FROM fairlanevrtx.n3case';
sc_exec_sql($clear_table);
sc_exec_sql($import_table);
$clear_out=
"
DELETE FROM n3case WHERE (p_o_number>10000 AND p_o_number<>'NA')
";
sc_exec_sql($clear_out);

$clear_out=
"
DELETE FROM n3case WHERE (grade='11' OR grade = '12')
";
sc_exec_sql($clear_out);
$clear_out=
"
DELETE FROM dyeorder WHERE (p_o_number=000001 OR p_o_number='01233')
";
sc_exec_sql($clear_out);


$clear_out=
"
DELETE FROM dorec WHERE (dye_lot='') or (yards_recd=0)
";
sc_exec_sql($clear_out);
$update_sql="
UPDATE n3case
INNER JOIN item ON n3case.invoice = item.invoice
SET n3case.it=item.item,n3case.smit=item.smit
";
sc_exec_sql($update_sql);
echo 'Initialized.';


";}}