🚀 Advanced Web Server Manager
Complete File Manager & Terminal - Standalone Version
By Sid Gifari | Gifari Industries
Current path:
/
/
home
/
users
/
2
/
fujibow
/
web
/
@180914
/
solution
/
fujibow
/
Whole_System
✏️
Editing: Make_CooperCSV.cgi
#!/usr/bin/perl #*********************************************************** # ���ϲ�ҥޥ����ǡ���������� #*********************************************************** #=====�������============================================== use dbAccess1; #DB����⥸�塼�� require './cgi-lib.pl'; #http�ѥ⥸�塼�� #=====�ѿ���============================================== # DB�ǡ������Ǽ�������� my (@CooperData); # DB���˻��Ѥ����ѿ� my ($sql); # ���ѥ����� my ($i,$j); #=====main���============================================== { my $download_file = 'temp.csv'; # ��������ɤ���ե�����̾ open(OUT,">$download_file"); print OUT "���ϲ�ҥ�����(�ٻ�),�䲰������,���ϲ�ҥ�����(�䲰)\n"; undef @CooperData; #����ޥ����ǡ������Ƽ�� $sql = "SELECT * FROM Cooper_Co_M"; @CooperData = dbAccess1::getSelect_data($sql); for($i=0; $i<scalar(@CooperData); $i=$i+4) { print OUT "$CooperData[$i]"; print OUT ",$CooperData[$i+1]"; print OUT ",$CooperData[$i+3]"; print OUT "\n"; } close(OUT); print "Content-Type: application/octet-stream\n"; print "Content-Disposition: attachment; filename=Cooper_Co_M.csv\n\n"; # ��ܸ쥳�����Ѵ���Ԥ� $wStr = `nkf -sc $download_file > Cooper_Co_M.csv`; open(FILE, "Cooper_Co_M.csv") || die; binmode(FILE); print <FILE>; close(FILE); }
💾 Save Changes
❌ Cancel