Current location: Hot Scripts Forums » Programming Languages » ASP » Help


Help

Reply
  #1 (permalink)  
Old 09-09-04, 10:10 PM
highland dreaming highland dreaming is offline
Newbie Coder
 
Join Date: Sep 2004
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Unhappy Help

Hi,

I need some help with some ASP coding. I am currently in charge of updating a website, but I have absolutely no ASP experience, so I don't have a clue as to what to do.

The person before me set up all the rules etc... but now I am having problems with the ASP code.

What the code is meant to do is bring up a photo of a person depending on their id number?.... if there is no picture for them, then another picture comes up. Here is the code...

<%$strFile = "/images/teacher/". $f_id. ".jpg"; if (file_exists($strFile)) {
%><img src="/images/teacher/<%=$f_id%>.jpg"><%
} else {
%><img src="/images/teacher/printing.gif"><%}

can anyone help me out with this, i have absolutely NOOO idea what the hell to do

really frustrated Highland Dreaming
Reply With Quote
  #2 (permalink)  
Old 09-10-04, 12:19 AM
PromptLogic PromptLogic is offline
Newbie Coder
 
Join Date: Sep 2004
Posts: 33
Thanks: 0
Thanked 0 Times in 0 Posts
Well, that code would almost work fine in PHP without the tags of course. Here are a couple of notes that might help you out with ASP

1. Variables in ASP do not use the $ sign
2. When dealing with files, you need to create a file system object first
3. Its easier to to write out what you need as opposed to switching between ASP and HTML. It just makes it easier to read.

Here is the modified code. Just drop this into your html and be sure the file name extension is .asp

PHP Code:

<%

Set FSO Server.CreateObject("Scripting.FileSystemObject"
Dim ParameterValue ParameterValue = Empty
Dim strFile 
ParameterValue 
Request.QueryString("f_id")
strFile "images/teacher/printing.gif" 
If Not IsEmpty(ParameterValueThen 
   
If FSO.FileExists(Server.MapPath("images/teacher/" ParameterValue ".jpg")) Then _ 
      strFile 
"images/teacher/" ParameterValue ".jpg" 
End if           
Response.Write "<img src='" strFile "'>"
%> 
Here is a line by line explanaition of what is going on:
1. Initialize our File System Object
2. Intialize our parameter variable
3. Initialize our image mame variable
4. Use request.querystring to retrieve our f_id variable. Same as $_GET in PHP
5. Set a default image
6. If our f_id parameter is not empty then...
7. Does our file exist on the server?
8. It exists so we set our strFile to that image
9. End our checks
10. Echo out our result. If the f_id parameter was passed to the script and the image exists on the server, that is what is displayed. Otherwise, the default images is what is displayed

Let me know if that works for you. Good luck!
Reply With Quote
  #3 (permalink)  
Old 09-10-04, 12:35 AM
highland dreaming highland dreaming is offline
Newbie Coder
 
Join Date: Sep 2004
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
It doesn't seem to have worked, now when I go to the page, it comes up with a message `please close the window` that is all, and doesn't diplay anything else
Reply With Quote
  #4 (permalink)  
Old 09-10-04, 12:44 AM
PromptLogic PromptLogic is offline
Newbie Coder
 
Join Date: Sep 2004
Posts: 33
Thanks: 0
Thanked 0 Times in 0 Posts
Could you post either a link to this page, the full source to the page or better yet...both. I tried it on my server and works fine so I guess I would need to see what else is going on with your page to be able to help you.
Reply With Quote
  #5 (permalink)  
Old 09-10-04, 12:48 AM
highland dreaming highland dreaming is offline
Newbie Coder
 
Join Date: Sep 2004
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
sure no worries - i must warn you it is really long

meta http-equiv="content-type" content="text/html;charset=shift_jis">
<%
$strPopup = "";
if (isset($this_popup) && $this_popup) $strPopup = "_popup";

$f_id = getRequest("f_id", 0);
if ($f_id <= 0) {
Header("Location: /kensaku" . $strPopup . ".asp?f_cmd=list&GSID=" . session_id());
exit;
}
$strSQL = "SELECT * FROM tbl_lecturer WHERE id = " . $f_id;
$strSQL .= " AND (type = '1' OR type = '2')";
$arrLecturer = $g_pDB->GetArrayValue($strSQL);
if (!$arrLecturer) {
Header("Location: /kensaku" . $strPopup . ".asp?f_cmd=list&GSID=" . session_id());
exit;
}
$strSQL = "SELECT * FROM tbl_lecturer_profile WHERE id = " . $f_id;
$arrProfile = $g_pDB->GetArrayValue($strSQL);
$strSQL = "SELECT * FROM tbl_teach_type WHERE id = " . $f_id;
$arrTeachType = $g_pDB->GetArrayValue($strSQL);

$strSQL = "SELECT * FROM tbl_teach_levels WHERE id = " . $f_id;
$arrTeachLevels = $g_pDB->GetArrayValue($strSQL);

$strSQL = "SELECT * FROM tbl_teach_ages WHERE id = " . $f_id;
$arrTeachAges = $g_pDB->GetArrayValue($strSQL);

$strSQL = "SELECT * FROM tbl_teach_style WHERE id = " . $f_id;
$arrTeachStyle = $g_pDB->GetArrayValue($strSQL);

$strSQL = "SELECT art, business, computers, cooking, dancing, environmental, fashion, finances, food_drink, health, history, interior_design, karaoke, lesbian_issues, movies, museums, music, news, pets, politics, reading, science, shopping, sports, photography, travel_around_japan, travel, volunteering FROM tbl_hobbies_interests WHERE id = " . $f_id;
$arrHobbies = $g_pDB->GetArrayValue($strSQL);

function getBoolValue(&$arrTable, &$arrFields, &$arrValues)
{
$strBuf = "";
for ($n=0; $n<count($arrFields); $n++) {
if ($arrTable[$arrFields[$n]]) {
if ($strBuf != "") $strBuf .= "/";
$strBuf .= $arrValues[$n];
}
}
return $strBuf;
}

function putValue($strValue)
{
if (isset($strValue) && !empty($strValue))
echo $strValue;
else
echo "&nbsp";
}

function putValueJ($arrParam, $strField)
{
if (isset($arrParam[$strField . "_j"])) {
echo $arrParam[$strField . "_j"];
} else if (isset($arrParam[$strField])) {
echo $arrParam[$strField];
} else {
%>&nbsp;<%
}
}

$f_start = getRequest("f_start", 0);
%>
<table width="600" border="0" cellspacing="0" cellpadding="3" align="center">
<tr>
<td colspan="2" height="15"></td>
</tr>
<tr>
<td width="195"><img src="/images/japanese/syousai.gif" height="15" width="105"></td>
<td width="393"><img src="/images/japanese/line_sikaku.gif" height="9" width="387"></td>
</tr>
</table>
<table width="600" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td height="10"></td>
</tr>
<tr>
<td align="right"><%
if ($arrLecturer["type"] != 2) {
%><a href="/kensaku<%=$strPopup%>.asp?f_cmd=rlist&f_add=<%=$f_ id%>&f_start=<%=$f_start%>">▼この講師を予約する</a>&nbsp;<%
} else {
%><a href='<%=$_SERVER["SCRIPT_NAME"]%>?f_id=<%=$f_id%>&f_start=<%=$f_start%>'>▼この講師を予約 する</a>&nbsp;<%
}
%><a href="/kensaku<%=$strPopup%>.asp">▼条件検索に戻る</a>&nbsp;<%
%><a href="/kensaku<%=$strPopup%>.asp?f_cmd=list&f_start=<%=$f _start%>">▼リストに戻る</a><%
%></td>
</tr>
</table>
<table width="620" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td colspan="2" height="25"></td>
</tr>
<tr align="center">
<td colspan="2"><%
if ($g_pDB->GetOneValue("SELECT TO_DAYS(now()) - TO_DAYS(upd_date) FROM tbl_lecturer WHERE id = " . $f_id, 15) < 14
|| $g_pDB->GetOneValue("SELECT TO_DAYS(now()) - TO_DAYS(upd_date) FROM tbl_lecturer_profile WHERE id = " . $f_id, 15) < 14
|| $g_pDB->GetOneValue("SELECT TO_DAYS(now()) - TO_DAYS(upd_date) FROM tbl_teach_ages WHERE id = " . $f_id, 15) < 14
|| $g_pDB->GetOneValue("SELECT TO_DAYS(now()) - TO_DAYS(upd_date) FROM tbl_teach_levels WHERE id = " . $f_id, 15) < 14
|| $g_pDB->GetOneValue("SELECT TO_DAYS(now()) - TO_DAYS(upd_date) FROM tbl_teach_style WHERE id = " . $f_id, 15) < 14
|| $g_pDB->GetOneValue("SELECT TO_DAYS(now()) - TO_DAYS(upd_date) FROM tbl_teach_type WHERE id = " . $f_id, 15) < 14
|| $g_pDB->GetOneValue("SELECT TO_DAYS(now()) - TO_DAYS(upd_date) FROM tbl_teach_schedule WHERE id = " . $f_id, 15) < 14
|| $g_pDB->GetOneValue("SELECT MIN(TO_DAYS(now()) - TO_DAYS(upd_date)) FROM tbl_employment_exp WHERE lecturer_id = " . $f_id, 15) < 14
|| $g_pDB->GetOneValue("SELECT MIN(TO_DAYS(now()) - TO_DAYS(upd_date)) FROM tbl_qualifications WHERE lecturer_id = " . $f_id, 15) < 14
|| $g_pDB->GetOneValue("SELECT MIN(TO_DAYS(now()) - TO_DAYS(upd_date)) FROM tbl_schedule WHERE lecturer_id = " . $f_id, 15) < 14
|| $g_pDB->GetOneValue("SELECT MIN(TO_DAYS(now()) - TO_DAYS(upd_date)) FROM tbl_stay_other WHERE lecturer_id = " . $f_id, 15) < 14
|| $g_pDB->GetOneValue("SELECT MIN(TO_DAYS(now()) - TO_DAYS(upd_date)) FROM tbl_teach_lang WHERE lecturer_id = " . $f_id, 15) < 14
|| $g_pDB->GetOneValue("SELECT MIN(TO_DAYS(now()) - TO_DAYS(upd_date)) FROM tbl_teach_loc WHERE lecturer_id = " . $f_id, 15) < 14
|| $g_pDB->GetOneValue("SELECT MIN(TO_DAYS(now()) - TO_DAYS(upd_date)) FROM tbl_teaching_exp WHERE lecturer_id = " . $f_id, 15) < 14) {
%>この講師の情報は最新です。<%
} else {
%><font color="#FF0000">この講師は2週間以上、情報を更新していません。なるべく情報の新しい講 師を選びましょう。</font><%
}
%></td>
</tr>
<tr>
<td width="236"> </td>
<td width="364"> </td>
</tr>
<tr>
<td align="center" valign="top" width="236">
<table width="180" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<table width="150" border="0" cellspacing="0" cellpadding="0" height="150">
<tr>

<td align="center"> <%
$strFile = "/images/teacher/". $f_id. ".jpg";
if (file_exists($strFile)) {
%><img src="/images/teacher/<%=$f_id%>.jpg"><%
} else {
%><img src="/images/teacher/printing.gif"><%
}
%>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td height="25"> </td>
</tr>
</table>
<table width="180" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><b>私の性格(英文)</b></td>
</tr>
<tr>
<td><%putValueJ($arrProfile, "personality")%></td>
</tr>
<tr>
<td height="35"> </td>
</tr>
</table>
<table width="180" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><b>メッセージ(英文)</b></td>
</tr>
<tr>
<td><%putValueJ($arrProfile, "comments")%></td>
</tr>
<tr>
<td height="35"> </td>
</tr>
</table>
<table width="180" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><b>趣味・興味</b></td>
</tr>
<tr>
<td><%putValueJ($arrProfile, "hobbies")%></td>
</tr>
<tr>
<td height="35"> </td>
</tr>
</table>
</td>
<td valign="Top" width="364">
<table border="0" cellspacing="0" cellpadding="0" bgcolor="#000000">
<tr>
<td>
<table width="350" border="0" cellspacing="1" cellpadding="3">
<tr>
<td colspan="2" bgcolor="#eeeeee"><b><font color="#000066">講師情報</font></b></td>
</tr>
<tr>
<td bgcolor="#FFFFFF" width="160">名前(ニックネーム)</td>
<td bgcolor="#FFFFFF" width="190"><%
if (isset($arrProfile["nick_name"]))
echo $arrProfile["nick_name"];
else
echo $arrLecturer["last_name"];
echo "(ID:" . sprintf("%04d", $arrLecturer["id"]) . ")";
%></td>
</tr>
<%if (isset($arrProfile["nick_name_j"]) && !empty($arrProfile["nick_name_j"])) {%>
<tr>
<td bgcolor="#FFFFFF">カタカナ</td>
<td bgcolor="#FFFFFF"><%=$arrProfile["nick_name_j"]%></td>
</tr>
<%}%>
<tr>
<td bgcolor="#FFFFFF">国籍</td>
<td bgcolor="#FFFFFF"><%=$g_pDB->GetOneValue("SELECT name FROM tbl_nation WHERE id = " . $arrLecturer["nation_id"])%></td>
</tr>
<tr>
<td bgcolor="#FFFFFF">年齢</td>
<td bgcolor="#FFFFFF"><%
if (isset($arrProfile["age"]) && $arrProfile["age"] > 0)
echo $arrProfile["age"];
else
echo $g_pDB->GetOneValue("SELECT (YEAR(CURRENT_DATE)-YEAR(birthday)) - (RIGHT(CURRENT_DATE,5)<RIGHT(birthday,5)) AS age FROM tbl_lecturer WHERE id = " . $f_id);
%></td>
</tr>
<tr>
<td bgcolor="#FFFFFF">日本での滞在期間</td>
<td bgcolor="#FFFFFF"><%=$arrProfile["stay_length"]%></td>
</tr>
<tr>
<td bgcolor="#FFFFFF">日本語スキル</td>
<td bgcolor="#FFFFFF"><%
$arrJapaneseAbility = array("出来ない", "基礎", "普通", "良好", "完璧");
if (isset($arrProfile["japanese_ability"]))
echo $arrJapaneseAbility[$arrProfile["japanese_ability"]];
else
echo $arrJapaneseAbility[0];
%></td>
</tr>
<tr>
<td bgcolor="#FFFFFF">他国での滞在経験</td>
<td bgcolor="#FFFFFF"><%
$arrStayOther = $g_pDB->GetArrayValue("SELECT * FROM tbl_stay_other WHERE lecturer_id = " . $f_id);
if ($arrStayOther) {
putValueJ($arrStayOther, "country");
putValueJ($arrStayOther, "howlong");
} else {
%>&nbsp;<%
}
%></td>
</tr>
<tr>
<td bgcolor="#FFFFFF">趣味・興味</td>
<td bgcolor="#FFFFFF"><%
$bHobbies = false;
while (list($key, $value) = each($arrHobbies)) {
if ($value == 1) {
$bHobbies = true;
break;
}
}
if ($bHobbies) {
$arrFields = array("art", "business", "computers", "cooking", "dancing", "environmental", "fashion", "finances", "food_drink", "health", "history", "interior_design", "karaoke", "lesbian_issues", "movies", "museums", "music", "news", "pets", "politics", "reading", "science", "shopping", "sports", "photography", "travel_around_japan", "travel", "volunteering");
$arrValues = array("Art", "Business", "Computers", "Cooking", "Dancing", "Environmental issues", "Fashion", "Finances", "Food and drink", "Health", "History", "Interior design", "Karaoke", "Lesbian issues", "Movies", "Museums", "Music", "News", "Pets", "Politics", "Reading", "Science", "Shopping", "Sports", "Photography", "Travel around Japan", "Travel overseas", "Volunteering");
putValue(getBoolValue($arrHobbies, $arrFields, $arrValues));
} else
putValueJ($arrProfile, "hobbies")
%></td>
</tr>
<tr>
<td bgcolor="#FFFFFF">教えたことのある言語</td>
<td bgcolor="#FFFFFF"><%putValueJ($arrProfile, "languages_taught")%></td>
</tr>
</table>
</td>
</tr>
</table>
<img src="/images/spacer.gif" height="20" width="1">
<table border="0" cellspacing="0" cellpadding="0" bgcolor="#000000">
<tr>
<td>
<table width="350" border="0" cellspacing="1" cellpadding="3">
<tr>
<td colspan="2" bgcolor="#eeeeee"><b><font color="#000066">授業と料金について</font></b></td>
</tr>
<%if ($arrProfile["fee1"] > 0) {%>
<tr>
<td bgcolor="#FFFFFF" width="120">基本(1人)</td>
<td bgcolor="#FFFFFF"><%=number_format($arrProfile["fee1"])%>円/1時間</td>
</tr>
<%}%><%if ($arrProfile["fee2"] > 0) {%>
<tr>
<td bgcolor="#FFFFFF">複数の場合</td>
<td bgcolor="#FFFFFF">1人<%=number_format($arrProfile["fee2"])%>円/1時間</td>
</tr>
<%}%><%if ($arrProfile["fee3"] > 0) {%>
<tr>
<td bgcolor="#FFFFFF">追加の場合</td>
<td bgcolor="#FFFFFF">1人<%=number_format($arrProfile["fee3"])%>円/1時間</td>
</tr>
<%}%><%/*%>
<tr>
<td bgcolor="#FFFFFF">複数人での授業</td>
<td bgcolor="#FFFFFF"><%
if (!$arrTeachType["group_"]) echo("不");
%>可能</td>
</tr>
<%*/%>
<tr>
<td bgcolor="#FFFFFF">授業対象1</td>
<td bgcolor="#FFFFFF"><%
$arrFields = array("beginner", "intermidiate", "advanced");
$arrValues = array("初級", "中級", "上級");
putValue(getBoolValue($arrTeachLevels, $arrFields, $arrValues));
%></td>
</tr>
<tr>
<td bgcolor="#FFFFFF">授業対象2</td>
<td bgcolor="#FFFFFF"><%
$arrFields = array("childrens", "teenagers", "adults");
$arrValues = array("子供", "十代", "大人");
putValue(getBoolValue($arrTeachAges, $arrFields, $arrValues));
%></td>
</tr>
<tr>
<td bgcolor="#FFFFFF">授業項目</td>
<td bgcolor="#FFFFFF"><%
$arrFields = array("business", "travel_essentials", "conversation", "vocabulary", "pronunciation", "writing", "reading", "listening", "grammar", "individual", "group_");
$arrValues = array("ビジネス", "旅行", "会話", "語彙", "発音", "作文", "読み", "聞き", "文法", "個人", "グループ");
putValue(getBoolValue($arrTeachType, $arrFields, $arrValues));
%></td>
</tr>
<tr>
<td bgcolor="#FFFFFF">授業スタイル</td>
<td bgcolor="#FFFFFF"><%
$arrFields = array("informal", "formal", "structured", "flexible", "games", "textbooks", "worksheets", "books", "newspapers", "magazines");
$arrValues = array("カジュアル", "フォーマル", "Structured", "Flexible", "ゲーム", "教材", "Worksheets", "本", "新聞", "雑誌");
putValue(getBoolValue($arrTeachStyle, $arrFields, $arrValues));
%></td>
</tr>
</table>
</td>
</tr>
</table>
<img src="/images/spacer.gif" height="20" width="1"></td>
</tr>
</table>
<table width="600" border="0" cellspacing="0" cellpadding="0" align="center" height="40">
<tr>
<td colspan="2">
<table width="585" border="0" cellspacing="0" cellpadding="0" bgcolor="#000000">
<tr>
<td>
<table width="100%" border="0" cellspacing="1" cellpadding="3">
<tr>
<td colspan="4" bgcolor="#eeeeee"><b><font color="#000066">資格について</font></b></td>
</tr>
</table>
</td>
</tr>
<%
$strSQL = "SELECT * FROM tbl_qualifications WHERE lecturer_id = " . $f_id;
$result = $g_pDB->ExecuteSQL($strSQL);
if ($result) {
while ($arrRow = $g_pDB->FetchArray($result)) {
%>
<tr><%
%>
<td valign="top" bgcolor="#FFFFFF" width="67"><%
putValueJ($arrRow, "completed_year");
%></td>
<%
%>
<td bgcolor="#FFFFFF" width="189"><%
putValueJ($arrRow, "qualification");
%></td>
<%
%>
<td bgcolor="#FFFFFF" width="180"><%
putValueJ($arrRow, "facility");
%></td>
<%
%>
<td bgcolor="#FFFFFF" width="109"><%
putValueJ($arrRow, "country");
%></td>
<%
%></tr>
<%
}
}
$g_pDB->FreeResult($result);
%>
</table>
</td>
</tr>
</table>
</td>
<td width="2"> </td>
</tr>
<tr>
<td width="491" height="35"> </td>
<td width="280" height="35"> </td>
<td width="2" height="35"> </td>
</tr>
</table>
<table width="600" border="0" cellspacing="0" cellpadding="0" align="center" height="40">
<tr>
<td colspan="2">
<table width="585" border="0" cellspacing="0" cellpadding="0" bgcolor="#000000">
<tr>
<td>
<table width="100%" border="0" cellspacing="1" cellpadding="3">
<tr>
<td colspan="3" bgcolor="#eeeeee"><b><font color="#000066">職歴について</font></b></td>
</tr>
<%
$strSQL = "SELECT * FROM tbl_employment_exp WHERE lecturer_id = " . $f_id;
$result = $g_pDB->ExecuteSQL($strSQL);
if ($result) {
while ($arrRow = $g_pDB->FetchArray($result)) {
%>
<tr><%
%>
<td valign="top" bgcolor="#FFFFFF" width="108"><%
putValueJ($arrRow, "dates");
%></td>
<%
%>
<td bgcolor="#FFFFFF" width="225"><%
putValueJ($arrRow, "employers");
%></td>
<%
%>
<td bgcolor="#FFFFFF" width="225"><%
putValueJ($arrRow, "position");
%></td>
<%
%></tr>
<%
}
}
$g_pDB->FreeResult($result);
%>
</table>
</td>
</tr>
</table>
</td>
<td width="2"> </td>
</tr>
<tr>
<td width="491" height="35"> </td>
<td width="280" height="35"> </td>
<td width="2" height="35"> </td>
</tr>
</table>
<table width="600" border="0" cellspacing="0" cellpadding="0" align="center" height="40">
<tr>
<td colspan="2">
<table width="585" border="0" cellspacing="0" cellpadding="0" bgcolor="#000000">
<tr>
<td>
<table width="100%" border="0" cellspacing="1" cellpadding="3">
<tr>
<td colspan="3" bgcolor="#eeeeee"><b><font color="#000066">授業の経験</font></b></td>
</tr>
<%
$strSQL = "SELECT * FROM tbl_teaching_exp WHERE lecturer_id = " . $f_id;
$result = $g_pDB->ExecuteSQL($strSQL);
if ($result) {
while ($arrRow = $g_pDB->FetchArray($result)) {
%>
<tr><%
%>
<td valign="top" bgcolor="#FFFFFF" width="108"><%
putValueJ($arrRow, "dates");
%></td>
<%
%>
<td bgcolor="#FFFFFF" width="225"><%
putValueJ($arrRow, "employers");
%></td>
<%
%>
<td bgcolor="#FFFFFF" width="225"><%
putValueJ($arrRow, "position");
%></td>
<%
%></tr>
<%
}
}
$g_pDB->FreeResult($result);
%>
</table>
</td>
</tr>
</table>
</td>
<td width="2"> </td>
</tr>
<tr>
<td width="491" height="35"> </td>
<td width="280" height="35"> </td>
<td width="2" height="35"> </td>
</tr>
</table>
<table width="600" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td width="585">■授業可能な時間</td>
<td bgcolor="#FFFFFF"> </td>
</tr>
<tr>
<td bgcolor="#333333" width="585">
<table class="cnt1" width="585" border="0" cellspacing="1" cellpadding="3">
<tr bgcolor="#FFFFCC">
<td>&nbsp;</td>
<%
$arrWeek = array("日", "月", "火", "水", "木", "金", "土");
for ($n=0; $n<count($arrWeek); $n++) {
%>
<td align="center"><%=$arrWeek[$n] . "曜日"%></td>
<%
}

$dtToday = getdate();
$tmNext = mktime(0, 0, 0, $dtToday['mon'] + 2, 0, $dtToday['year']);
$dtLast = getdate($tmNext);
$nTotal = ($dtLast['yday'] - $dtToday['yday']) / 7;
%></tr>
<%
$arrFieldsJ = array("午前", "午後", "5時以降");
$arrFields = array("morning", "afternoon", "evening");
if ($arrRow = $g_pDB->GetArrayValue("SELECT * FROM tbl_teach_schedule WHERE id = " . $f_id)) {
for ($m=0; $m<count($arrFields); $m++) {
%>
<tr>
<td bgcolor="#CCFFFF"><%=$arrFieldsJ[$m]%></td>
<%
for ($n=0; $n<7; $n++) {
%>
<td align="center" bgcolor="#FFFFFF"><%
$nCount = $g_pDB->GetOneValue("SELECT " . $arrFields[$m] . $n . " FROM tbl_teach_schedule WHERE id = " . $f_id);
if ($nCount == 2)
echo "○";
else if ($nCount == 1)
echo "△";
else
echo "×";
%></td>
<%
}
%></tr>
<%
}
} else {
for ($m=0; $m<count($arrFields); $m++) {
%>
<tr>
<td bgcolor="#CCFFFF"><%=$arrFieldsJ[$m]%></td>
<%
for ($n=1; $n<=7; $n++) {
%>
<td align="center" bgcolor="#FFFFFF"><%
$nCount = $g_pDB->GetOneValue("SELECT COUNT(id) FROM tbl_schedule WHERE " . $arrFields[$m] . " = 1 AND DAYOFWEEK(schedule_date) = " . $n . " AND schedule_date > now() AND lecturer_id = " . $f_id);
if ($nCount == 0)
echo "×";
else if ($nCount == 1)
echo "△";
else
echo "○";
%></td>
<%
}
%></tr>
<%
}
}
%>
</table>
</td>
<td bgcolor="#FFFFFF"><img src="/images/spacer.gif" height="1" width="10"></td>
</tr>
</table>
<table width="600" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td valign="bottom" height="20">
<div align="right">○ほぼ空いてます/△だいたい大丈夫/×空いてません</div>
</td>
<td width="15"> </td>
</tr>
</table>
<table width="600" border="0" cellspacing="0" cellpadding="0" align="center" height="45">
<tr>
<td>
<div class="cnt2" align="right">
<font color="#FF0000">プライバシー保護のため、一部の情報は伏せてあります。</font></div>
</td>
</tr>
</table>
<table width="600" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td>この講師が気に入った時は予約を入れましょう!3人まで選んでから体験レッスンの申し込みを行いま す。</td>
</tr>
<tr>
<td>
<table border="0">
<tr>
<td><%if ($arrLecturer["type"] != 2) {%>
<form style="margin-top:0px;margin-bottom:0px" action="/kensaku<%=$strPopup%>.asp" method="POST" name="frmAdd">
<input type="hidden" name="f_cmd" value="rlist"> <input type="hidden" name="f_add" value="<%=$f_id%>"> <%}%><input type="submit" name="submit2" value=" この講師を予約する "> <%if ($arrLecturer["type"] != 2) {%>
</form>
<%}%></td>
<td>
<form style="margin-top:0px;margin-bottom:0px" action="/kensaku<%=$strPopup%>.asp" method="POST" name="frmBack">
<input type="hidden" name="f_cmd" value="list"> <input type="submit" name="submit2" value=" 講師リストに戻る ">
</form>
</td>
</tr>
</table>
</td>
</tr>
</table>
<br>


i would give you the link, but it is all in Japanese - i can`t read it myself, if u can read Japanese let me know and i will give you the link.
Reply With Quote
  #6 (permalink)  
Old 09-10-04, 12:54 AM
PromptLogic PromptLogic is offline
Newbie Coder
 
Join Date: Sep 2004
Posts: 33
Thanks: 0
Thanked 0 Times in 0 Posts
Well, I haven't found out why it is closing but I see A MAJOR problem. Is this supposed to be ASP or PHP?? All the code there is PHP but with ASP tags <% %>. If this is supposed to be ASP then none of that code will work at all and I am suprised that the webserver hasn't been spitting out error messages like crazy.

If this is supposed to be ASP let me know. I can convert it all for you but I won't be able to do it until tomorrow.
Reply With Quote
  #7 (permalink)  
Old 09-10-04, 12:58 AM
highland dreaming highland dreaming is offline
Newbie Coder
 
Join Date: Sep 2004
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
You know I don't know what it is meant to be, because the guy who did it, didn't really know what he was doing apparently and now has left us with a nice mess, as you can see.

what would be easier for you?

I dont want to take up too much of ur time.

thank you sooooooooo much for helping me out, i really appreciate it, i have been pulling my hair out for ages now.
Reply With Quote
  #8 (permalink)  
Old 09-10-04, 01:12 AM
PromptLogic PromptLogic is offline
Newbie Coder
 
Join Date: Sep 2004
Posts: 33
Thanks: 0
Thanked 0 Times in 0 Posts
Yeah, it is an interesting combination of languages

Well, whats easier doesn't mean it would work for you. It would probably bee easier to finish it out in PHP as 80% of the code is PHP but if this code is supposed to run on IIS as ASP then the it would need to be ASP in order to work. So I guess the question of the day is, are the rest of the files .asp or .php? I don't mind either way as I can code ASP just about as fast as I can in PHP.

Let me know either ASP or PHP and I will do it for you tomorrow (or later today actually...man its late). Don't worry, it doesn't take up too much time. I ain't got a dang thing to do anyway!


Oh yeah, one more thing. Is this script using a MySQL, MSSQL or Access database? I will need to know for when I write the DB Connector

Last edited by PromptLogic; 09-10-04 at 01:16 AM.
Reply With Quote
  #9 (permalink)  
Old 09-10-04, 01:18 AM
highland dreaming highland dreaming is offline
Newbie Coder
 
Join Date: Sep 2004
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Well by the looks of things the other pages have been done in the same way, they all work fine, just this one is having prblems, and they have all been saved as ASP, so I suppose it will be ASP then

Once again, thank you so much.

You can't imagine how mental I have been going over this.
Reply With Quote
  #10 (permalink)  
Old 09-12-04, 05:45 AM
highland dreaming highland dreaming is offline
Newbie Coder
 
Join Date: Sep 2004
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
how do i delete a post after the time limit?
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump


All times are GMT -5. The time now is 03:04 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.