Funksuyya Lazim
#
Salam Forum EhLi Mene Bu FunksuyaLar Lazimdi Kim Verer?

Masin aL
Siqaret aL
FutboL Praqnozu

Bu FunksuyaLari Kim Vere Biler?

Onceden TesekkurLer Edirem.
Redaktə (t) Hesabat et (t)
#1
Yoxdu ayqa ugurlar
Redaktə (t) Hesabat et (t)
#2
Come_me, Her Halda Aglimiz Kesr?
Redaktə (t) Hesabat et (t)
#3
bY_NaDi, Tesekkur
Redaktə (t) Hesabat et (t)
#4
buyur ama rengli deyil masin ala siqaret al yoxumdu
PHP Kod:
  1. <?php
  2. header("Cache-Control: no-cache");
  3. header("Content-type:text/vnd.wap.wml");
  4. require("inc.php");
  5. $link = connect_db();
  6. list($row, $id, $ps, $fsize1, $fsize2) = check_login($link);
  7.  
  8. $ref = rand(10000, 99999);
  9. $user = $row['user'];
  10. $level = $row['level'];
  11. $fut_level = false;
  12.  
  13. if($row["fut_level"] == 1)
  14. {
  15. $fut_level = true;
  16. }
  17. $month_name = array("Yanvar","Fevral","Mart","Aprel","May","&#304;yun","&#304;yul","Avqust","Sentyabr","Oktyabr","Noyabr","Dekabr");
  18. $new_g = mysql_query("SELECT COUNT(id) FROM football WHERE foot_status='0';");
  19. $new_games = mysql_result($new_g, 0);
  20.  
  21. $off_g = mysql_query("SELECT COUNT(id) FROM football WHERE foot_status!='0';");
  22. $off_games = mysql_result($off_g, 0);
  23.  
  24. $mod = intval($_GET['mod']);
  25. $title = array("Futbol proqnoz", "Yeni Oyunlar", "Neticeler", "Qaydalar", "Sizin Proqnozlar", "Admin panel", "Proqnoz ver", "D&#252;zg&#252;n Proqnozlar", "Yanl&#305;&#351; Proqnozlar");
  26. $title_main = $mod > count($title) ? $title[0] : $title[$mod];
  27.  
  28. echo $xml;
  29. echo $dtd;
  30. echo "<wml>\n";
  31. echo "<head><meta http-equiv=\"Cache-Control\" content=\"no-cache\" forua=\"true\"/></head>\n";
  32. echo "<card id=\"index\" title=\"".$title_main."\">\n";
  33. echo "<p align=\"center\">\n";
  34. echo $fsize1;
  35. echo "<img src=\"img/footbal.gif\" alt=\"Futbol proqnoz\"/><br/>";
  36. echo "*****<br/>";
  37. print "<u>".$title_main."</u><br/>";
  38. echo $divide;
  39. echo $fsize2;
  40. echo "</p><p align=\"left\">\n";
  41. echo $fsize1;
  42.  
  43. switch ($mod)
  44. {
  45. default:
  46. if($fut_level == true)
  47. {
  48. echo "<a href=\"football.php?id=$id&amp;ps=$ps&amp;mod=5&amp;ref=$ref\">Admin Panel</a><br/>\n";
  49. echo $divide;
  50. }
  51. echo "<img src=\"img/top.gif\" alt=\"Top\"/> <b>".$user."</b>, xo&#351; gelmisiniz. Buyurun oyunlara proqnoz verin.<br/>";
  52. echo "*****<br/>";
  53. echo "<a href=\"football.php?id=$id&amp;ps=$ps&amp;mod=4&amp;ref=$ref\">Sizin Proqnozlar</a><br/>\n";
  54. echo $divide;
  55. echo "- <a href=\"football.php?id=$id&amp;ps=$ps&amp;mod=1&amp;ref=$ref\">Yeni Oyunlar</a>(".$new_games.")<br/>\n";
  56. echo "- <a href=\"football.php?id=$id&amp;ps=$ps&amp;mod=2&amp;ref=$ref\">Neticeler</a>(".$off_games.")<br/>\n";
  57. echo "- <a href=\"football.php?id=$id&amp;ps=$ps&amp;mod=3&amp;ref=$ref\">Qaydalar</a><br/>\n";
  58. break;
  59.  
  60. case 1;//yeni oyunlar
  61. $total = $new_games;
  62. $max = 5;
  63. $page = (!isset($_GET['page'])) ? 0 : $_GET['page'];
  64. $start = (!isset($page)) ? 0 : ($page * $max);
  65. $end = (!isset($page)) ? $max : ($start + $max);
  66. if(ceil($total/$max) < $page)
  67. {
  68. $start=0;
  69. $end=$max;
  70. }
  71. $sql = mysql_query("SELECT * FROM football WHERE foot_status='0' ORDER BY time ASC LIMIT $start,$max;");
  72. if(mysql_affected_rows()==false)
  73. {
  74. echo "He&#231; bir komanda m&#252;barize aparm&#305;r.<br/>\n";
  75. }
  76. while($fb = mysql_fetch_array($sql))
  77. {
  78. $fb_id = $fb['id'];
  79. $home_team = $fb['team_one'];
  80. $user_team = $fb['team_two'];
  81. $kafcent_0 = $fb['kafcent_0'];
  82. $kafcent_1 = $fb['kafcent_1'];
  83. $kafcent_2 = $fb['kafcent_2'];
  84. $fb_date = $fb['foot_date'];
  85. $fb_ball = $fb['bal'];
  86. if($start!=($page * $max))echo $divide;
  87. echo ($start+1).") <u>".$fb_date."</u><br/>".$home_team." - ".$user_team;
  88. if($fut_level == true)
  89. {
  90. echo " [<a href=\"football.php?id=$id&amp;ps=$ps&amp;mod=5&amp;go=1&amp;fid=$fb_id&amp;ref=$ref\">Edit</a>]";
  91. }
  92. echo "<br/>";
  93. $curdate = str_replace("/", "", $fb_date);
  94. $curdate = str_replace(" ", "", $curdate);
  95. $curdate = str_replace(":", "", $curdate);
  96. if($curdate > date("dmYHi"))
  97. {
  98. echo "<select name=\"kafcent$ref\">";
  99. echo "<option value=\"2\">2 - ( x ".$kafcent_2.")</option>";
  100. echo "<option value=\"1\">1 - ( x ".$kafcent_1.")</option>";
  101. echo "<option value=\"0\">0 - ( x ".$kafcent_0.")</option>";
  102. echo "</select><br/>";
  103. echo "Minimum $fb_ball bal<br/>\n";
  104. echo "Bal: ";
  105. echo $fsize2;
  106. echo "<input type=\"text\" name=\"ball$ref\" size=\"3\"/> ";
  107. echo $fsize1;
  108. echo "<anchor title=\"go\">Ok<go href=\"football.php?id=$id&amp;ps=$ps&amp;mod=6&amp;ref=$ref\" method=\"post\">";
  109. echo "<postfield name=\"game\" value=\"$fb_id\"/>";
  110. echo "<postfield name=\"ball\" value=\"$(ball$ref)\"/>";
  111. echo "<postfield name=\"kafcent\" value=\"$(kafcent$ref)\"/>";
  112. echo "</go></anchor><br/>";
  113. }
  114. ++$start;
  115. }
  116. if($total > $max)
  117. {
  118. echo navigation("football.php?mod=$mod&amp;id=$id&amp;ps=$ps&amp;ref=$ref",$total,$max,$page);
  119. }
  120. break;
  121.  
  122. case 2;//neticeler
  123. $check = trim($_GET['check']);
  124. echo "<select name=\"day\" value=\"".date("d")."\">";
  125. $d=1;
  126. while($d<=31)
  127. {
  128. $d = ($d < 10) ? "0".$d : $d;
  129. echo "<option value=\"$d\">".$d."</option>";
  130. $d++;
  131. }
  132. echo "</select>-";
  133. echo "<select name=\"month\" value=\"".date("m")."\">";
  134. $n=1;
  135. while($n<=12)
  136. {
  137. $n = ($n < 10) ? "0".$n : $n;
  138. echo "<option value=\"$n\">".$month_name[$n-1]."</option>";
  139. $n++;
  140. }
  141. echo "</select>-";
  142. echo "<select name=\"year\" value=\"".date("Y")."\">";
  143. $w=2000;
  144. while($w<=date("Y"))
  145. {
  146. echo "<option value=\"$w\">".$w."</option>";
  147. $w++;
  148. }
  149. echo "</select> ";
  150. echo "[<anchor title=\"go\">G&#246;ster<go href=\"football.php?check=ok&amp;id=$id&amp;ps=$ps&amp;mod=$mod&amp;ref=$ref\" method=\"get\">";
  151. echo "<postfield name=\"day\" value=\"$(day)\"/>";
  152. echo "<postfield name=\"month\" value=\"$(month)\"/>";
  153. echo "<postfield name=\"year\" value=\"$(year)\"/>";
  154. echo "</go></anchor>]<br/>";
  155. echo $divide;
  156. if($check == true)
  157. {
  158. $today = $_GET['day']."/".$_GET['month']."/".$_GET['year'];
  159. $off = mysql_query("SELECT COUNT(id) FROM football WHERE foot_date >='".$today." 00:00' and foot_date <='".$today." 59:59' and foot_status!='0'");
  160. $off_games = mysql_result($off, 0);
  161. }
  162. $total = $off_games;
  163. $max = 5;
  164. $page = (!isset($_GET['page'])) ? 0 : $_GET['page'];
  165. $start = (!isset($page)) ? 0 : ($page * $max);
  166. $end = (!isset($page)) ? $max : ($start + $max);
  167. if(ceil($total/$max) < $page)
  168. {
  169. $start=0;
  170. $end=$max;
  171. }
  172. if($check == true)
  173. {
  174. $sql = mysql_query("SELECT * FROM football WHERE foot_date >='".$today." 00:00' and foot_date <='".$today." 59:59' and foot_status!='0' ORDER BY time DESC LIMIT $start,$max;");
  175. $url = "&amp;check=ok&amp;day=".$_GET['day']."&amp;month=".$_GET['month']."&amp;year=".$_GET['year'];
  176. }
  177. else
  178. {
  179. $sql = mysql_query("SELECT * FROM football WHERE foot_status!='0' ORDER BY time DESC LIMIT $start,$max;");
  180. }
  181. if(mysql_affected_rows()==false)
  182. {
  183. echo "Netice yoxdur.<br/>\n";
  184. }
  185. while($fb = mysql_fetch_array($sql))
  186. {
  187. $fb_id = $fb['id'];
  188. $home_team = $fb['team_one'];
  189. $user_team = $fb['team_two'];
  190. $fb_shot = $fb['foot_shot'];
  191. $fb_date = $fb['foot_date'];
  192. $fb_status = $fb['foot_status'];
  193. if($start!=($page * $max))echo $divide;
  194. if($fb_status == 1)
  195. {
  196. echo "<img src=\"img/1.gif\" alt=\"*\"/> <b>".$home_team."</b> - ".$user_team;
  197. }
  198. else
  199. if($fb_status == 2)
  200. {
  201. echo $home_team." - <img src=\"img/1.gif\" alt=\"*\"/> <b>".$user_team."</b>";
  202. }
  203. else
  204. {
  205. echo $home_team." - ".$user_team;
  206. }
  207. echo "<br/>";
  208. echo "-<b>Hesab:</b> ".$fb_shot."<br/>\n";
  209. list($h1,$h2) = split(" - ", $fb_shot);
  210. if($h1 > $h2)
  211. {
  212. $cafcent = 2;
  213. echo "-<b>Qalib:</b> Meydan sahibi.<br/>\n";
  214. }
  215. else
  216. if($h1 < $h2)
  217. {
  218. $cafcent = 0;
  219. echo "-<b>Qalib:</b> Qonaq komanda.<br/>\n";
  220. }
  221. else
  222. {
  223. $cafcent = 1;
  224. echo "-<b>Oyun:</b> He&#231;-He&#231;e.<br/>\n";
  225. }
  226. echo "<u>Proqnoz&#231;ular:</u><br/>\n";
  227. $duzgun_prognoz = mysql_query("SELECT COUNT(id) FROM fb_prognoz WHERE football_id='".$fb_id."' AND kafcent='".$cafcent."'");
  228. $duzgun_count = mysql_result($duzgun_prognoz, 0);
  229. echo "-<b>D&#252;zg&#252;n:</b> (<b><a href=\"football.php?id=$id&amp;ps=$ps&amp;mod=7&amp;fid=$fb_id&amp;ref=$ref\">".$duzgun_count."</a></b>)<br/>";
  230.  
  231. $sehv_prognoz = mysql_query("SELECT COUNT(id) FROM fb_prognoz WHERE football_id='".$fb_id."' AND kafcent!='".$cafcent."'");
  232. $sehv_count = mysql_result($sehv_prognoz, 0);
  233. echo "-<b>Yanl&#305;&#351;:</b> (<b><a href=\"football.php?id=$id&amp;ps=$ps&amp;mod=8&amp;fid=$fb_id&amp;&amp;ref=$ref\">".$sehv_count."</a></b>)<br/>";
  234.  
  235. ++$start;
  236. }
  237. if($total > $max)
  238. {
  239. echo navigation("football.php?mod=$mod&amp;id=$id&amp;ps=$ps$url&amp;ref=$ref",$total,$max,$page);
  240. }
  241. break;
  242.  
  243. case 3;//qaydalar
  244. echo "<b>1.</b>)Oyunun qaba&#287;&#305;nda <b>2</b> yaz&#305;lan&#305; se&#231;erseniz meydan sahibini, <b>1</b> se&#231;seniz beraberliyi, <b>0</b> se&#231;seniz qonaq komandan&#305;n qalib geleceyini bildirmi&#351; olacaqs&#305;n&#305;z.<br/><b>2.</b>)Eger se&#231;diyiniz oyun d&#252;z &#231;&#305;xarsa, hemin prognozun qaba&#287;&#305;nda qeyd olunan emsal(kafisent) oyuna qoydu&#287;unuz bala vurulub bal hesab&#305;n&#305;za elave edilecek.<br/><b>3.</b>)Proqnoz verdiyiniz oyunlar&#305; yoxlamaq &#252;&#231;&#252;n (qalib gelib gelmediyiniz baresinde) Sizin Pronozlar olan b&#246;lmeden izleye bilersiniz!<br/><b>4.</b>)Canl&#305; olaraqda Futbol oyunlar&#305;n&#305;n neticesini Canl&#305; Futbol Neticelerinden baxa bilersiniz!<br/>\n";
  245. break;
  246.  
  247. case 4;//my prognoz
  248. $my = mysql_query("SELECT COUNT(id) FROM fb_prognoz WHERE user_id='".$id."';");
  249. $total = mysql_result($my, 0);
  250. $max = 5;
  251. $page = (!isset($_GET['page'])) ? 0 : $_GET['page'];
  252. $start = (!isset($page)) ? 0 : ($page * $max);
  253. $end = (!isset($page)) ? $max : ($start + $max);
  254. if(ceil($total/$max) < $page)
  255. {
  256. $start=0;
  257. $end=$max;
  258. }
  259. $sql = mysql_query("SELECT * FROM fb_prognoz WHERE user_id='".$id."' ORDER BY date DESC LIMIT $start,$max;");
  260. if(mysql_affected_rows()==false)
  261. {
  262. echo "Siz he&#231; bir komandaya proqnoz vermemisiz.<br/>\n";
  263. break;
  264. }
  265. while($m = mysql_fetch_array($sql))
  266. {
  267. $kafcent = $m['kafcent'];
  268. $bal = $m['bal'];
  269. $fb = mysql_fetch_array(mysql_query("SELECT * FROM football WHERE id='".$m['football_id']."';"));
  270. $home_team = $fb['team_one'];
  271. $user_team = $fb['team_two'];
  272. $fb_shot = $fb['foot_shot'];
  273. $fb_date = $fb['foot_date'];
  274. $fb_status = $fb['foot_status'];
  275. $hesab = sprintf("%01.0f", ($bal * $fb['kafcent_'.$kafcent]));
  276.  
  277. if($start!=($page * $max))echo $divide;
  278. echo ($start+1).") ".$home_team." - ".$user_team."<br/>\n";
  279. echo "-<b>Kafisent:</b> ".$fb['kafcent_'.$kafcent]."<br/>\n";
  280. echo "-<b>Netice:</b> ".$fb_shot."<br/>\n";
  281. echo "-<b>Sizin hesab:</b> ".$kafcent." | <b>Bal:</b> ".$bal."<br/>\n";
  282. if($fb_status==0)
  283. {
  284. echo "-<b>G&#246;zlenilen mevacib:</b> (".$fb['kafcent_'.$kafcent]." x ".$bal." = ".$hesab.") bal<br/>\n";
  285. }
  286. else
  287. if(($fb_status==1 and $kafcent==2)or($fb_status==2 and $kafcent==0)or($fb_status==3 and $kafcent==1))
  288. {
  289. echo "-<b>Qazan&#305;lan meble&#287;:</b> (".$hesab." bal)<br/>\n";
  290. }
  291. else
  292. {
  293. echo "-<b>&#304;tirilen meble&#287;:</b> (".$bal." bal)<br/>\n";
  294. }
  295. echo "-<b>Tarix</b> - [".$fb_date."]<br/>\n";
  296. ++$start;
  297. }
  298. if($total > $max)
  299. {
  300. echo navigation("football.php?mod=$mod&amp;id=$id&amp;ps=$ps&amp;ref=$ref",$total,$max,$page);
  301. }
  302. break;
  303.  
  304. case 5;//admin panel
  305. if($fut_level == false)
  306. {
  307. echo "Sizin bura giri&#351; icazeniz yoxdur.<br/>\n";
  308. break;
  309. }
  310. switch($go)
  311. {
  312. default:
  313. echo "<a href=\"football.php?id=$id&amp;ps=$ps&amp;mod=$mod&amp;go=1&amp;ref=$ref\">Yeni oyun</a><br/>";
  314. echo "<a href=\"football.php?id=$id&amp;ps=$ps&amp;mod=$mod&amp;go=2&amp;ref=$ref\">Neticeler</a><br/>";
  315. echo $divide;
  316. echo "- <a href=\"football.php?id=$id&amp;ps=$ps&amp;mod=$mod&amp;go=3&amp;ref=$ref\">Neticeleri sil</a><br/>";
  317. echo "- <a href=\"football.php?id=$id&amp;ps=$ps&amp;mod=$mod&amp;go=4&amp;ref=$ref\">B&#252;t&#252;n oyunlar&#305; sil</a><br/>";
  318. echo "- <a href=\"football.php?id=$id&amp;ps=$ps&amp;mod=$mod&amp;go=5&amp;ref=$ref\">B&#252;t&#252;n proqnozlar&#305; sil</a><br/>";
  319. break;
  320.  
  321. case 1;//yeni oyun
  322. if(isset($fid))
  323. {
  324. $select = mysql_query("SELECT * FROM football WHERE id='".$fid."'");
  325. $ed = mysql_fetch_array($select);
  326. list($new_day,$new_month,$new_year,$new_hour,$new_second) = split("-", preg_replace("/[\/s,.?!:;[ ]+/", "-", $ed['foot_date']));
  327. $new_bal = $ed['bal'];
  328. $new_team_one = $ed['team_one'];
  329. $new_team_two = $ed['team_two'];
  330. $new_kafcent_0 = $ed['kafcent_0'];
  331. $new_kafcent_1 = $ed['kafcent_1'];
  332. $new_kafcent_2 = $ed['kafcent_2'];
  333. }
  334. if(!$action == true)
  335. {
  336. echo "<u>Meydan sahibi:</u><br/>";
  337. echo $fsize2;
  338. echo "<input type=\"text\" name=\"team_one$ref\" value=\"".$new_team_one."\" title=\"Komanda adi 1\"/><br/>";
  339. echo $fsize1;
  340. echo "<u>Qonaq komanda:</u><br/>";
  341. echo $fsize2;
  342. echo "<input type=\"text\" name=\"team_two$ref\" value=\"".$new_team_two."\" title=\"Komanda adi 2\"/><br/>";
  343. echo $fsize1;
  344. echo "<u>Tarix:</u> (g&#252;n-ay-il saat:deqiqe)<br/>";
  345. echo $fsize2;
  346. echo "<input type=\"text\" name=\"day$ref\" value=\"".$new_day."\" size=\"2\"/>";
  347. echo $fsize1."-".$fsize2;
  348. echo "<input type=\"text\" name=\"month$ref\" value=\"".$new_month."\" size=\"2\"/>";
  349. echo $fsize1."-".$fsize2;
  350. echo "<input type=\"text\" name=\"year$ref\" value=\"".$new_year."\" size=\"3\"/>";
  351. echo $fsize1." ".$fsize2;
  352. echo "<input type=\"text\" name=\"hour$ref\" value=\"".$new_hour."\" size=\"2\"/>";
  353. echo $fsize1.":".$fsize2;
  354. echo "<input type=\"text\" name=\"second$ref\" value=\"".$new_second."\" size=\"2\"/><br/>";
  355. echo $fsize1;
  356. echo "<u>Kafisentler:</u><br/>";
  357. echo "<b>0 - </b>";
  358. echo $fsize2;
  359. echo "<input type=\"text\" name=\"kafcent_0$ref\" value=\"".$new_kafcent_0."\" size=\"4\"/><br/>";
  360. echo $fsize1;
  361. echo "<b>1 - </b>";
  362. echo $fsize2;
  363. echo "<input type=\"text\" name=\"kafcent_1$ref\" value=\"".$new_kafcent_1."\" size=\"4\"/><br/>";
  364. echo $fsize1;
  365. echo "<b>2 - </b>";
  366. echo $fsize2;
  367. echo "<input type=\"text\" name=\"kafcent_2$ref\" value=\"".$new_kafcent_2."\" size=\"4\"/><br/>";
  368. echo $fsize1;
  369. echo "Bal say&#305;: ";
  370. echo $fsize2;
  371. echo "<input type=\"text\" name=\"bal$ref\" value=\"".$new_bal."\" size=\"5\"/><br/>";
  372. echo $fsize1;
  373. echo $divide;
  374. if($fid == true)
  375. {
  376. echo "[<anchor title=\"go\">Deyi&#351;<go href=\"football.php?id=$id&amp;ps=$ps&amp;mod=$mod&amp;go=$go&amp;ref=$ref\" method=\"post\">";
  377. }
  378. else
  379. {
  380. echo "[<anchor title=\"go\">Elave et<go href=\"football.php?id=$id&amp;ps=$ps&amp;mod=$mod&amp;go=$go&amp;ref=$ref\" method=\"post\">";
  381. }
  382. echo "<postfield name=\"team_one\" value=\"$(team_one$ref)\"/>";
  383. echo "<postfield name=\"team_two\" value=\"$(team_two$ref)\"/>";
  384. echo "<postfield name=\"kafcent_0\" value=\"$(kafcent_0$ref)\"/>";
  385. echo "<postfield name=\"kafcent_1\" value=\"$(kafcent_1$ref)\"/>";
  386. echo "<postfield name=\"kafcent_2\" value=\"$(kafcent_2$ref)\"/>";
  387. echo "<postfield name=\"day\" value=\"$(day$ref)\"/>";
  388. echo "<postfield name=\"month\" value=\"$(month$ref)\"/>";
  389. echo "<postfield name=\"year\" value=\"$(year$ref)\"/>";
  390. echo "<postfield name=\"hour\" value=\"$(hour$ref)\"/>";
  391. echo "<postfield name=\"second\" value=\"$(second$ref)\"/>";
  392. echo "<postfield name=\"bal\" value=\"$(bal$ref)\"/>";
  393. if($fid == true)
  394. {
  395. echo "<postfield name=\"fid\" value=\"$fid\"/>";
  396. }
  397. echo "<postfield name=\"action\" value=\"ok\"/>";
  398. echo "</go></anchor>]<br/>";
  399. }
  400. else
  401. {
  402. $error = false;
  403. $team_one = narmobil($_POST['team_one']);
  404. $team_two = narmobil($_POST['team_two']);
  405. $kafcent_0 = trim($_POST['kafcent_0']);
  406. $kafcent_1 = trim($_POST['kafcent_1']);
  407. $kafcent_2 = trim($_POST['kafcent_2']);
  408. $day = trim($_POST['day']);
  409. $month = trim($_POST['month']);
  410. $year = trim($_POST['year']);
  411. $hour = trim($_POST['hour']);
  412. $second = trim($_POST['second']);
  413. $bal = intval($_POST['bal']);
  414. if($team_one == false)
  415. {
  416. $error = "1 ci komandan&#305;n ad&#305;n&#305; yazmad&#305;z.";
  417. }
  418. else
  419. if($team_two == false)
  420. {
  421. $error = "2 ci komandan&#305;n ad&#305;n&#305; yazmad&#305;z.";
  422. }
  423. else
  424. if($day == false or $month == false or $year == false or $hour == false or $second == false)
  425. {
  426. $error = "Tarix g&#246;sterilen xanalardan hans&#305;sa bo&#351;dur.";
  427. }
  428. else
  429. if($day < date("d") or $month < date("m") or $year < date("Y"))
  430. {
  431. $error = "Tarix d&#252;zg&#252;n yaz&#305;lmay&#305;b.";
  432. }
  433. else
  434. if($kafcent_0 == false or $kafcent_1 == false or $kafcent_2 == false)
  435. {
  436. $error = "0,1,2 kafisentleriden hans&#305;sa bo&#351;dur.";
  437. }
  438. else
  439. if($bal < 5)
  440. {
  441. $error = "Bal say&#305; 5 den az olmamal&#305;d&#305;r.";
  442. }
  443. if($error == true)
  444. {
  445. echo $error."<br/>\n";
  446. echo $divide;
  447. echo "<anchor>Geri Qay&#305;t<prev/></anchor><br/>";
  448. }
  449. else
  450. {
  451. if($fid == true)
  452. {
  453. $sql = mysql_query("UPDATE football SET team_one='".$team_one."', team_two='".$team_two."', kafcent_0='".$kafcent_0."', kafcent_1='".$kafcent_1."', kafcent_2='".$kafcent_2."', foot_date='".$day."/".$month."/".$year." ".$hour.":".$second."', time='".time()."', bal='".$bal."' WHERE id='".$fid."'");
  454. }
  455. else
  456. {
  457. $sql = mysql_query("INSERT INTO football SET team_one='".$team_one."', team_two='".$team_two."', kafcent_0='".$kafcent_0."', kafcent_1='".$kafcent_1."', kafcent_2='".$kafcent_2."', foot_date='".$day."/".$month."/".$year." ".$hour.":".$second."', bal='".$bal."'");
  458. }
  459. if($sql == true)
  460. {
  461. if($fid == true)
  462. {
  463. echo "Qeyd etdiyiniz oyun u&#287;urla deyi&#351;dirildi.<br/>\n";
  464. }
  465. else
  466. {
  467. echo "Yeni oyun u&#287;urla elave edildi.<br/>\n";
  468. }
  469. }
  470. else
  471. {
  472. echo "Bazada problem var bir ne&#231;e deqiqe sonra yene yoxlay&#305;n.<br/>\n";
  473. }
  474. }
  475. }
  476. break;
  477.  
  478. case 2;//neticeler
  479. $total = $new_games;
  480. $max = 5;
  481. $page = (!isset($_GET['page'])) ? 0 : $_GET['page'];
  482. $start = (!isset($page)) ? 0 : ($page * $max);
  483. $end = (!isset($page)) ? $max : ($start + $max);
  484. if(ceil($total/$max) < $page)
  485. {
  486. $start=0;
  487. $end=$max;
  488. }
  489. $sql = mysql_query("SELECT * FROM football WHERE foot_status='0' ORDER BY time DESC LIMIT $start,$max;");
  490. if(mysql_affected_rows()==false)
  491. {
  492. echo "Netice g&#246;zleyen oyun yoxdur.<br/>\n";
  493. }
  494. while($fb = mysql_fetch_array($sql))
  495. {
  496. $fb_id = $fb['id'];
  497. $home_team = $fb['team_one'];
  498. $user_team = $fb['team_two'];
  499. $kafcent_0 = $fb['kafcent_0'];
  500. $kafcent_1 = $fb['kafcent_1'];
  501. $kafcent_2 = $fb['kafcent_2'];
  502. $fb_date = $fb['foot_date'];
  503. $fb_ball = $fb['bal'];
  504. if($start!=($page * $max))echo $divide;
  505. echo ($start+1).")".$fb_date."<br/>".$home_team." - ".$user_team."<br/>";
  506. echo "Netice: \n";
  507. echo $fsize2;
  508. echo "<input type=\"text\" name=\"shot_1$ref\" size=\"4\"/>";
  509. echo $fsize1."-".$fsize2;
  510. echo "<input type=\"text\" name=\"shot_2$ref\" size=\"4\"/>";
  511. echo $fsize1;
  512. echo " [<anchor title=\"go\">OK<go href=\"football.php?id=$id&amp;ps=$ps&amp;mod=$mod&amp;go=6&amp;ref=$ref\" method=\"post\">";
  513. echo "<postfield name=\"shot_id\" value=\"$fb_id\"/>";
  514. echo "<postfield name=\"shot_1\" value=\"$(shot_1$ref)\"/>";
  515. echo "<postfield name=\"shot_2\" value=\"$(shot_2$ref)\"/>";
  516. echo "</go></anchor>]<br/>";
  517. ++$start;
  518. }
  519. if($total > $max)
  520. {
  521. echo navigation("football.php?mod=$mod&amp;go=$go&amp;id=$id&amp;ps=$ps&amp;ref=$ref",$total,$max,$page);
  522. }
  523. break;
  524.  
  525. case 3;//delete off game
  526. $delete_off = mysql_query("DELETE FROM football WHERE foot_status!='0'");
  527. if($delete_off)
  528. {
  529. echo "<u>B&#252;t&#252;n neticeler silindi.</u><br/>";
  530. }
  531. else
  532. {
  533. echo "<u>Xeta ba&#351; verdi.</u><br/>";
  534. }
  535. break;
  536.  
  537. case 4;//delete all game
  538. $delete_all = mysql_query("TRUNCATE TABLE football");
  539. if($delete_all)
  540. {
  541. echo "<u>B&#252;t&#252;n oyunlar silindi.</u><br/>";
  542. }
  543. else
  544. {
  545. echo "<u>Xeta ba&#351; verdi.</u><br/>";
  546. }
  547. break;
  548.  
  549. case 5;//delete all prognoz
  550. $delete_pr = mysql_query("TRUNCATE TABLE fb_prognoz");
  551. if($delete_pr)
  552. {
  553. echo "<u>B&#252;t&#252;n proqnoz silindi.</u><br/>";
  554. }
  555. else
  556. {
  557. echo "<u>Xeta ba&#351; verdi.</u><br/>";
  558. }
  559. break;
  560.  
  561. case 6;//add netice
  562. if(isset($_POST['shot_1']) and isset($_POST['shot_2']))
  563. {
  564. $shot_one = intval($_POST['shot_1']);
  565. $shot_two = intval($_POST['shot_2']);
  566. $shot_id = intval($_POST['shot_id']);
  567. if($shot_one > $shot_two)
  568. {
  569. $stat = 2;
  570. $fb_stat = 1;
  571. }
  572. else
  573. if($shot_one < $shot_two)
  574. {
  575. $stat = 0;
  576. $fb_stat = 2;
  577. }
  578. else
  579. {
  580. $stat = 1;
  581. $fb_stat = 3;
  582. }
  583. $netice = array("Qonaq komanda qelebe qazand&#305;", "Oyun He&#231;-He&#231;e sona &#231;atd&#305;", "Meydan sahibi qelebe qazand&#305;");
  584. $arr_netice = $netice[$stat];
  585. $sql = mysql_query("SELECT * FROM football WHERE foot_status='0' and id='".$shot_id."';");
  586. if(mysql_affected_rows()==false)
  587. {
  588. echo "Oyun tap&#305;lmad&#305;.<br/>\n";
  589. }
  590. else
  591. {
  592. $fb = mysql_fetch_array($sql);
  593. $team_one = $fb['team_one'];
  594. $team_two = $fb['team_two'];
  595. $update = mysql_query("UPDATE football SET foot_shot='".$shot_one." - ".$shot_two."', foot_status='".$fb_stat."' WHERE id='".$shot_id."'");
  596. if($update == true)
  597. {
  598. $select = mysql_query("SELECT * FROM fb_prognoz WHERE football_id='".$shot_id."'");
  599. while($up = mysql_fetch_array($select))
  600. {
  601. $kafcent = $up['kafcent'];
  602. $user_id = $up['user_id'];
  603. $bal = $up['bal'];
  604. $users_sql = mysql_query("SELECT * FROM users WHERE id='".$user_id."'");
  605. if(mysql_num_rows($users_sql)!=0)
  606. {
  607. $u = mysql_fetch_array($users_sql);
  608. $usid = $u['id'];
  609. $us = $u['user'];
  610. if($kafcent == $stat)
  611. {
  612. $game_kaficent = $fb['kafcent_'.$kafcent];
  613. $hesab = sprintf("%01.0f", ($bal * $game_kaficent));
  614. $msg = "H&#246;rmetli <b>".$us."</b>, Futbol Proqnoz oyununda <b>".$team_one." - ".$team_two."</b> komandalar&#305; aras&#305;nda geden m&#305;barizenin neticeleri belli oldu <u>".$arr_netice."</u>, Hesab: <b>".$shot_one." - ".$shot_two."</b>. Verdiyiniz proqnoz d&#252;zg&#252;n oldu&#287;u &#252;&#231;&#252;n oyuna qoydu&#287;nuz bal oyunun kafsentine vurularaq <b>".$bal." x ".$game_kaficent." = ".$hesab."</b> bal hesab&#305;n&#305;za elave olundu. Tebrik edirik!";
  615. @mysql_query("UPDATE users SET bal = bal + '".$hesab."' WHERE id='".$user_id."'");
  616. }
  617. else
  618. {
  619. $msg = "H&#246;rmetli <b>".$us."</b>, Futbol Proqnoz oyununda <b>".$team_one." - ".$team_two."</b> komandalar&#305; aras&#305;nda geden m&#305;barizenin neticeleri belli oldu <u>".$arr_netice."</u>, Hesab: <b>".$shot_one." - ".$shot_two."</b>. Sizin verdiyiniz proqnoz d&#252;zg&#252;n olmad&#305;&#287;&#305;ndan hesab&#305;n&#305;za bal elave olunmad&#305;.";
  620. }
  621. $time = time()+$vaxt;
  622. @mysql_query("INSERT INTO zapiski values(0,'Futbol Proqnoz','7','".$msg."','".$us."','".$usid."','".$time."','0','Futbol Proqnoz neticeleri','".date("d-M-Y H:i")."','1','1');");
  623. }
  624. }
  625. $i = 0;
  626. while ($i <= 9)
  627. {
  628. $st = time();
  629. $today = date("H:i", mktime(date("H") + $xsat));
  630. $mes = "<img src=\"img/top.gif\" alt=\"Top\"/> <b>Futbol neticeleri</b> - <u><b>".$team_one." - ".$team_two."</b> ".$arr_netice." (".$shot_one." - ".$shot_two.")</u>";
  631. $rnd = rand(0, 99999999);
  632. @mysql_query("INSERT INTO room$i SET klu4= '".$rnd."', time='".$today."', who='Hakim', message='".$mes."', id='".$st."', towhom='', hid='0', usid='10'");
  633. ++$i;
  634. }
  635. $rnd = rand(0, 9);
  636. $online = time() + $vaxt;
  637. @mysql_query("UPDATE `users` SET `time` = '".$online."', `room` = '".$rnd."' WHERE `id` = '10';");
  638. echo "Qeyd etdiyiniz oyunun neticeleri deyi&#351;dirildi.<br/>\n";
  639. }
  640. else
  641. {
  642. echo "Bazada problem var bir ne&#231;e deqiqe sonra yene yoxlay&#305;n.<br/>\n";
  643. }
  644. }
  645. }
  646. break;
  647. }
  648. if($go)
  649. {
  650. echo $divide;
  651. echo "<a href=\"football.php?id=$id&amp;ps=$ps&amp;mod=$mod&amp;ref=$ref\">Admin panel</a><br/>\n";
  652. }
  653. break;
  654.  
  655. case 6;//add prognoz
  656. $kafcent = intval($_POST['kafcent']);
  657. $ball = intval($_POST['ball']);
  658. $game = intval($_POST['game']);
  659. $sql = mysql_query("SELECT * FROM football WHERE foot_status='0' and id='".$game."';");
  660. $fb = mysql_fetch_array($sql);
  661. $fb_bal = $fb['bal'];
  662. $fb_date = $fb['foot_date'];
  663. $curdate = str_replace("/", "", $fb_date);
  664. $curdate = str_replace(" ", "", $curdate);
  665. $curdate = str_replace(":", "", $curdate);
  666. if(mysql_num_rows($sql)==0)
  667. {
  668. $error = "Oyun tap&#305;lmad&#305;.";
  669. }
  670. else
  671. if($curdate < date("dmYHi"))
  672. {
  673. $error = "Start verilen oyunlara proqnoz vermek olmaz.";
  674. }else
  675. if($kafcent<0 and $kafcent>2)
  676. {
  677. $error = "Xeta ba&#351; verdi.";
  678. }
  679. else
  680. if($ball<$fb_bal)
  681. {
  682. $error = "Bu oyuna proqnoz vermek &#252;&#231;&#252;n oyuna minimum <b>".$fb_bal."</b> bal qoymal&#305;s&#305;z.";
  683. }
  684. else
  685. if($fb_bal>$row['bal'])
  686. {
  687. $error = "Bu oyuna proqnoz vermek &#252;&#231;&#252;n hesab&#305;n&#305;zda kifayet qeder bal yoxdur.";
  688. }
  689. else
  690. if($ball> $row['bal'])
  691. {
  692. $error = "Ay u&#351;aq ged ba&#351;qa yerde oyne =)";
  693. }
  694. else
  695. if(mysql_num_rows(mysql_query("SELECT * FROM fb_prognoz WHERE football_id='".$game."' and user_id='".$id."';"))!=0)
  696. {
  697. $error = "Siz bu oyuna daha &#246;nce proqnoz vermisiz.";
  698. }
  699. if($error == true)
  700. {
  701. echo $error."<br/>\n";
  702. echo $divide;
  703. echo "<anchor>Geri Qay&#305;t<prev/></anchor><br/>";
  704. }
  705. else
  706. {
  707. $pr_sql = mysql_query("INSERT INTO fb_prognoz SET football_id='".$game."', user_id='".$id."', kafcent='".$kafcent."', bal='".$ball."', date='".time()."'");
  708. if($pr_sql == true)
  709. {
  710. echo "Verdiyiniz proqnoz qeyde al&#305;nd&#305;.<br/>\n";
  711. @mysql_query("UPDATE users SET bal = bal - '".$ball."' WHERE id='".$id."'");
  712. }
  713. else
  714. {
  715. echo "Bazada problem var bir ne&#231;e deqiqe sonra yene yoxlay&#305;n.<br/>\n";
  716. }
  717. }
  718. break;
  719.  
  720. case 7;//duzgun prognozlar
  721. $fid = intval($_GET['fid']);
  722. $sql = mysql_query("SELECT * FROM football WHERE id='".$fid."' AND foot_status!='0';");
  723. if(mysql_affected_rows()==false)
  724. {
  725. echo "Oyun tap&#305;lmad&#305;.<br/>\n";
  726. break;
  727. }
  728. $fb = mysql_fetch_array($sql);
  729. $home_team = $fb['team_one'];
  730. $user_team = $fb['team_two'];
  731. $fb_shot = $fb['foot_shot'];
  732.  
  733. echo "<u>".$home_team."</u> - <u>".$user_team."</u> oyununa d&#252;zg&#252;n proqnoz verdiler.<br/>";
  734. echo $divide;
  735. list($h1,$h2) = split(" - ", $fb_shot);
  736. if($h1 > $h2)
  737. {
  738. $cafcent = 2;
  739. }
  740. else if($h1 < $h2)
  741. {
  742. $cafcent = 0;
  743. }
  744. else
  745. {
  746. $cafcent = 1;
  747. }
  748. $all = mysql_query("SELECT COUNT(id) FROM fb_prognoz WHERE football_id='".$fid."' AND kafcent='".$cafcent."'");
  749. $total = mysql_result($all, 0);
  750.  
  751. $max = 10;
  752. $page = (!isset($_GET['page'])) ? 0 : $_GET['page'];
  753. $start = (!isset($page)) ? 0 : ($page * $max);
  754. $end = (!isset($page)) ? $max : ($start + $max);
  755. if(ceil($total/$max) < $page)
  756. {
  757. $start=0;
  758. $end=$max;
  759. }
  760. $duzgun = mysql_query("SELECT user_id,kafcent,bal,date FROM fb_prognoz WHERE football_id='".$fid."' AND kafcent='".$cafcent."' ORDER BY date DESC LIMIT $start,$max");
  761. if(mysql_affected_rows() == false)
  762. {
  763. echo "Bu oyuna proqnoz veren olmay&#305;b<br/>\n";
  764. break;
  765. }
  766. while(list($user_id,$kafcent,$bal,$date) = mysql_fetch_array($duzgun))
  767. {
  768. if($start!=($page * $max))echo $divide;
  769. $obj = select_nk($user_id);
  770. $usid = $obj->id;
  771. $username = $obj->user;
  772. $fb_kaficent = $fb['kafcent_'.$kafcent];
  773. $hesab = sprintf("%01.0f", ($bal * $fb_kaficent));
  774.  
  775. echo "<b>Proqnoz&#231;u:</b> [<a href=\"info.php?id=$id&amp;ps=$ps&amp;nk=".$usid."&amp;ref=$ref\">".$username."</a>]<br/>\n";
  776. echo "<b>Qazand&#305;:</b> (".$fb_kaficent." x ".$bal." = ".$hesab.") bal<br/>\n";
  777. echo "<b>Tarix:</b> ".cc_tarix($date)."<br/>\n";
  778. ++$start;
  779. }
  780. if($total > $max)
  781. {
  782. echo navigation("football.php?mod=$mod&amp;fid=$fid&amp;id=$id&amp;ps=$ps&amp;ref=$ref",$total,$max,$page);
  783. }
  784. break;
  785.  
  786. case 8;//sehf prognozlar
  787. $fid = intval($_GET['fid']);
  788. $sql = mysql_query("SELECT * FROM football WHERE id='".$fid."' AND foot_status!='0';");
  789. if(mysql_affected_rows()==false)
  790. {
  791. echo "Oyun tap&#305;lmad&#305;.<br/>\n";
  792. break;
  793. }
  794. $fb = mysql_fetch_array($sql);
  795. $home_team = $fb['team_one'];
  796. $user_team = $fb['team_two'];
  797. $fb_shot = $fb['foot_shot'];
  798.  
  799. echo "<u>".$home_team."</u> - <u>".$user_team."</u> oyununa yanl&#305;&#351; proqnoz verdiler.<br/>";
  800. echo $divide;
  801. list($h1,$h2) = split(" - ", $fb_shot);
  802. if($h1 > $h2)
  803. {
  804. $cafcent = 2;
  805. }
  806. else if($h1 < $h2)
  807. {
  808. $cafcent = 0;
  809. }
  810. else
  811. {
  812. $cafcent = 1;
  813. }
  814. $all = mysql_query("SELECT COUNT(id) FROM fb_prognoz WHERE football_id='".$fid."' AND kafcent!='".$cafcent."'");
  815. $total = mysql_result($all, 0);
  816.  
  817. $max = 10;
  818. $page = (!isset($_GET['page'])) ? 0 : $_GET['page'];
  819. $start = (!isset($page)) ? 0 : ($page * $max);
  820. $end = (!isset($page)) ? $max : ($start + $max);
  821. if(ceil($total/$max) < $page)
  822. {
  823. $start=0;
  824. $end=$max;
  825. }
  826. $duzgun = mysql_query("SELECT user_id,kafcent,bal,date FROM fb_prognoz WHERE football_id='".$fid."' AND kafcent!='".$cafcent."' ORDER BY date DESC LIMIT $start,$max");
  827. if(mysql_affected_rows() == false)
  828. {
  829. echo "Bu oyuna proqnoz veren olmay&#305;b<br/>\n";
  830. break;
  831. }
  832. while(list($user_id,$kafcent,$bal,$date) = mysql_fetch_array($duzgun))
  833. {
  834. if($start!=($page * $max))echo $divide;
  835. $obj = select_nk($user_id);
  836. $usid = $obj->id;
  837. $username = $obj->user;
  838.  
  839. echo "<b>Proqnoz&#231;u:</b> [<a href=\"info.php?id=$id&amp;ps=$ps&amp;nk=".$usid."&amp;ref=$ref\">".$username."</a>]<br/>\n";
  840. echo "<b>&#304;tirdi:</b> (".$bal.") bal<br/>\n";
  841. echo "<b>Tarix:</b> ".cc_tarix($date)."<br/>\n";
  842. ++$start;
  843. }
  844. if($total > $max)
  845. {
  846. echo navigation("football.php?mod=$mod&amp;fid=$fid&amp;id=$id&amp;ps=$ps&amp;ref=$ref",$total,$max,$page);
  847. }
  848. break;
  849. }
  850. echo $divide;
  851. if($mod)
  852. {
  853. echo "<a href=\"football.php?id=$id&amp;ps=$ps&amp;ref=$ref\">Futbol proqnoz</a><br/>\n";
  854. }
  855. echo "<a href=\"funk.php?id=$id&amp;ps=$ps&amp;r=$ref\">Funksiyalar</a><br/>\n";
  856. echo "<a href=\"enter.php?id=$id&amp;ps=$ps&amp;ref=$ref\">Dehliz</a><br/>\n";
  857. echo $fsize2;
  858. echo "</p></card></wml>";
  859. mysql_close($link);
  860. ?>
Redaktə (t) Hesabat et (t)
#5
SistemNick, Tesekkurler Qadasi
Redaktə (t) Hesabat et (t)
#6
By_InTlZaM, deymez
Redaktə (t) Hesabat et (t)
#7
mende var.ama o qeder qarişiq yerleri var ki, qurmaq bir az cetindi. bazani versen quraram. numune de var
Redaktə (t) Hesabat et (t)
#8
[c]# By_InTlZaM (27.06.2016 / 09:25)
Salam Forum EhLi Mene Bu FunksuyaLar Lazimdi Kim Verer?

Masin aL
Siqaret aL
FutboL Praqnozu

Bu FunksuyaLari Kim Vere Biler?

Onceden TesekkurLer Edirem.[/c]Mende siqaret al var amma wml ucundu uygunlawdira bilsrn mene dr ver
Şərhdəki Fayllarimage Sıxılmış arxiv faylı (zip) (88.41 KB)

Faylı Yüklə
Yüklənildi: 18 dəfə
Redaktə (t) Hesabat et (t)
#9
aye mende var pm yazarsan vererem
Redaktə (t) Hesabat et (t)


[-]
Sürətli Cavab Yaz
Mesaj
Burada bu mövzuya öz şərhinizi yazın.