Warning: Cannot use a scalar value as an array in /home/admin/public_html/forum/include/fm.class.php on line 757

Warning: Invalid argument supplied for foreach() in /home/admin/public_html/forum/include/fm.class.php on line 770

Warning: Invalid argument supplied for foreach() in /home/admin/public_html/forum/topic.php on line 737
Форумы портала PHP.SU :: помогите скрипт работает не коректно в ie

 PHP.SU

Программирование на PHP, MySQL и другие веб-технологии
PHP.SU Портал     На главную страницу форума Главная     Помощь Помощь     Поиск Поиск     Поиск Яндекс Поиск Яндекс     Вакансии  Пользователи Пользователи


 Страниц (1): [1]   

> Без описания
mclord
Отправлено: 25 Сентября, 2011 - 18:16:46
Post Id


Частый гость


Покинул форум
Сообщений всего: 138
Дата рег-ции: Февр. 2011  


Помог: 0 раз(а)




PHP:
скопировать код в буфер обмена
  1.  
  2. <? @include("templates/head.inc.php"); ?>
  3. <script language="JavaScript" type="text/javascript">
  4.     var select1 = 0;
  5.     var select2 = 0;
  6.     var temp1 = 0;
  7.     var temp2 = 0;
  8.  
  9.     function goto_list() {
  10.       document.location='index.php?c1='+document.select_currency.from.value+'&c2='+document.select_currency.to.value;
  11.     }
  12.  
  13.     function auto_direct(select1, select2) {
  14.       if (select1 == 1) {
  15.         temp1 = select1;
  16.       }
  17.       if (select2 == 1) {
  18.         temp2 = select2;
  19.       }
  20.       if ((temp1 == 1)&&(temp2 == 1)) {
  21.         goto_list();
  22.       }
  23.     }
  24.  
  25.     nr = false;
  26.     function f_cl(url) {
  27.       if (nr) {
  28.         nr = false;
  29.         return false;
  30.       }
  31.       window.open('go.php?'+url);
  32.     }
  33.  
  34.    
  35.   </script>  
  36. <?PHP
  37.  
  38. include ('db.php');
  39.  
  40. function itfalse($x)
  41.           {
  42.               global $se;        $ok=0;
  43.              for ($j = 3; $j < 15; $j++)
  44.                {
  45.                    if ($se[$x][$j] == 40)   { $ok++; }
  46.                }     return $ok;
  47.  
  48.           }
  49.           function iscount2($x,$y)
  50.           {
  51.            if (($x == 7) and ($y == 7)) { return 0; }
  52.            if (($x == 1) and ($y == 0)) { return 1; }
  53.            if (($x == 3) )  { return 2; }
  54.            if (($x == 2) and ($y == 6)) { return 3; }
  55.            if (($x == 2) and ($y == 1))  { return 4; }
  56.            if (($x == 6) and ($y == 5))  { return 5; }
  57.            if (($x == 7) and ($y == 4))  { return 6; }
  58.            if (($x == 1) and ($y == 2))  { return 7; }
  59.            if (($x == 6) and ($y == 6))  { return 8; }
  60.  
  61.            if (($x == 4))  { return 9; }
  62.           }
  63.                     function iscount($x,$y)  //1 2 digit
  64.           {
  65.            if ( ($x == 1) and ($y == 0) )  { return 1; }
  66.            if (($x == 5) and ($y == 4)) { return 2; }
  67.            if (($x == 2) and ($y == 7)) { return 3; }
  68.            if (($x == 2) and ($y == 10))  { return 4; }
  69.            if (($x == 7) and ($y == 5)) { return 5; }
  70.            if (($x == 8) and ($y == 5))  { return 6; }
  71.               if (($x == 1) and ($y == 3))  { return 7; }
  72.            if (($x == 7) and ($y == 7))  { return 8; }
  73.            if (($x == 5) and ($y == 8))  { return 9; }
  74.             if (($x == 8) and ($y == 8))  { return 0; }
  75.  
  76.           }
  77.  
  78.                        
  79. function curl_redir_exec($ch)
  80. {
  81. static $curl_loops = 0;
  82. static $curl_max_loops = 20;
  83. if ($curl_loops++ >= $curl_max_loops)
  84. {
  85. $curl_loops = 0;
  86. return FALSE;
  87. }
  88. curl_setopt($ch, CURLOPT_HEADER, true);
  89. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  90. $data = curl_exec($ch);
  91. list($header, $data) = explode("\n\n", $data, 2);
  92. $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
  93. if ($http_code == 301 || $http_code == 302)
  94. {
  95. $matches = array();
  96. preg_match('/Location:(.*?)\n/', $header, $matches);
  97. $url = @parse_url(trim(array_pop($matches)));
  98. if (!$url)
  99. {
  100. //couldn't process the url to redirect to
  101. $curl_loops = 0;
  102. return $data;
  103. }
  104. $last_url = parse_url(curl_getinfo($ch, CURLINFO_EFFECTIVE_URL));
  105. if (!$url['scheme'])
  106. $url['scheme'] = $last_url['scheme'];
  107. if (!$url['host'])
  108. $url['host'] = $last_url['host'];
  109. if (!$url['path'])
  110. $url['path'] = $last_url['path'];
  111. $new_url = $url['scheme'] . '://' . $url['host'] . $url['path'] . ($url['query']?'?'.$url['query']:'');
  112. curl_setopt($ch, CURLOPT_URL, $new_url);
  113. //debug('Redirecting to', $new_url);
  114. return curl_redir_exec($ch);
  115. } else {
  116. $curl_loops=0;
  117. return $data;
  118. }
  119. }
  120.  
  121. function getPage($url)
  122. {
  123.         $ch = curl_init();
  124.         curl_setopt ($ch, CURLOPT_URL,$url);
  125.         curl_setopt ($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6");
  126.         curl_setopt ($ch, CURLOPT_TIMEOUT, 1);
  127.         @curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 1);
  128.         curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
  129.         $result = curl_exec ($ch);
  130.         curl_close($ch);
  131.         return $result;
  132. }
  133.  
  134.  
  135. ?>
  136.  
  137. <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" align="left" width="100%">
  138. <tr>
  139. <td width="100%" style='padding-top: 7px; padding-bottom: 7px; padding-left: 10px; padding-right: 10px; '>
  140. <br><br>
  141.   <center><form action="index.php" method="get" name="select_currency">
  142.   <select name="from" onchange="auto_direct(1, 0)">
  143.        
  144. <?PHP
  145.  
  146. $c1= $_GET["c1"];
  147. $c2= $_GET["c2"];
  148.  
  149. if ($c1=="" && $c2=="")
  150.  
  151. {$c1=1; $c2=2;}
  152.  
  153. foreach ($decode as $i=>$value)
  154. { if ($decode[$i] <>"") {echo"<option value=".$i;
  155. if ($i==$c1) {echo " selected";}
  156. echo ">".$decode[$i]."</option>";}
  157. }
  158.  
  159. ?>
  160. </select> на <select name="to" onchange="auto_direct(0, 1)">
  161.        
  162. <?PHP
  163. $i=0;
  164. foreach ($decode as $i=>$value)
  165. { if ($decode[$i] <>"") {echo"<option value=".$i;
  166. if ($i==$c2) {echo " selected";}
  167. echo ">".$decode[$i]."</option>";}
  168. }
  169.  
  170. ?>
  171.  
  172.  </select> <script language="JavaScript" type="text/javascript">
  173.     document.write('<a href="javascript:goto_list()"><b>Найти</b><'+'/a>');
  174.   </script>
  175.   <noscript>
  176.     <input type="submit" style="margin-top: 12px; margin-bottom: 2px" value="Найти курсы">
  177.   </noscript>
  178.  
  179. </form></center>
  180. </td>
  181. </tr>
  182. </table>
  183. <br><br>
  184. <center><hr><h2>Обмен <?PHP echo $decode[$c1]; ?> на <?PHP echo $decode[$c2]; ?></h2><hr></center><br><br>
  185. <div class="exchvar">
  186. &nbsp;&nbsp;<a href="index.php?c1=<?PHP echo $c2; ?>&c2=<?PHP echo $c1; ?>"><b>Обратный обмен</a></b> | <a href="index.php?c1=1&c2=20"><b>Обмен WMZ на WMU</b></a> | <a href="index.php?c1=2&c2=20"><b>Обмен WMR на WMU</b></a></div><br>
  187. <table border="1" cellpadding="3" cellspacing="0" style="border-collapse: collapse" bordercolor="#0B8D0B" width="100%" id="AutoNumber4">
  188.       <thead>
  189.       <tr class="caption"><td>&nbsp;Обменник</td><td width="90">Отдаете</td><td width="90">Получаете</td><td width="90" class="alignright">Резерв</td><td class="alignright" width="35">BL&nbsp;</td></tr>
  190.       </thead>
  191.       <tbody>
  192.  
  193. <?PHP
  194. $start = microtime(true);
  195. foreach ($obmennik as $k=>$valueo)
  196.  
  197. {$file = @getpage ($obmennik[$k]["kurs_url"]);
  198.  
  199. $file = explode(";", $file);
  200.  
  201. if ($obmennik[$k] <>"" && (!$file)==false)  
  202.  
  203.  {     
  204.         foreach ($file as $line_num => $file)
  205.         {
  206.        
  207.         $array = explode(",",trim($file,";"));
  208.         if ($c1==$array[0] && $c2==$array[1])
  209.  
  210.                 {
  211.                 $kursy[$k][1]=$array[2];
  212.                 $kursy[$k][2]=$array[3];
  213.                 if ($kursy[$k][1]<>"") {$nn=1; }
  214.                 }
  215.         }
  216.  }
  217.  
  218. }
  219.  
  220. //if(is_array($kursy) && isset($kursy[1][1]))
  221. //foreach ($kursy as $kurs => $kursy) {
  222. //if ($kursy[$kurs][1]<>"" && $kursy[$kurs][2]<>"")
  223. // {$nn=1;}
  224. //}
  225. //if ($kursy[0][1]<>"")
  226. if ($nn==1)
  227.  
  228. {
  229. asort ($kursy);
  230.  
  231. $sum=0;
  232. $sk=0;
  233. $n=0;
  234. foreach($kursy as $key => $val)
  235.    {
  236.  
  237. $res=$kursy[$key][2];
  238. $print1=1;
  239. $print=$kursy[$key][1];
  240.          if ($print<1) {$print1=(1/$print);
  241. $print=1;
  242. }
  243.  
  244. $reserve=round($res,2);
  245. if ($reserve<=0) {$reserve=0;}
  246.  
  247. $wmid = @getpage('http://stats.wmtransfer.com/Levels/pWMIDLevel.aspx?wmid='.$obmennik[$key]["wmid"].'&w=35&h=18&bg=0XDBE2E9');
  248.     $img = @imagecreatefromstring($wmid);
  249.     for ($i = 4; $i < 35; $i++)
  250. {
  251. for ($j = 3; $j < 15; $j++)
  252. {
  253. $se[$i][$j] = (@imagecolorat ($img, $i, $j));
  254.          }
  255.           }
  256.           $is = false;
  257.           $w = '';
  258.  
  259.                if ( (itfalse(4) ==6 ) and (itfalse(5) ==7 ) and (itfalse(6) ==1 ) and (itfalse(7) ==2 ) and (itfalse(8) == 7 )  )
  260.              {
  261.                $is = true;
  262.                $w='no';
  263.              }
  264.  
  265.           if (!( itfalse(18) or itfalse(20) or itfalse(19) or ($is) ) )
  266.           {
  267.                //one digit
  268.  
  269.                    $p1 =  itfalse(23,$se);
  270.                    $p2 =   itfalse(28,$se);
  271.                    $w = (iscount($p1, $p2));
  272.                    $is = true;
  273.           }
  274.  
  275.           if ( ! ( itfalse(13) or itfalse(14) or itfalse(12) or ($is)  )   )
  276.           {
  277.                //two digit
  278.  
  279.                    $p1 =  itfalse(17,$se);
  280.                    $p2 =   itfalse(22,$se);
  281.                    $w = (iscount($p1, $p2));
  282.  
  283.                   $p1 =  itfalse(25,$se);
  284.                    $p2 =   itfalse(30,$se);
  285.                    $w .= (iscount($p1, $p2));
  286.                    $is = true;
  287.           }
  288.  
  289.            if (!( itfalse(7) or itfalse(8) or itfalse(6) or ($is) ) )
  290.           {
  291.  
  292.                //tree digit
  293.                     $p1 = itfalse(11,$se);
  294.                    $p2 =  itfalse(16,$se);
  295.                   $w  = (iscount2($p1, $p2));
  296.  
  297.                   $p1 =  itfalse(18,$se);
  298.                    $p2 =  itfalse(23,$se);
  299.                    $w.=(iscount2($p1, $p2));
  300.  
  301.                    $p1 =  itfalse(25,$se);
  302.                    $p2 =  itfalse(30,$se);
  303.                    $w.= (iscount2($p1, $p2));
  304.                     $is = true;
  305.           }
  306.           if ($is == false)
  307.           {
  308.  
  309.               $p1 = itfalse(6,$se);
  310.                    $p2 =  itfalse(11,$se);
  311.                    $w = (iscount2($p1, $p2));
  312.  
  313.                    $p1 = itfalse(13,$se);
  314.                    $p2 =  itfalse(18,$se);
  315.                    $w.= (iscount2($p1, $p2));
  316.  
  317.                    $p1 = itfalse(20,$se);
  318.                    $p2 =  itfalse(25,$se);
  319.                    $w.= (iscount2($p1, $p2));
  320.  
  321.                    $p1 = itfalse(27,$se);
  322.                    $p2 =  itfalse(32,$se);
  323.                    $w.= (iscount2($p1, $p2));
  324.           }
  325.                      
  326.  
  327. echo'      
  328. <tr class="row" onClick="f_cl('.$key.')">
  329. <td>&nbsp;'.$obmennik[$key]["name"].'</td>
  330.  
  331. <td><b>'.number_format (round($print,2),2).'</b> '.$decode[$c1].'</td>
  332. <td><b>'.number_format (round($print1,2),2).'</b> '.$decode[$c2].'</td>
  333. <td class="alignright">'.number_format ($reserve,2).'</td>
  334. <td class="alignright">'.$w.'</td>
  335. </tr>';
  336.  
  337. $sum2=$sum2+$reserve;
  338. if ($print1==1){
  339. $sum1=$print*$reserve;
  340. }
  341. else {
  342. $sum1=$print1*$reserve;
  343. }
  344. $n=$n+1;
  345. $sum=$sum+$sum1;
  346. }
  347. $end = microtime(true);
  348. $time = date("H:i:s");
  349. echo '</tbody></table><br><br>';
  350. echo ('<HR><h2>Статистика</h2><HR><br><br>' );
  351. echo ('Всего обменных пунктов: <b>'.$n.'</b><br><br>' );
  352. echo ('Всего резервов: <b>'.number_format (round($sum2,2),2).' '.$decode[$c2].'</b><br><br>');
  353. echo ('Cредний курс <b>'.$decode[$c1].'/'.$decode[$c2].'</b> с учетом резервов: <b>'.number_format(round(($sum/$sum2),4),2).'</b><br><br>');
  354. echo ('Обновление: <b>'.$time.'</b> ( По Москве )<br><br>' );
  355. echo ('Время выполнения скрипта: <b>'.(round($end-$start, 4)).' c</b><br><br>');
  356. }
  357. else {echo '<tr><td></td></tr></tbody></table><br><b>Обмен в данном направлении не производится ни одним из имеющихся в базе обменных пунктов</b><br><br>';};
  358. ?>
  359. <br>
  360. </body>
  361. </html>
  362. <? @include("templates/foot.inc.php"); ?>
  363.  
 
 Top
Мелкий Супермодератор
Отправлено: 25 Сентября, 2011 - 19:01:51
Post Id



Активный участник


Покинул форум
Сообщений всего: 11926
Дата рег-ции: Июль 2009  
Откуда: Россия, Санкт-Петербург


Помог: 618 раз(а)




PHP без понятий о всяких там браузерах. Так что смотрите результирующий HTML, JS, смотря что там у вас
mclord пишет:
работает не коректно в ie


-----
PostgreSQL DBA
 
 Top
mclord
Отправлено: 25 Сентября, 2011 - 19:23:00
Post Id


Частый гость


Покинул форум
Сообщений всего: 138
Дата рег-ции: Февр. 2011  


Помог: 0 раз(а)




откройте сайт http://money227[dot]ru/
через гугл хром и ие
 
 Top
caballero
Отправлено: 25 Сентября, 2011 - 19:23:52
Post Id


Активный участник


Покинул форум
Сообщений всего: 5998
Дата рег-ции: Сент. 2011  
Откуда: Харьков


Помог: 126 раз(а)




ты кидаешь два метра кода и даже не удосужишся объяснить что конкретно не работает.

по твоему тут сидит консилиум и будет часами анализировать и проверять в браузерах твой код?


-----
Бесплатная система складского учета с открытым кодом https://zippy[dot]com[dot]ua/zstore
 
 Top
mclord
Отправлено: 25 Сентября, 2011 - 19:35:31
Post Id


Частый гость


Покинул форум
Сообщений всего: 138
Дата рег-ции: Февр. 2011  


Помог: 0 раз(а)




отоброжается по разному в браузерах
 
 Top
Страниц (1): [1]
Сейчас эту тему просматривают: 0 (гостей: 0, зарегистрированных: 0)
« Напишите за меня, пожалуйста »


Все гости форума могут просматривать этот раздел.
Только зарегистрированные пользователи могут создавать новые темы в этом разделе.
Только зарегистрированные пользователи могут отвечать на сообщения в этом разделе.
 



Powered by PHP  Powered By MySQL  Powered by Nginx  Valid CSS  RSS

 
Powered by ExBB FM 1.0 RC1. InvisionExBB