bubble sort!?

J

joesindel

So heres the deal...
I work for a company in which numbers are dropping. The owners created
a game where calling potential clients racks up points for crap like
basketball ticekts and such. The owners called upon me to develop a
system where users could enter information to list user name, data
stamp it, and then add form data such as the person they called and if
it was a cold call or not. All that was pretty easy. Oh, by the by, I
had never programmed anything prior to this. I was strictly html. So I
made the game... Users enter data, gets dropped into a csv in our
_private folder. Then I made it so that the data can be read in html
format, simple fso... Well not for me, but I got it to work... So now,
the owner wants this list to be sortable by the last name of the
agent....
This is where I have the problem.
You see, I have a boss, a programmer. He is in Canada where as I am in
California. He is far to busy to assist me, and his teaching methods
consist of telling me one key word, and leaving me to google the hell
out of it. So his key work was bubble sort.
Now I have been playing with this for,,, well over a week now (a few
days past deadline) and I cannot get it to work properly.
I can get bubble sort to work on an array of pre-defined data...
My problem( which I have taken forever to get to, sorry) is that I need
to get it to look at the whole csv, find out where the eof is, then
read up from there...
I have no idea how to do this, and no jedi like mentor to ask
assistance. I ask for help and either get harped at or a "lol"... Its
getting old...

Here is the code for the game
++++++++++++++++++++++++++++++++++
<script language="vbscript">
sub referrals_onchange()
DIM intCounter
for intCounter = 1 to 5
if CInt(document.all.item("referrals").value) >= intCounter
then

document.all.item("referral_"&intCounter).style.display="block"
else
document.all.item("referral_"&
intCounter).style.display="none"
end if
next
end sub
</script>
</head>

<body>
<table border="1" cellpadding="0" cellspacing="0"
style="border-collapse: collapse" bordercolor="#111111"
id="AutoNumber1" bgcolor="#C0C0C0">
<tr>
<td width="100%" colspan="3">


<img src="../images/1newbanner.jpg" width="513" height="57"><form
method="POST" name="FrontPage_Form1" action="--WEBBOT-SELF--"
target="_self">
<!--webbot bot="SaveResults" u-file="../_private/game.csv"
s-format="TEXT/CSV" s-label-fields="TRUE" b-reverse-chronology="FALSE"
s-date-format="%d-%m-%Y" s-time-format="%I:%M:%S %p"
s-builtin-fields="Date Time" startspan --><input TYPE="hidden"
NAME="VTI-GROUP" VALUE="0"><!--webbot bot="SaveResults" endspan
i-checksum="43374" --><p>
<font face="Arial" size="2" color="#000066">Welcome
<!--webbot bot="HTMLMarkup" startspan --><span
id="lblCurrentUserName"></span><!--webbot bot="HTMLMarkup" endspan
--></font></p>
<hr>
<p>
<font face="Arial"><font size="2" color="#000066">Please enter
the name of the agent with whom you made contact:<br>
First Name: </font><font color="#000066">
<!--webbot bot="Validation" s-data-type="String"
b-allow-letters="TRUE" i-maximum-length="15" --><input type="text"
name="agentFname" size="20" maxlength="15"></font><font size="2"
color="#000066"><br>
Last Name: </font><font color="#000066">
<!--webbot bot="Validation" s-data-type="String"
b-allow-letters="TRUE" i-maximum-length="20" --><input type="text"
name="agentLname" size="20" maxlength="20"></font></font></p>
<hr>
<p>
<font face="Arial"><font size="2" color="#000066">Please enter
the agents phone number:<br>
</font><font color="#000066">
<!--webbot bot="Validation" s-data-type="Number"
s-number-separators="x." b-value-required="TRUE" i-minimum-length="10"
i-maximum-length="10" --><input type="text" name="agentNumber"
size="20" maxlength="10"></font><font size="2" color="#000066">
( </font><font size="1" color="#FF0000">must have 10 digits
</font><font size="2" color="#000066">
)</font></font></p>
<p>
<font face="Arial"><font size="2" color="#000066">What is the
agents e-mail address:<br>
</font><font color="#000066">
<input type="text" name="agentEmail" size="40"></font></font></p>
<p>
<font face="Arial"><font size="2" color="#000066">Please select a
category which best describes the agent with whom you made
contact:<br>
Active Agent </font><font color="#000066"> <input type="radio"
value="active" checked name="agentType"></font><font size="2"
color="#000066">
Inactive Agent </font><font color="#000066"> <input type="radio"
name="agentType" value="inactive"></font><font size="2"
color="#000066">Cold
Call</font><font color="#000066"><input type="radio"
name="agentType" value="cold"></font></font></p>
<p>
<font face="Arial" color="#000066" size="2">How many referrals
this agent
give you?<br>
<select size="1" name="referrals">
<option value="0">0</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
</select></font></p>
<p>
&nbsp;</p>
<p>
<input type="text" name="referral_1" size="20"
style="display:none"></p>
<p>
<input type="text" name="referral_2" size="20"
style="display:none"></p>
<p>
<input type="text" name="referral_3" size="20"
style="display:none"></p>
<p>
<input type="text" name="referral_4" size="20"
style="display:none"></p>
<p>
<input type="text" name="referral_5" size="20"
style="display:none"></p>
<hr>
<p>
<font color="#000066" face="Arial"><input type="submit"
value="Submit" name="B1"><input type="reset" value="Reset"
name="B2"></font></p>
<input type="hidden" name="uname" value="hidden">
</form>
</td>
</tr>


</table>

<iframe src="date_user.asp" width="80%" height=100 frameborder=0
scrolling=no name="date_time" styke="display: none">

</iframe>

++++++++++++++++++++++++++++++++++++++++++
this is the code for data_user.asp
++++++++++++++++++++++++++++++++++++++++++
<script language="vbscript">

dim txtUserName
txtUserName = "<% = (Session("UserName")) %>"

Sub window_onload()
window.parent.document.all.item("uname").value = txtUserName
window.parent.document.all.item("lblCurrentUserName").InnerText =
txtUserName
end sub

</script>

++++++++++++++++++++++++++++++++++++
this is the admin page i am trying to create
+++++++++++++++++++++++++++++++++++++

<b><font color="#000066" face="Arial">Marketing Contest Results
<%
csv_to_read="../_private/game.csv"
set fso = createobject("scripting.filesystemobject")
set act = fso.opentextfile(server.mappath(csv_to_read))
imported_text = act.readline
imported_text = replace(imported_text,chr(13),",")
imported_text = replace(imported_text,chr(34),"")
split_text=split(imported_text,",")
num_imported=ubound(split_text)+1
total_imported_text = act.readall
total_imported_text = replace(total_imported_text,chr(13),",")
total_imported_text = replace(total_imported_text,chr(34),"")
total_split_text=split(total_imported_text,",")
total_num_imported=ubound(total_split_text)
%>
</font>
</b>
<table width="100%"border="1" cellpadding="0" cellspacing="0"
style="border-collapse: collapse" bordercolor="#111111" >
<tr>

<%
for table = 0 to num_imported -1
%>

<td width="<% response.write 100/(num_imported) 'make the cell widths
even %>%"bgcolor="#C0C0C0">
<font face="Arial" size="1" color="#000066">
<b><%= split_text(count) %></b>
&nbsp;</td>
<%
count=count+1
next
%>
</tr>
<tr>
<font face="Arial" size="1" color="#000066">
<%
'Reset the counter
count=0
for tablea = 0 to (total_num_imported/ (num_imported)-1)
%>
<%
for table = 0 to num_imported -1
%>

<td width="<%= 100/(num_imported) %>%">

<font face="Arial" size="1" color="#000066">
<%= total_split_text(count)
%>

</font>

&nbsp;</td>
<%
count=count+1
next ' end of the observation
%>
</tr>
<% next 'end of the csv %>
</table>


+++++++++++++++++++++++++++++++++++++++++++++++++
so there it is...
I no Im lame...
I have no idea how to do any of this, but do not remember it being in
my job description either.
Either way, I have to learn or Im gone...
All advice will be appreciated.
Thanks very much,
- joe
 
M

Mike Brind

So heres the deal...

Users enter data, gets dropped into a csv in our
_private folder.

the owner wants this list to be sortable by the last name of the
agent....
This is where I have the problem.

My problem( which I have taken forever to get to, sorry) is that I need
to get it to look at the whole csv, find out where the eof is, then
read up from there...
I have no idea how to do this, and no jedi like mentor to ask
assistance.

++++++++++++++++++++++++++++++++++++
this is the admin page i am trying to create
+++++++++++++++++++++++++++++++++++++
<%
csv_to_read="../_private/game.csv"
set fso = createobject("scripting.filesystemobject")
set act = fso.opentextfile(server.mappath(csv_to_read))
imported_text = act.readline
imported_text = replace(imported_text,chr(13),",")
imported_text = replace(imported_text,chr(34),"")
split_text=split(imported_text,",")
num_imported=ubound(split_text)+1
total_imported_text = act.readall
total_imported_text = replace(total_imported_text,chr(13),",")
total_imported_text = replace(total_imported_text,chr(34),"")
total_split_text=split(total_imported_text,",")
total_num_imported=ubound(total_split_text)
for table = 0 to num_imported -1
%>

<td>
<%= split_text(count) %></td>
<%
count=count+1
next
%>
</tr>
<tr>
<%
'Reset the counter
count=0
for tablea = 0 to (total_num_imported/ (num_imported)-1)
%>
<%
for table = 0 to num_imported -1
%>

<td>

<%= total_split_text(count)%>
</td>
<%
count=count+1
next ' end of the observation
%>
</tr>
<% next 'end of the csv %>
</table>


+++++++++++++++++++++++++++++++++++++++++++++++++
so there it is...
I no Im lame...
I have no idea how to do any of this, but do not remember it being in
my job description either.
Either way, I have to learn or Im gone...
All advice will be appreciated.
Thanks very much,
- joe

Can you provide the structure of your csv file? Eg. Title, Firstname,
Surname etc...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,053
Latest member
BrodieSola

Latest Threads

Top