} function cancel() { echo "Couldn't apply settings: " . mysql_error(); mysql_query("rollback"); die; } mysql_query("begin"); if (!mysql_query($sql)) { cancel(); } if ($user && !mysql_query("update `activeSemester` set `enrollment` = '{$reg}', `section` = '{$newsect}' where `member` = '{$newemail}' and `semester` = '{$SEMESTER}' and `choir` = '{$choir}'")) { cancel(); } if (!$user && !mysql_query("insert into `activeSemester` (`member`, `semester`, `choir`, `enrollment`, `section`) values ('{$newemail}', '{$SEMESTER}', '{$choir}', '{$reg}', '{$newsect}')")) { cancel(); } mysql_query("commit"); if (!$user || $newsect != $oldsect) { $msg = updateSection($newemail, $SEMESTER, $choir, $newsect, $user); if ($msg != "") { die("Couldn't set section: " . $msg); } } if (!$user || $user == $email) { setcookie("email", base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $sessionkey, $newemail, MCRYPT_MODE_ECB)), time() + 60 * 60 * 24 * 120, "/", false, false); } if (!$user) { setcookie('choir', base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $sessionkey, $choir, MCRYPT_MODE_ECB)), time() + 60 * 60 * 24 * 120, '/', false, false); } echo "OK";
$token = preg_replace("/\\s/", "", ucwords(preg_replace("/_/", " ", basename($file, ".php")))); $code = $fileCode = file_get_contents($file); $code = preg_replace("/zmVlang/", "zmVlang" . $token, $code); $code = preg_replace("/^header.*\$/m", "", $code); $code = preg_replace("/^setlocale.*\$/m", "", $code); $tmpFile = $file . ".tmp"; $newFile = $file . ".new"; if ($fp = fopen($tmpFile, "w")) { fwrite($fp, $code); fclose($fp); } require_once $tmpFile; unlink($tmpFile); updateSection($fileCode, 'SLANG'); updateSection($fileCode, 'CLANG'); updateSection($fileCode, 'VLANG'); if ($fp = fopen($newFile, "w")) { fwrite($fp, $fileCode); fclose($fp); } rename($newFile, $file); } function updateSection(&$code, $section) { global $termOffset, $commOffset, $modDate; $pattern = '/^(.+' . $section . ' = array\\(\\n)(.+)(\\);.+?)/sU'; //echo "P:'$pattern'\n"; if (!preg_match($pattern, $code, $fileParts)) { die("Can't find '.{$section}.' array\n"); } //echo "F:'".$fileParts[2]."'\n";
// $property->lineNo=($i+1); // $property->property_value=$array[$i]; // $property->property_id = ($propertyStartId + $col); // if($property->property_value != null) // $property->store($propValues); // } // // } // //} //biter //G33 $section = 33; $columnNo = 3; $inpName = 'G' . $section; updateSection($section, $columnNo, $inpName, $row, $edit_kredi_id, $property); // // // $db2 =& JFactory::getDBO(); // $query2 = 'SELECT * FROM #__property_types where section="'.$section.'" order by id asc; '; // $db2->setQuery($query2); // $propTypes = $db2->loadObjectList(); // $propertyStartId=$propTypes[0]->id ; // // // for($col=0; $col<$columnNo; $col++ )//her bir kolon için // { // $array=$_POST['input'.$inpName.'-'.($col+1)]; // for($i=0; $i<count($array); $i++)//herbir kolonun herbir elemanı için // { // $property->id = 0; // to insert a new row
$_POST['error'] = $error; if ($error == "NoError") { updateNews($_POST['nom'], $_POST['image'], $_POST['jeux'], $_POST['desc'], $news->idnews); header('Location : index.php?page=admin'); } else { echo "<div class='error' >" . $error . "</div>"; } } if (isset($_GET['section'])) { $jeu = recupJeu($_GET['section']); } if (isset($_POST['editerSection'])) { $error = checkSectionEdition($jeu); $_POST['error'] = $error; if ($error == "NoError") { updateSection($_POST['nom'], $_POST['couleur'], $_POST['image'], $_POST['desc'], $jeu->idjeux); header('Location : index.php?page=admin'); } else { echo "<div class='error' >" . $error . "</div>"; } } if (isset($_GET['event'])) { $event = recupEvent($_GET['event']); } if (isset($_POST['editerEvent'])) { $error = checkEventEdition($event); $_POST['error'] = $error; if ($error == "NoError") { updateEvent($_POST['nom'], $_POST['type'], $_POST['date'], $_POST['heure'], $_POST['localisation'], $_POST['image'], $_POST['jeux'], $_POST['desc'], $event->idevent); header('Location : index.php?page=admin'); } else {
if ($value == 0) { if (!mysql_query("delete from `activeSemester` where `member` = '{$member}' and `semester` = '{$semester}' and `choir` = '{$CHOIR}'")) { die("Error: " . mysql_error()); } } else { if ($value == 1 || $value == 2) { $state = $value == 1 ? 'club' : 'class'; if ($wasactive) { $query = "update `activeSemester` set `enrollment` = '{$state}' where `member` = '{$member}' and `semester` = '{$semester}' and `choir` = '{$CHOIR}'"; } else { $query = "insert into `activeSemester` (`member`, `semester`, `choir`, `enrollment`) values ('{$member}', '{$semester}', '{$CHOIR}', '{$state}')"; } if (!mysql_query($query)) { die("Error: " . mysql_error()); } } else { die("BAD_VALUE {$value}"); } } } if (isset($_POST['section'])) { $section = mysql_real_escape_string($_POST['section']); if (!$wasactive) { die("Can't change section for inactive semester"); } $msg = updateSection($member, $semester, $CHOIR, $section); if ($msg != "") { die("Error changing section: " . $msg); } } echo "OK";
createSection($_POST['sectionInput'], $_POST['selectedYear']); header("location: index?year=" . $_POST['selectedYear']); } if (isset($_POST['yearInput'])) { createYear($_POST['yearInput']); header("location: index?year=" . $_POST['yearInput']); } if (isset($_POST['deletevideoid'])) { deleteVideo($_POST['deletevideoid']); } if (isset($_POST['deleteyearid'])) { deleteYear($_POST['deleteyearid']); } if (isset($_POST['updatesectionInput']) && isset($_POST['updatesectionold']) && isset($_POST['sectionsid']) && isset($_POST['updatesectionyear'])) { if ($_POST['updatesectionInput'] != "") { updateSection($_POST['updatesectionold'], $_POST['updatesectionInput'], $_POST['sectionsid'], $_POST['updatesectionyear']); header("location: index?year=" . $_POST['updatesectionyear'] . "§ion=" . $_POST['updatesectionInput']); } else { deleteSection($_POST['updatesectionold'], $_POST['updatesectionyear']); header("location: index?year=" . $_POST['updatesectionyear'] . "§ion=" . $_POST['updatesectionold']); } } ?> <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Aikido Yoshinkai Canada</title>