Advertisement
Guest User

Untitled

a guest
May 2nd, 2017
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.50 KB | None | 0 0
  1. <?php
  2. define('ACTION', true);
  3.  
  4. include('../common.php');
  5.  
  6. if ( !$session_logged_in )
  7. {
  8.     echo "Nie masz uprawnień by wyświetlić tę stronę. <a href=\"profile/login.htm\">Zaloguj się</a>.";
  9.     die;
  10. }
  11.  
  12. $page_title = 'Tabela zabiegów';
  13. include('../includes/page_header.php');
  14.  
  15. $mysql_tb = $userdata['user_name'];
  16. // Tables for this example.php see file: 'test.sql'
  17.  
  18. session_start();
  19. require_once("mte/mte.php");
  20. $tabledit = new MySQLtabledit();
  21.  
  22.  
  23.  
  24.         #####################
  25.        # required settings #
  26.        #####################
  27.  
  28.  
  29. # database settings:
  30. include '../config1.php';
  31.  
  32. $hostname=$config1['DB_HOST'];
  33. $username=$config1['DB_USERNAME'];
  34. $password=$config1['DB_PASSWORD'];
  35. $db = $config1['DB_DATABASE'];
  36.  
  37. $tabledit->database = $db;
  38. $tabledit->host = $hostname;
  39. $tabledit->user = $username;
  40. $tabledit->pass = $password;
  41.  
  42.  
  43. # table of the database you want to edit:
  44. $tabledit->table = $mysql_tb;
  45.  
  46.  
  47. # the primary key of the table (must be AUTO_INCREMENT):
  48. $tabledit->primary_key = 'id';
  49.  
  50.  
  51. # the fields you want to see in "list view"
  52. # Always add the primary key (`employeeNumber)`:
  53. $tabledit->fields_in_list_view = array('myID', 'Data', 'Rodzaj', 'Inicjaly', 'NazwiskoOperatora', 'Technika', 'NazwaZabiegu', 'Opis', 'id');
  54.  
  55.  
  56.  
  57.         #####################
  58.        # optional settings #
  59.        #####################
  60.  
  61.  
  62. # Head of the page (<h1>head_1<h1>):
  63. $tabledit->head_1 = "";
  64.  
  65.  
  66. # language (en=English, de=German, fr=French, nl=Dutch):
  67. $tabledit->language = 'pl';
  68.  
  69.  
  70. # numbers of rows/records in "list view":
  71. $tabledit->num_rows_list_view = 15;
  72.  
  73.  
  74. # required fields in edit or add record:
  75. $tabledit->fields_required = array();
  76.  
  77.  
  78. # Fields you want to edit (remove this to edit all the fields).
  79. #$tabledit->fields_to_edit = array('lastName','email','job');
  80.  
  81.  
  82. # help texts:
  83. $tabledit->help_text = array(
  84.     'id' => "Automatycznie przydzielany numer (nie kopiuje się do generowanego indeksu procedur)",
  85.     'Stanowisko' => 'A - operator; B - I Asysta...',
  86.     'Opis' => 'Twoja notatka/opis zabiegu (nie kopiuje się do generowanego indeksu procedur)',
  87.     'Rodzaj' => '',
  88.     'Data' => '',
  89.     'Rozpoznanie1' => 'Rozpoznanie przedoperacyjne',
  90.     'Rozpoznanie2' => 'Rozpoznanie pooperacyjne',
  91.     'NazwiskoOperatora' => 'Nazwisko osoby wykonującej zabieg',
  92.     'NazwiskaAsyst' => 'Nazwisko asyst / osoby nadzorującej',
  93.     'myID' => 'Twoja unikalna nazwa zabiegu (nie kopiuje się do generowanego indeksu procedur)'
  94. );
  95.  
  96.  
  97. # visible name of the fields:
  98. $tabledit->show_text = array(
  99.     'myID' => 'myID',
  100.     'id' => '(id)',
  101.     'Data' => 'Data',
  102.     'Kategoria' => 'Kategoria',
  103.     'Rodzaj' => 'Rodzaj',
  104.     'NazwaZabiegu' => 'Nazwa Zabiegu',
  105.     'NazwaStazu' => 'Nazwa Stażu',
  106.     'Opis' => 'Opis',
  107.     'Inicjaly' => 'Inicjały',
  108.     'Plec' => 'Płeć',
  109.     'NazwiskoOperatora' => 'Nazwisko Operatora',
  110.     'NazwiskoIAsysty' => 'Nazwisko I Asysty',
  111.     'NazwiskoIIAsysty' => 'Nazwisko II Asysty',
  112.     'NazwiskaAsyst' => 'Nazwiska Asyst',
  113.     'RodzajZnieczulenia' => 'Rodzaj Znieczulenia'
  114. );
  115.  
  116.  
  117. # visible name of the fields in list view:
  118. $tabledit->show_text_listview = array(
  119.     'myID' => 'myID',
  120.     'id' => '(id)',
  121.     'Data' => 'Data',
  122.     'Kategoria' => 'Kategoria',
  123.     'Rodzaj' => 'Rodzaj',
  124.     'NazwaZabiegu' => 'Nazwa Zabiegu',
  125.     'NazwaStazu' => 'Nazwa Stażu',
  126.       'Opis' => 'Opis',
  127.     'Inicjaly' => 'Inicjały',
  128.     'Plec' => 'Płeć',
  129.     'NazwiskoOperatora' => 'Nazwisko Operatora',
  130.     'NazwiskaAsyst' => 'Nazwiska Asyst'
  131. );
  132.  
  133.  
  134. /*
  135. # Make selectlist on inputfield based on another table
  136. # in this example: `employees`.`job` is based on `jobs`.`jobname`:
  137. $tabledit->lookup_table = array(
  138.     'job' => array(
  139.         'query' => "SELECT `id`, `jobname` FROM `jobs`;",
  140.         'option_value' => 'id',
  141.         'option_text' => 'jobname'
  142.     )
  143. );
  144. */
  145.  
  146. $tabledit->width_editor = '100%';
  147. $tabledit->width_input_fields = '500px';
  148. $tabledit->width_text_fields = '800px';
  149. $tabledit->height_text_fields = '500px';
  150.  
  151.  
  152. # warning no .htaccess ('on' or 'off'):
  153. $tabledit->no_htaccess_warning = 'off';
  154.  
  155.  
  156.  
  157.         ####################################
  158.        # connect, show editor, disconnect #
  159.        ####################################
  160.  
  161.  
  162. $tabledit->database_connect();
  163.  
  164. echo "<!DOCTYPE html>
  165. <html lang='pl'>
  166. <head>
  167.  
  168.    <meta charset='utf-8'>
  169.  
  170.    </head>
  171.    <body>
  172. ";
  173.  
  174. $tabledit->do_it();
  175.  
  176. echo "
  177.    </body>
  178.    </html>"
  179. ;
  180.  
  181. $tabledit->database_disconnect();
  182.  
  183. include('../includes/page_footer.php');
  184. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement