Jump to content

sniperscope

Members
  • Posts

    280
  • Joined

  • Last visited

Everything posted by sniperscope

  1. Hello I wonder why my query return value. It should be return 0 but it gives me 1 record with every value is null. Here is my query $today = mktime(0, 0, 0, date("n"), date("d"), date("Y")); SELECT s.register_date, s.shop_name, s.id, s.shop_type, s.shop_area, s.deli_area, s.shop_hour, s.shop_phone, g.staff_id, g.staffl_name, g.staff_recommend, c.course_course, n.news_icon, COUNT( n.news_id ) AS NewsNumber, COUNT( cp.coupon_id ) AS CouponNumber, COUNT( g.staff_id ) AS StaffNumber, COUNT( w.shukin_id ) AS ShukkinNumber FROM shop_master s LEFT JOIN course c ON s.id = c.shop_id LEFT JOIN staff_master g ON s.id = g.shop_id LEFT JOIN news_event n ON s.id = n.shop_id LEFT JOIN coupon cp ON s.id = cp.shop_id LEFT JOIN ( SELECT w.shop_id, w.shukin_id FROM shukkin_master w WHERE staff_date = '1334588400' GROUP BY staff_master_id )w ON s.id = w.shop_id WHERE s.shop_area LIKE '%osaka%' AND s.shop_type <> 'pizza' ORDER BY g.staff_recommend DESC , n.news_date DESC , s.register_date DESC This query MUST give me 0 record since there is no pizza shop. I really appreciate for any help.
  2. Then please do NOT spend time providing a solution. Thanks for interesting anyway.
  3. I want all person name regardless they are working or not.
  4. Hello I have a little problem with left join(yet again) I want to get all staff name and staff working time. My staff table is: | id | staff_name | +-----+----------------+ | 1 | Michael | | 2 | Jason | And schedule table is: | id | staff_id | start_time | end_time | days | +-----+-----------+--------------+--------------+-------+ | 1 | 1 | 14:00 | 15:00 | 1334070000 | 2 | 1 | 20:00 | 23:00 | 1334072000 | 3 | 2 | 20:00 | 23:00 | 1334075000 | 4 | 2 | 20:00 | 23:00 | 1334076000 | 5 | 2 | 20:00 | 23:00 | 1334077000 | 6 | 1 | 20:00 | 23:00 | 1334078000 | 7 | 2 | 20:00 | 23:00 | 1334078000 | 8 | 1 | 20:00 | 23:00 | 1334080000 | 9 | 1 | 20:00 | 23:00 | 1334080000 I am running this query but it return 0 SELECT g.staff_name, s.start_time, s.end_time FROM staff_master g LEFT JOIN schedule s ON g.id = s.staff_id WHERE s.days >= '1334070000' ORDER BY s.days ASC What am i trying is to get all staff names and their one week working schedule. If they are working (lets say) thursday then get his/her start and end time else just echo 00:00 Regards
  5. i solved it. I changed my code as below <script> var counter = 1; var limit = 200; function addInput(divName) { if (counter == limit) { alert("You have reached the limit of adding " + counter + " inputs"); } else { var newdiv = document.createElement('div'); newdiv.innerHTML = '<table class="table-1"><tr><th width="4%">' + (counter + 1) + '</th><td width="18%"><select name="product_' + (counter + 1) + '"><option value="item1">item1</option><option value="item2">item2</option><option value="item3">item3</option><option value="item4">item4</option></select></td><td width="16%"><select name="color_' + (counter + 1) + '"><option value="black">black</option><option value="red">red</option><option value="blue">blue</option><option value="green">green</option></select></td><td width="11%"><select name="p_size_' + (counter + 1) + '"><option value="L">L</option><option value="M">M</option></select></td><td width="10%">input type="text" name="order_number_' + (counter + 1) + '" size="7" onfocus="addInput(\'dynamicInput\');" onkeyup="Unit_update(\'order_number_' + (counter + 1) + '\', \'item_price_' + (counter + 1) + '\');" /></td><td width="40%" class="th"><input type="text" name="item_price_' + (counter + 1) + '" size="7" value="" readonly="readonly" /></td></tr></table>'; document.getElementById(divName).appendChild(newdiv); counter++; } } function Unit_update(unit_item, calc) { var i = document.forms['ContactForm'].elements[unit_item].value; document.forms['ContactForm'].elements[calc].value = i; } </script> Hope this help someone else.
  6. Hi Currently i have a small javascript problem which i could not handle it. I really appreciate for any help. My page has a form with dynamic added form fields(onclick adds new text box) and need calculate every single added text form value separately. I almost read about 20 blogs and web sites. But there is no hope so far. Regards My JS code: <script> var counter = 1; var limit = 200; function addInput(divName) { if (counter == limit) { alert("You have reached the limit of adding " + counter + " inputs"); } else { var newdiv = document.createElement('div'); newdiv.innerHTML = '<table class="table-1"><tr><th width="4%">' + (counter + 1) + '</th><td width="18%"><select name="product_' + (counter + 1) + '"><option value="item1">item1</option><option value="item2">item2</option><option value="item3">item3</option><option value="item4">item4</option></select></td><td width="16%"><select name="color_' + (counter + 1) + '"><option value="black">black</option><option value="red">red</option><option value="blue">blue</option><option value="green">green</option></select></td><td width="11%"><select name="p_size_' + (counter + 1) + '"><option value="L">L</option><option value="M">M</option></select></td><td width="10%"><input type="text" name="order_number_' + (counter + 1) + '" size="7" onfocus="addInput(\'dynamicInput\');" /></td><td width="40%" class="th"><input type="text" name="item_pirce_' + (counter + 1) + '" size="7" value="" readonly="readonly" /></td></tr></table>'; document.getElementById(divName).appendChild(newdiv); counter++; } } function Unit_update(unit_item) { // This works if i manually add element names. var i = document.forms['ContactForm'].elements["order_number_0"].value; document.forms['ContactForm'].elements["item_price_0"].value = i; } </script> And this is my form code: <table class="table-1"> <tr><th width="4%" class="th"></th> <th width="18%" class="th">P Name</th> <th width="16%" class="th">Color</th> <th width="11%" class="th">Size</th> <th width="10%" class="th">Order</th> <th width="41%" class="th">Total</th></tr></table> <div id="dynamicInput"> <table class="table-1"> <tr><th width="4%">1</th> <td width="18%"><select name="product_0"> <option value="item1">item2</option> <option value="item2">item2</option> <option value="item3">item3</option> <option value="item4">item4</option></select></td> <td width="16%"><select name="color_0"> <option value="black">black</option> <option value="red">red</option> <option value="blue">blue</option> <option value="green">green</option></select></td> <td width="11%"><select name="p_size_0"> <option value="L">L</option> <option value="M">M</option></select></td> <td width="10%"><input type="text" name="order_number_0" size="7" onfocus="addInput('dynamicInput');" onkeyup="Unit_update(this.form);" /></td> <td width="40%" class="th"><input type="text" name="item_price_0" size="7" value="" readonly="readonly" /></td></tr></table></div> <div style="width:100% !important; text-align:center; height:45px; background-color:#E0DFE3;"> <input type="reset" value="Reset" style="font-size:16px; width:100px; height:30px; font-weight:bold;" /> <input type="submit" value="Submit" style="font-size:16px; width:100px; height:30px; font-weight:bold;" /> </div><input type="hidden" name="SendIt" /> </form>
  7. Dear spiderwell My faq page is as below. <script> jQuery(document).ready(function(){ jQuery("#ContactForm").validationEngine(); }); function GetAnswer(value) { var str = $("#div").serialize(); var val = value; $.ajax({ type: "POST", url: "answer.php?id=" + val, data: str, success: function(data){ $('#ShowResult').html(data); } }); return false; } </script> <div class="faqQuestion"> <div class="faqList" onclick="GetAnswer(0);" id="div"><span class="faqSpan"><a href="#m1">question 1</a></span></div> <div class="faqList" onclick="GetAnswer(1);" id="div"><span class="faqSpan"><a href="#m1">question 2</a></span></div> <div class="faqList" onclick="GetAnswer(2);" id="div"><span class="faqSpan"><a href="#m1">question 3</a></span></div> <div class="faqList" onclick="GetAnswer(3);" id="div"><span class="faqSpan"><a href="#m1">question 4</a></span></div> <div class="faqList" onclick="GetAnswer(4);" id="div"><span class="faqSpan"><a href="#m1">question 5</a></span></div> <div class="faqList" onclick="GetAnswer(5);" id="div"><span class="faqSpan"><a href="#m1">question 6</a></span></div> <div class="faqList" onclick="GetAnswer(6);" id="div"><span class="faqSpan"><a href="#m1">question 7</a></span></div> </div> How can i merge your code into this? Because i am using id="div" for serialize onclick="GetAnswer(0);" 0,1,2,3,4,5,6 are index numbers of answer array in answer.php Interesting thing is when array has only numbers then ie display it but if it is a Japanese character then display and soon disappear. <?php mb_language("Ja"); mb_internal_encoding("utf-8"); if(!isset($_GET['id'])) exit(); $q = $_GET['id']; $questions = array("月額での支払いは可能ですか?", "いつから使えるようになりますか。", "支払い方法はどのようになっていますか?", "サーバーのみお申し込み可能ですか?", "他サーバーから乗り換えたいのですがどうすればいいですか?", "5", "6", "サポート電話はありますか?", "電話以外にサポートしますか?", "ホームページ中止ありますか?", "Cronは使用できますか?", "海外からのアクセスに制限はありますか?", "12", "13", "アダルトサイトの利用はできますか?", "コンテンツに関して制限はありますか?", "出会い系サイトの運営はできますか?", "動画、音楽ファイルの使用はできますか?", "サーバ設置場所とバックボーンは?", "19", "20", "21", "22", "23", "24", "25", "26", "27", "FTPに接続ができません。", "HPのファイルはどのディレクトリに置けばいいの?", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "40", "41"); $answers = array("共用プラン1年契約のみとなっております。しかし、VPS又は専用プランで月払い可能です。", "お申し込みプランによって異なります。詳細は下記に書いています。<br /><br />共用プラン:すぐ使えます。<br />VPSプラン:12時間以内。<br />専用プラン:48時間以内", "支払い方法は、弊社指定の銀行口座へのお振り込み、クレジットカード決済のいずれかとなります。<br /><br /> ※ <strong>銀行振り込みの場合</strong><br />振込手数料は、お客様負担とさせていいただいております。<br /><br /> ※<strong>クレジットカード決済の場合</strong> ご利用可能なクレジットカードは、VISA / Master / JCB / AMEX です。<br />弊社ではカード番号を保持しないため、自動引落しではございませんので契約更新のたびにお支払い手続きが必要となります。", "サーバーのみお申し込み可能です。", "他サーバーから乗り換えたい場合お客様のホームページ無料でトランスファー【フォルダー、ファイル、データベース、メールアカウントなど】します。", "5", "6", "7", "8", "9", "10", "海外の一部の ISP(インターネットサービスプロバイダー)から弊社サーバへ不正アクセスが多発しているため、セキュリティ対策としてアクセス制限を実施しております。<br><br> 日本国外から弊社サーバーへアクセスした場合、アクセスできない可能性がございます。ご都合が悪い場合には、お客様センター までご連絡ください。個別にアクセス制限の調整をさせていただきます。", "12", "13", "14", "15", "16", "17", "サーバは国内に設置されており、耐震、耐火構造の堅牢な建物に24時間有人監視、入室に際するセキュリティーチェック等、万全の体制を整えております。<br><br> また、バックボーンも 国内最大級の173Gbpsに接続されております。<br>サーバーからバックボーンへの接続は200Mbpsとなります。", "19", "20", "21", "22", "23", "24", "25", "26", "27", "<p>FTPソフトの<strong>PASVモード</strong>(パッシブモード)をON又はOFFどちらかに変える。<br> 1) ファイアウォールを解除して接続してみる。<br> 2) 10分ほどしてから接続する。<br> 3) IDや、パスワードが間違っていませんか?<br>   a) コピーアンドペーストで貼り付けて下さい。<br>   b) パスワード部分への貼り付けは[ctrl]+[v]で可能ですので、お試し下さい。<br><br><br> </p> <p><strong>FFFTP</strong>でファイル一覧の取得ができない。<br> 1) [ホストの設定] - [高度タブ] へすすみ、<br> 2) [listコマンドでファイル一覧を取得]にチェックを入れる。<br> 3) 接続して、右クリックメニューの[最新の情報に更新] で表示されます。<br><br><br> </p> <p>以上を試しても接続できない場合。<br><a href=\"../contact/\" title=\"お問い合せページ\">お問い合せページ</a>よりお名前とドメイン名をお知らせ下さい。</p>", "public_html の中にアップロードして下さい。", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "40", "41"); echo '<div class="faqtitle"><span class="faqtitlespan">' .$questions[$q]. '</span></div><div class="faqanswer">' .$answers[$q]. '</div>'; ?>
  8. Some how this moron browser works in localhost but not in live server.
  9. So just tested that page in the most stupid browser ever built (Internet Explorer) Ajax return nothing. Actually it display answer about 0.5 second and return to blank. Does someone has any idea except forcing people stop using stupid browser?
  10. Okay. I solved problem (by myself ;D ) I am posting solution below. Hope this help someone else. index.php: <script> jQuery(document).ready(function(){ jQuery("#ContactForm").validationEngine(); }); function GetAnswer(value) { var str = $("#div").serialize(); var val = value; $.ajax({ type: "POST", url: "answer.php?id=" + val, data: str, success: function(data){ $('#ShowResult').html(data); } }); return false; } </script> <body> <div class="faqList" onclick="GetAnswer(555444);" id="div"><span class="faqSpan"><a href="#m1">this is FAQ question. </a></span></div> <br /><br /> <!-- Answer Display --> <div id="m1" name="m1"><div id="ShowResult"></div></div> </body> And this is answer.php : <?php //if(!isset($_GET['q'])) //exit(); $id = $_GET['q']; $questions = array("q1", "q2", "q3", "q4"); $answers = array("a1", "a2", "a3", "a4"); $return = ' <div class="faqtitle"><span class="faqtitlespan">' .$questions[$id]. '</span></div> <div class="faqanswer">$answers[$id]</a></div>'; echo $return; ?> [/code]
  11. Hi. How can i pass div id? if it is not in a form? My ajax code is : <script> jQuery(document).ready(function(){ jQuery("#ContactForm").validationEngine(); }); function GetAnswer() { var str = $("form").serialize(); $.ajax({ type: "POST", url: "answer.php", data: str, success: function(data){ $('#ShowResult').html(data); } }); return false; } </script> <body> <div class="faqList" onclick="GetAnswer();" id="1"><span class="faqSpan"><a href="#m1">this is FAQ question. </a></span></div> <br /><br /> <!-- Answer Display --> <div id="m1" name="m1"><div id="ShowResult"></div></div> </body> And this is answer.php : <?php //if(!isset($_POST['q'])) //exit(); $id = $_POST['q']; $questions = array("q1", "q2", "q3", "q4"); $answers = array("a1", "a2", "a3", "a4"); $return = ' <div class="faqtitle"><span class="faqtitlespan">' .$questions[$id]. '</span></div> <div class="faqanswer">$answers[$id]</a></div>'; echo $return; ?> What i get is Notice: Undefined index: id in C:\apache\htdocs\support\answer.php on line 4 Thanks for any advice.
  12. Dear teamatomic thank you very much for your reply. Let me explain step by step; 1 - my previous code auto submit form 2 - return result shows me confirmation page to make sure i have entered correct data through my browser (echo $result) 3 - There is another submit button (i entered correct value, please send it) 4 - here is my code stop... 5 - i want to submit that form too. but seems i can not with my code. please give me an idea if have any better solution. Regards
  13. Hi gurus I have a tiny problem that i can not submit web form after receive confirmation page. Let make myself more clear. I have couple of web sites and i want to post data automatically. I wrote some php script which using cURL. The problem is my sites has confirmation page. So far, i can post data, get confirmation page but i dont know how to post confirmation page. All i can done with my php skill is below. Hopefully you guys help me or at least drive me to a solution with your comments. Regards $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "http://mysite.net/test/bbs.cgi?guid=ON"); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_setopt($ch, CURLOPT_REFERER, "../english/index.html"); curl_setopt($ch, CURLOPT_POSTFIELDS, "subject=$_POST[subject]&FROM=$_POST[FROM]&mail=$_POST[mail]&MESSAGE=$_POST[MESSAGE]&bbs=english&time=1373480270&tepo=don&submit=Confirm"); $result = curl_exec ($ch); curl_close($ch); echo $result;
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.