Permalink
Browse files

first push

  • Loading branch information...
1 parent 1fedd9b commit cd2694ffe95f6152b598327e9a27e298013b0e34 @mkavakebi committed Apr 16, 2012
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
@@ -0,0 +1,134 @@
+-- phpMyAdmin SQL Dump
+-- version 3.1.3.1
+-- http://www.phpmyadmin.net
+--
+-- Host: localhost
+-- Generation Time: Mar 29, 2010 at 07:36 AM
+-- Server version: 5.1.33
+-- PHP Version: 5.2.9
+
+SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
+
+
+/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
+/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
+/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
+/*!40101 SET NAMES utf8 */;
+
+--
+-- Database: `competitiondb`
+--
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `egg`
+--
+
+CREATE TABLE IF NOT EXISTS `egg` (
+ `ID` int(11) NOT NULL AUTO_INCREMENT,
+ `groupname` varchar(50) NOT NULL,
+ `bord` double NOT NULL,
+ `davar` int(11) NOT NULL,
+ `school` varchar(50) NOT NULL,
+ `turn` int(11) NOT NULL,
+ `state` varchar(50) NOT NULL,
+ `E` double NOT NULL DEFAULT '0',
+ `score` int(11) NOT NULL,
+ PRIMARY KEY (`ID`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=51 ;
+
+--
+-- Dumping data for table `egg`
+--
+
+INSERT INTO `egg` (`ID`, `groupname`, `bord`, `davar`, `school`, `turn`, `state`, `E`, `score`) VALUES
+(39, 'wswwww', 0, 0, 'www', 4, '', 0, 0),
+(40, 'wegesh', 0, 0, 'zahs', 6, 'wait', 0, 0),
+(41, 'shbsg', 0, 0, 'shgsh', 9, '', 0, 0),
+(42, 'sjhg', 0, 0, 'sfgdh', 3, '', 0, 0),
+(43, 'سقعبلا', 0, 0, 'لاالب', 10, '', 0, 0),
+(44, 'اعل', 0, 0, '', 11, '', 0, 0),
+(45, 'لباتل', 0, 0, 'لالتا', 5, 'play', 0, 0),
+(46, 'اللال', 0, 0, 'اتالبلا', 8, '', 0, 0),
+(47, 'نتالب', 0, 0, 'تالب', 12, '', 0, 0),
+(48, 'عغالف', 0, 0, 'خهعاغلفبق', 7, '', 0, 0),
+(49, 'اغغفقبلات', 0, 0, 'اتنتالبیس', 2, 'wait', 0, 0),
+(50, 'ییبلاتالب', 12, 50, 'بلاتالبیس', 1, 'done', 1.5, 800);
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `manjenigh`
+--
+
+CREATE TABLE IF NOT EXISTS `manjenigh` (
+ `ID` int(11) NOT NULL AUTO_INCREMENT,
+ `groupname` varchar(50) NOT NULL,
+ `bord` double NOT NULL,
+ `davar` int(11) NOT NULL,
+ `school` varchar(50) NOT NULL,
+ `turn` int(11) NOT NULL,
+ `state` varchar(50) NOT NULL,
+ `vazn` double NOT NULL,
+ `score` int(11) NOT NULL,
+ PRIMARY KEY (`ID`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=39 ;
+
+--
+-- Dumping data for table `manjenigh`
+--
+
+INSERT INTO `manjenigh` (`ID`, `groupname`, `bord`, `davar`, `school`, `turn`, `state`, `vazn`, `score`) VALUES
+(27, 'aaaaaaa', 20, 25, 'aaa', 2, 'done', 1, 2000),
+(28, 'sggsg', 0, 0, 'shsh', 1, 'play', 0, 0),
+(29, 'adh', 0, 0, 'aaj', 8, 'wait', 0, 0),
+(30, 'ن', 0, 0, 'ما', 10, 'wait', 0, 0),
+(31, 'یظبا', 45, 25, 'یبابزشز', 7, 'done', 10, 450),
+(32, 'سثثثثث', 12, 50, 'سثققققققققققققققق', 11, 'done', 2, 600),
+(33, 'ظفر طزط', 0, 0, 'ظسلبسش', 9, 'wait', 0, 0),
+(34, 'سزطاباتب', 0, 0, 'ذلعا', 6, 'play', 0, 0),
+(35, 'قغعاغتل', 0, 0, 'لبعناتلتال', 12, '', 0, 0),
+(36, 'لانتن', 0, 0, 'بال', 4, 'play', 0, 0),
+(37, 'انتالباتنل', 0, 0, 'اتنالاتنتللات', 3, 'play', 0, 0),
+(38, 'لاتنالبتالذاتلا', 0, 0, 'بلاتعلبلباتالب', 5, '', 0, 0);
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `plane`
+--
+
+CREATE TABLE IF NOT EXISTS `plane` (
+ `ID` int(11) NOT NULL AUTO_INCREMENT,
+ `groupname` varchar(50) NOT NULL,
+ `bord` double NOT NULL,
+ `davar` int(11) NOT NULL,
+ `school` varchar(50) NOT NULL,
+ `turn` int(11) NOT NULL,
+ `state` varchar(50) NOT NULL,
+ `score` int(11) NOT NULL,
+ PRIMARY KEY (`ID`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=28 ;
+
+--
+-- Dumping data for table `plane`
+--
+
+INSERT INTO `plane` (`ID`, `groupname`, `bord`, `davar`, `school`, `turn`, `state`, `score`) VALUES
+(15, 'سمنسکمنسکم', 0, 0, 'کمتنکنتکت', 15, 'wait', 0),
+(14, 'adsad', 0, 0, 'afsadfgadg', 2, 'wait', 0),
+(13, 'homa2', 0, 0, 'shhaid55', 8, '', 0),
+(12, 'shahin1', 12, 95, 'shahid2', 3, 'done', 0),
+(11, 'homa1', 50, 20, 'shahid1', 9, 'done', 500),
+(16, 'بصسشل', 0, 0, 'شلللشیسسی', 6, '', 0),
+(17, 'هما1', 0, 0, 'شهید1', 11, '', 0),
+(18, 'سشی', 0, 0, 'سب', 4, '', 0),
+(23, 'سقغنهدبتال', 0, 0, 'لع6غالاع', 5, 'wait', 0),
+(20, 'یسلشاس', 0, 0, 'سصتسنت', 10, '', 0),
+(21, 'یسنینین', 0, 0, 'ینمینین', 13, '', 0),
+(22, 'ینییت', 55, 92, 'زبتزینز', 12, 'done', 550),
+(24, 'سقغنهدبتال', 0, 0, 'لع6غالاع', 7, '', 0),
+(25, 'rrrrrrrrr', 0, 0, 'rrrr', 14, '', 0),
+(26, 'sss', 0, 0, 's', 1, '', 0),
+(27, 'ghgh', 0, 0, 'jgfdj', 0, '', 0);
View
@@ -0,0 +1,17 @@
+<?php
+$user_name = "root";
+$password = "";
+$database = "competitiondb";
+$server = "127.0.0.1";
+/////////////////////////////
+session_start ();
+try {
+ $dbh = new PDO("mysql:host=$server;dbname=$database", $user_name, $password);
+ }
+catch(PDOException $e)
+ {
+ echo $e->getMessage();
+ die( 'FFFFFFFFFFF!');
+ return;
+ }
+?>
View
@@ -0,0 +1,37 @@
+<?php
+ include 'config.php';
+ include 'functions.php';
+?>
+<body style="background-image:url('../back2.jpg');background-repeat:no-repeat;" onload="JavaScript:timedRefresh(2000);">
+</br>
+<table border="1" width="700" style="text-align: center;font-size: 100;">
+<caption >مشغول رکوردگیری</caption>
+ <?php
+ $stmt = $dbh->prepare("SELECT * FROM egg WHERE state='play' ORDER BY turn");
+ $stmt->execute();
+ while($db_field = $stmt->fetch()){
+ ?>
+ <td><?php echo $db_field['groupname'];?></td>
+ <?php }?>
+</table>
+</br>
+</br>
+</br>
+<table border="1" width="900" style="text-align: center;font-size: 40;font-style: oblique; ">
+<caption >گروه های در حال انتظار</caption>
+ <?php
+ $stmt = $dbh->prepare("SELECT * FROM egg WHERE state='wait' ORDER BY turn");
+ $stmt->execute();
+ while($db_field = $stmt->fetch()){
+ ?>
+ <td><?php echo $db_field['groupname'];?></td>
+ <?php }?>
+</table>
+<script type="text/JavaScript">
+<!--
+function timedRefresh(timeoutPeriod) {
+ setTimeout("location.reload(true);",timeoutPeriod);
+}
+// -->
+</script>
+</body>
View
@@ -0,0 +1,5 @@
+<?php
+include '../dbinfo.php';
+$max_play=1;
+$max_wait=5;
+?>
View
@@ -0,0 +1,132 @@
+<?php
+ include 'config.php';
+ include 'functions.php';
+?>
+<?php
+if(isset( $_REQUEST['wait'])){
+ $er=SetState('wait',$_REQUEST['id'],$max_wait,$dbh);
+ if($er){
+ ?>
+ <P style="text-align:center;">.لیست انتظار پر شده است</P>
+ <?php }
+}
+if(isset( $_REQUEST['play'])){
+ $er=SetState('play',$_REQUEST['id'],$max_play,$dbh);
+ if($er){
+ ?>
+ <center>.لیست رکورد گیری پر شده است</center>
+ <?php }
+}
+if(isset( $_REQUEST['done'])){
+ SetState('done',$_REQUEST['id'],0,$dbh);
+}
+if(isset( $_REQUEST['undone'])){
+ SetState('',$_REQUEST['id'],0,$dbh);
+}
+?>
+<P style="text-align: center;"><a href="index.php">بازگشت به صفحه ی اصلی</a></P>
+<br>
+<table width=100% border="3">
+<th>گروه هایی که در انتظار رکورد گیری هستند</th>
+<th>گروه هایی که هم اکنون در حال رکورد گیری هستند</th>
+<tr>
+ <td>
+ <table border="1" width="100%">
+ <tr bgcolor="green">
+ <th width="100" class="bTD" height="18">نوبت</th>
+ <th width="120" class="bTD" height="18">نام گروه</th>
+ <th width="368" class="bTD" height="18">نام مدرسه</th>
+ <th width="20" class="bTD" height="18">بازی</th>
+ <th width="20" class="bTD" height="18">معمولی</th>
+ </tr>
+ <?php
+ $stmt = $dbh->prepare("SELECT * FROM egg WHERE state='wait' ORDER BY turn");
+ $stmt->execute();
+ while($db_field = $stmt->fetch()){
+ ?>
+ <tr bgcolor=<?php if($odd){echo "#CCECCC";}else{echo "#F7F7F7";} $odd=!$odd; ?> align="center" vAlign="top">
+ <td width="100" class="bTD" height="18"><?php echo $db_field['turn'];?></td>
+ <td width="120" class="bTD" height="18"><?php echo NameLink($db_field['groupname'],$db_field['ID'],$dbh);?></td>
+ <td width="368" class="bTD" height="18"><?php echo $db_field['school'];?></td>
+ <td width="20" class="bTD" height="18"><a href="?play=1&id=<?php echo $db_field['ID'];?>">بازی</a></td>
+ <td width="20" class="bTD" height="18"><a href="?undone=1&id=<?php echo $db_field['ID'];?>">معمولی</a></td>
+ </tr>
+ <?php }?>
+ </table>
+ </td>
+
+ <td>
+ <table border="1" width="100%">
+ <tr bgcolor="green">
+ <th width="100" class="bTD" height="18">نوبت</th>
+ <th width="120" class="bTD" height="18">نام گروه</th>
+ <th width="368" class="bTD" height="18">نام مدرسه</th>
+ <th width="20" class="bTD" height="18">انتظار</th>
+ </tr>
+ <?php
+ $stmt = $dbh->prepare("SELECT * FROM egg WHERE state='play' ORDER BY turn");
+ $stmt->execute();
+ while($db_field = $stmt->fetch()){
+ ?>
+ <tr bgcolor=<?php if($odd){echo "#CCECCC";}else{echo "#F7F7F7";} $odd=!$odd; ?> align="center" vAlign="top">
+ <td width="100" class="bTD" height="18"><?php echo $db_field['turn'];?></td>
+ <td width="120" class="bTD" height="18"><?php echo NameLink($db_field['groupname'],$db_field['ID'],$dbh);?></td>
+ <td width="368" class="bTD" height="18"><?php echo $db_field['school'];?></td>
+ <td width="20" class="bTD" height="18"><a href="?wait=1&id=<?php echo $db_field['ID'];?>">انتظار</a></td>
+ </tr>
+ <?php }?>
+ </table>
+ </td>
+</tr>
+</table>
+</br></br>
+<table width=100% border="3">
+<th>گروه هایی که هنوز در مسابقه شرکت نکرده اند</th>
+<th>گروه هایی که رکورد گیری آنها به پایان رسیده</th>
+<tr>
+
+ <td>
+ <table border="1" width="100%">
+ <tr bgcolor="green">
+ <th width="100" class="bTD" height="18">نوبت</th>
+ <th width="120" class="bTD" height="18">نام گروه</th>
+ <th width="368" class="bTD" height="18">نام مدرسه</th>
+ <th width="20" class="bTD" height="18">انتظار</th>
+ </tr>
+ <?php
+ $stmt = $dbh->prepare("SELECT * FROM egg WHERE state='' ORDER BY turn");
+ $stmt->execute();
+ while($db_field = $stmt->fetch()){
+ ?>
+ <tr bgcolor=<?php if($odd){echo "#CCECCC";}else{echo "#F7F7F7";} $odd=!$odd; ?> align="center" vAlign="top">
+ <td width="100" class="bTD" height="18"><?php echo $db_field['turn'];?></td>
+ <td width="120" class="bTD" height="18"><?php echo NameLink($db_field['groupname'],$db_field['ID'],$dbh);?></td>
+ <td width="368" class="bTD" height="18"><?php echo $db_field['school'];?></td>
+ <td width="20" class="bTD" height="18"><a href="?wait=1&id=<?php echo $db_field['ID'];?>">انتظار</a></td>
+ </tr>
+ <?php }?>
+ </table>
+ </td>
+
+ <td>
+ <table border="1" width="100%">
+ <tr bgcolor="green">
+ <th width="100" class="bTD" height="18">نوبت</th>
+ <th width="120" class="bTD" height="18">نام گروه</th>
+ <th width="368" class="bTD" height="18">نام مدرسه</th>
+ </tr>
+ <?php
+ $stmt = $dbh->prepare("SELECT * FROM egg WHERE state='done' ORDER BY turn");
+ $stmt->execute();
+ while($db_field = $stmt->fetch()){
+ ?>
+ <tr bgcolor=<?php if($odd){echo "#CCECCC";}else{echo "#F7F7F7";} $odd=!$odd; ?> align="center" vAlign="top">
+ <td width="100" class="bTD" height="18"><?php echo $db_field['turn'];?></td>
+ <td width="120" class="bTD" height="18"><?php echo NameLink($db_field['groupname'],$db_field['ID'],$dbh);?></td>
+ <td width="368" class="bTD" height="18"><?php echo $db_field['school'];?></td>
+ </tr>
+ <?php }?>
+ </table>
+ </td>
+</tr>
+</table>
View
@@ -0,0 +1,32 @@
+<?php
+ include 'config.php';
+ include 'functions.php';
+?>
+<P style="text-align: center;"><a href="index.php">بازگشت به صفحه ی اصلی</a></P>
+<table border="1" width="100%">
+ <tr bgcolor="green">
+ <th width="100" class="bTD" height="18">نوبت</th>
+ <th width="120" class="bTD" height="18">نام گروه</th>
+ <th width="368" class="bTD" height="18">نام مدرسه</th>
+ <th width="120" class="bTD" height="18">امتیاز</th>
+ <th width="120" class="bTD" height="18">مرحله چهارم</th>
+ <th width="120" class="bTD" height="18">نهایی</th>
+ </tr>
+ <?php
+ CalculateScore($dbh);
+ $stmt = $dbh->prepare("SELECT *,?*davar/100 as percentage FROM egg ORDER BY (score+percentage)");
+ $stmt->execute(array(MaxScore($dbh)));
+ while($db_field = $stmt->fetch())
+ {
+ $final=$db_field['score']+$db_field['percentage'];
+ ?>
+ <tr bgcolor=<?php if($odd){echo "#CCECCC";}else{echo "#F7F7F7";} $odd=!$odd; ?> align="center" vAlign="top">
+ <td width="100" class="bTD" height="18"><?php echo $db_field['turn'];?></td>
+ <td width="120" class="bTD" height="18"><?php echo NameLink($db_field['groupname'],$db_field['ID'],$dbh);?></td>
+ <td width="368" class="bTD" height="18"><?php echo $db_field['school'];?></td>
+ <td width="120" class="bTD" height="18"><?php echo $db_field['score'];?></td>
+ <td width="120" class="bTD" height="18"><?php echo $db_field['percentage'];?></td>
+ <td width="120" class="bTD" height="18"><?php echo $final;?></td>
+ </tr>
+<?php }?>
+</table>
Oops, something went wrong.

0 comments on commit cd2694f

Please sign in to comment.