S
Silver_Soul
Afternoon
This CSV file doesn't work and i don't know why? This page is refered
to by another page by a href link. This page should show the link to
the CSV file.
---------------------------------------------
<%
var tlist = new TradeList()
var fso = Server.CreateObject("Scripting.FileSystemObject");
var fo = Server.MapPath("/admin/user_csv") + "\\" ;
var d = new Date();
var fname = "user_csv_" + d.getDate() + "-" +
Utils.MONTH[d.getMonth()] + "-" + d.getYear() + ".csv";
%>
<html>
<head>
<title>Admin Section</title>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
<link href="admin.css" rel="stylesheet" type="text/css">
</head>
<body>
<!-- #include file="top.asp" -->
<tr>
<td align="center" bgcolor="#FFFFFF" style="padding:15px;"><p
class="title">Click below to create a User.CSV </p>
<%
if (!tlist.EOF) {
var totalPayout = 0;
var i = 1;
var tfile = fso.createTextFile(fo + fname,true);
tfile.writeLine("ID,USERNAME,PASSWORD,FIRSTNAME,LASTNAME,GENDER,EMAIL,ADDRESS1,ADDRESS2,TOWN,COUNTY,POSTCODE,PHONE,USERTYPE,STATUS,ENVIROPOINTS,HEARDABOUTFROM,OPTOUT,BUSINESS,DOB,CONFIRMED_ENVIROPOINTS,EARNER_TOTAL,DATE_JOINED,EARNER_ID,PROMO_CODE,CHARITY_DETAILS,NEW_PHONE_DUE");
// Load User
var user = new User()
user.loadFromId(tradeItem.userId,conn);
// Write Line in from user class to CSV
tfile.writeLine(
user.id + "," +
user.username + "," +
user.password + "," +
user.firstname + "," +
user.lastname + "," +
user.gender + "," +
user.email + "," +
user.username + "," +
user.address1 + "," +
user.address2 + "," +
user.town + "," +
user.county + "," +
user.postcode + "," +
user.phone + "," +
user.usertype + "," +
user.status + "," +
user.enviropoints + "," +
user.heardabout + "," +
user.optout + "," +
user.business + "," +
user.dob + "," +
user.confirmedpints + "," +
user.earnerTotal + "," +
user.dateJoined + "," +
user.earnerId + "," +
user.promoCode + "," +
user.charityDetails + "," +
user.newPhoneDue);
;
if (counter >= lowerRec && counter <= higherRec) {
recsDisplayed++;
}
tlist.moveNext();
counter++;
tfile.close();
}
%>
<p class="title">
<%
if (fso.fileExists(fo + fname)) {
Response.Write("inside the loop");
Response.Write("<a href=\"/admin/user_csv/" + fname +"\"
target=\"blank\">" + fname + "</a>");
Response.Write("going out of the loop");
}
%>
</p>
<p><a href="index.asp">Return to Admin Home</a></p>
</td>
</tr>
-----------------
I don't know why this doesn;t work? has anyone got any ideas?
Cheers
Nick
This CSV file doesn't work and i don't know why? This page is refered
to by another page by a href link. This page should show the link to
the CSV file.
---------------------------------------------
<%
var tlist = new TradeList()
var fso = Server.CreateObject("Scripting.FileSystemObject");
var fo = Server.MapPath("/admin/user_csv") + "\\" ;
var d = new Date();
var fname = "user_csv_" + d.getDate() + "-" +
Utils.MONTH[d.getMonth()] + "-" + d.getYear() + ".csv";
%>
<html>
<head>
<title>Admin Section</title>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
<link href="admin.css" rel="stylesheet" type="text/css">
</head>
<body>
<!-- #include file="top.asp" -->
<tr>
<td align="center" bgcolor="#FFFFFF" style="padding:15px;"><p
class="title">Click below to create a User.CSV </p>
<%
if (!tlist.EOF) {
var totalPayout = 0;
var i = 1;
var tfile = fso.createTextFile(fo + fname,true);
tfile.writeLine("ID,USERNAME,PASSWORD,FIRSTNAME,LASTNAME,GENDER,EMAIL,ADDRESS1,ADDRESS2,TOWN,COUNTY,POSTCODE,PHONE,USERTYPE,STATUS,ENVIROPOINTS,HEARDABOUTFROM,OPTOUT,BUSINESS,DOB,CONFIRMED_ENVIROPOINTS,EARNER_TOTAL,DATE_JOINED,EARNER_ID,PROMO_CODE,CHARITY_DETAILS,NEW_PHONE_DUE");
// Load User
var user = new User()
user.loadFromId(tradeItem.userId,conn);
// Write Line in from user class to CSV
tfile.writeLine(
user.id + "," +
user.username + "," +
user.password + "," +
user.firstname + "," +
user.lastname + "," +
user.gender + "," +
user.email + "," +
user.username + "," +
user.address1 + "," +
user.address2 + "," +
user.town + "," +
user.county + "," +
user.postcode + "," +
user.phone + "," +
user.usertype + "," +
user.status + "," +
user.enviropoints + "," +
user.heardabout + "," +
user.optout + "," +
user.business + "," +
user.dob + "," +
user.confirmedpints + "," +
user.earnerTotal + "," +
user.dateJoined + "," +
user.earnerId + "," +
user.promoCode + "," +
user.charityDetails + "," +
user.newPhoneDue);
;
if (counter >= lowerRec && counter <= higherRec) {
recsDisplayed++;
}
tlist.moveNext();
counter++;
tfile.close();
}
%>
<p class="title">
<%
if (fso.fileExists(fo + fname)) {
Response.Write("inside the loop");
Response.Write("<a href=\"/admin/user_csv/" + fname +"\"
target=\"blank\">" + fname + "</a>");
Response.Write("going out of the loop");
}
%>
</p>
<p><a href="index.asp">Return to Admin Home</a></p>
</td>
</tr>
-----------------
I don't know why this doesn;t work? has anyone got any ideas?
Cheers
Nick