include "config.php";
//Միանում ենք MySQL - ին
mysql_connect($host, $user, $pass) or die ("Հնարավոր չէ կապ հաստատել MySQL - հետ:
".mysql_error());
//Բազա ենք սարքում, այն դեպքում երբ չկա
mysql_query("CREATE DATABASE IF NOT EXISTS `$db`") or die("Կատարվել է սխալ, բազա սարքելու ժամանակ:
".mysql_error());
// ընտրում ենք բազան
mysql_select_db($db);
mysql_query("set names cp1251");
//mysql_query(" INSERT INTO `1407336190-yearwork-91F0WQ444X` SELECT * FROM `sportschoollevel1` ");
/*
mysql_query("
UPDATE `4604793018-paymentbook`
SET
`year` = '2018'
") or die("Տեղի է ունեցել սխալ, տվյալների բազայում փոփոխություն կատարելու ժամանակ
".mysql_error());
*/
if ($_GET['event']=="enter") {
$clubname=$_POST["myclubname"];
$clubid = $_POST["myclubid"];
$coachsearch = mysql_query("
SELECT *
FROM `clubs-table`
WHERE `clubid` = '$clubid' and `status` = 'ok'
") or die("Կատարվել է սխալ, բազայից ինֆորմացիա ընդունելու ժամանակ:
".mysql_error());
if(mysql_num_rows($coachsearch) > 0) { $coachsearch_list = mysql_fetch_assoc($coachsearch);
$clubidst=$coachsearch_list['clubid'];
$clubnamest=$coachsearch_list['clubname'];
if($clubnamest==$clubname and $clubidst==$clubid) {$true="ok";} else {$true="nook";}
}
if($true=="ok") {
$login = $_POST['mylogin'];
$password = $_POST['mypassword'];
$coachsearch = mysql_query("
SELECT *
FROM `$clubid-coaches`
WHERE `psw` = '$password' and `clubname` = '$clubname' and `status` = 'ok'
") or die("Կատարվել է սխալ, բազայից ինֆորմացիա ընդունելու ժամանակ:
".mysql_error());
if(mysql_num_rows($coachsearch) > 0) { $coachsearch_list = mysql_fetch_assoc($coachsearch);
$mypassword=$coachsearch_list['psw'];
$myname=$coachsearch_list['name']; $mynamearm=$coachsearch_list['namearm'];
$mylname=$coachsearch_list['lname']; $mylnamearm=$coachsearch_list['lnamearm'];
$mynameall = "$myname"."$mylname";
$coachid = $coachsearch_list['coachid'];
$clubid = $coachsearch_list['clubid'];
setcookie("passwordcoach", $mypassword, time()+60*60*24*31);
setcookie("namecoach", $mynameall, time()+60*60*24*31);
setcookie("clubid", $clubid, time()+60*60*24*31);
setcookie("idcoach", $coachid, time()+60*60*24*31);
$regenter="ok";
}
}
if($type=="marzich") {$header="index.php?event=linker";} else {$header="trpu/index.php?event=home";}
if (!isset($regenter)) {print "$back. Տվյալները ՍԽԱԼ են"; exit;}
header("Location: $header"); exit; }
if(isset($_GET['event'])) {
// очищаем куки, если выбран выход
if ($_GET['event']=="clearcooke") { setcookie("passwordcoach", "", -1); setcookie("namecoach", "", -1); setcookie("clubid", "", -1); setcookie("idcoach", "", -1); print ""; exit;}}
if(isset($_GET['event'])) {
// очищаем куки, если выбран выход
if ($_GET['event']=="clearcookeclub") { setcookie("clubid", ""); setcookie("idcoach", ""); setcookie("namecoach", ""); setcookie("passwordcoach", ""); print ""; exit;}}
include"topindex.php";
print"
![]() |
$pnamearm $plnamearm |
| Խաղ. համար՝ $pnumber |
| Հասակ՝ $phasak սմ |
| Ծնն.տար.՝ $tari թ. |
|