Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- define('ACTION', true);
- include('common.php');
- if ( !$session_logged_in )
- {
- echo "Nie masz uprawnień by wyświetlić tę stronę. <a href=\"http://URL.pl/profile/login.htm\">Zaloguj się</a>.";
- die;
- }
- $page_title = 'Dodaj zabieg';
- include('includes/page_header.php');
- $user1name = $userdata['user_name'];
- include 'config1.php';
- $hostname=$config1['DB_HOST'];
- $username=$config1['DB_USERNAME'];
- $password=$config1['DB_PASSWORD'];
- $db = $config1['DB_DATABASE'];
- $dbh = new PDO("mysql:host=$hostname;dbname=$db", $username, $password);
- $link = mysql_connect($hostname, $username, $password);
- mysql_select_db($db, $link);
- $result2 = mysql_query("SELECT nrwpisu FROM AA_users_table WHERE user_name = '" . $user1name . "'", $link);
- if (!$result2) {
- echo 'Nie można uruchomić zapytania: ' . mysql_error();
- exit;
- }
- $row = mysql_fetch_row($result2);
- $stmt = mysql_query("SELECT * FROM " . $user1name . "", $link);
- $num_rows = mysql_num_rows($stmt);
- if ($num_rows < $max_free_add) { // Max zabiegów do dodania za free
- $template = new Template();
- $template->set_filenames(array(
- 'body' => 'addprocedure/addprocedure'.$row[0].'.tpl')
- );
- } else {
- $template = new Template();
- $template->set_filenames(array(
- 'body' => 'addprocedure/addprocedure'.$row[0].'-platny.tpl')
- );
- }
- $result3 = mysql_query("SELECT Miejsce FROM " . $user1name . " ORDER BY id DESC LIMIT 1", $link);
- if (!$result3) {
- echo 'Nie można uruchomić zapytania: ' . mysql_error();
- exit;
- }
- $miejsce = mysql_fetch_row($result3);
- $result4 = mysql_query("SELECT NazwaStazu FROM " . $user1name . " ORDER BY id DESC LIMIT 1", $link);
- if (!$result4) {
- echo 'Nie można uruchomić zapytania: ' . mysql_error();
- exit;
- }
- $nazwastazu = mysql_fetch_row($result4);
- if ( $userdata['user_vip'] )
- {
- $template->assign_block_vars('user_vip', array());
- }
- else
- {
- $template->assign_block_vars('user_not_vip', array());
- }
- $template->assign_vars(array(
- 'add_opis' => $lang['add_opis'],
- 'miejsce' => $miejsce[0],
- 'nazwastazu' => $nazwastazu[0])
- );
- $template->pparse('body');
- include('includes/page_footer.php');
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement