Projekt

Obecné

Profil

« Předchozí | Další » 

Revize c31f418f

Přidáno uživatelem Jan Palcút před téměř 6 roky(ů)

Re #7580 správa zdrojů

Zobrazit rozdíly:

old/html/multidic/app/webroot/administration/add_source.php
1 1
<?php
2 2
require_once("./functions/dictionary.php");
3 3

  
4
if (!Empty($action) && $action == "insert_new_source") {
4
if(isset($_REQUEST['submit_btn'])){
5 5
  require_once("./administration/source.php");
6 6
  
7 7
  $zobrazit_znovu = true;
8 8
  
9
  if (Empty($title)) {
9
  if (Empty(@$_REQUEST['title'])) {
10 10
    print_hlasku("Název musíte vyplnit");
11 11
  }
12
  else if (Empty($from_page)) {
12
  else if (Empty(@$_REQUEST['from_page'])) {
13 13
    print_hlasku("Od stránky musíte vyplnit");
14 14
  }
15
  else if (Empty($to_page)) {
15
  else if (Empty(@$_REQUEST['to_page'])) {
16 16
    print_hlasku("Do stránky musíte vyplnit");
17 17
  }
18 18
  else {
19
    insert_source($title, $subtitle, $place, $publication, $publication_no, $from_page, $to_page, $language, $year);
19
    insert_source(@$_REQUEST['title'], @$_REQUEST['subtitle'], @$_REQUEST['place'], @$_REQUEST['publication'], @$_REQUEST['publication_no'], @$_REQUEST['from_page'], @$_REQUEST['to_page'], @$_REQUEST['language'], @$_REQUEST['year']);
20 20
    $zobrazit_znovu = false;
21 21
  }
22 22
}
......
28 28
}
29 29

  
30 30
?>
31
<script language="JavaScript">
32
	function setFocus(object)
33
	{
34
	   	object.focus();
35
	   	object.select();
36
	}
37 31

  
38
  function validate_new_source_form(form) {
39
    new_source_form = form;
40
    if (new_source_form.title.value == "") {
41
      alert("Položku musite vyplnit.");
42
      setFocus(new_source_form.title);
43
      return false;
44
    }
45
    if (new_source_form.from_page.value == "") {
46
      alert("Položku musite vyplnit.");
47
      setFocus(new_source_form.from_page);
48
      return false;
49
    }
50
    if (new_source_form.to_page.value == "") {
51
      alert("Položku musite vyplnit.");
52
      setFocus(new_source_form.to_page);
53
      return false;
54
    }
55
    return true;
56
  }
57
</script>
58 32
<table>
59 33
    <thead align="center"> <h3 class="nadpis2">Vlož nový zdroj</h3> </thead>
60 34
    <tbody>
......
62 36
      <table border="0">
63 37
      <tr class="akt">
64 38
        <td>titul*</td>
65
        <td><input type="text" name="title"  size="50" maxlength="100"<?php znova($title)?>/></td>
39
        <td><input type="text" name="title"  size="50" maxlength="100"<?php znova(@$_REQUEST['title'])?>/></td>
66 40
      </tr>
67 41
      <tr class="akt">
68 42
        <td>podtitul</td>
69
        <td><input type="text" name="subtitle"  size="50" maxlength="100"<?php znova($subtitle)?>/></td>
43
        <td><input type="text" name="subtitle"  size="50" maxlength="100"<?php znova(@$_REQUEST['subtitle'])?>/></td>
70 44
      </tr>
71 45
      <tr class="akt">
72 46
        <td>místo</td>
73
        <td><input type="text" name="place"  size="50" maxlength="100"<?php znova($place)?>/></td>
47
        <td><input type="text" name="place"  size="50" maxlength="100"<?php znova(@$_REQUEST['place'])?>/></td>
74 48
      </tr>
75 49
      <tr class="akt">
76 50
        <td>publikace</td>
77
        <td><input type="text" name="publication"  size="50" maxlength="100"<?php znova($publication)?>/></td>
51
        <td><input type="text" name="publication"  size="50" maxlength="100"<?php znova(@$_REQUEST['publication'])?>/></td>
78 52
      </tr>
79 53
      <tr class="akt">
80 54
        <td>publikační číslo</td>
81
        <td><input type="text" name="publication_no"  size="50" maxlength="30"<?php znova($publication_no)?>/></td>
55
        <td><input type="text" name="publication_no"  size="50" maxlength="30"<?php znova(@$_REQUEST['publication_no'])?>/></td>
82 56
      </tr>
83 57
      <tr class="akt">
84 58
        <td>od strany*</td>
85
        <td><input type="text" name="from_page"  size="50" maxlength="100"<?php znova($from_page)?>/></td>
59
        <td><input type="text" name="from_page"  size="50" maxlength="100"<?php znova(@$_REQUEST['from_page'])?>/></td>
86 60
      </tr>
87 61
      <tr class="akt">
88 62
        <td>do strany*</td>
89
        <td><input type="text" name="to_page"  size="50" maxlength="100"<?php znova($to_page)?>/></td>
63
        <td><input type="text" name="to_page"  size="50" maxlength="100"<?php znova(@$_REQUEST['to_page'])?>/></td>
90 64
      </tr>
91 65
      <tr class="akt">
92 66
        <td>jazyk</td>
......
94 68
      </tr>
95 69
      <tr class="akt">
96 70
        <td>rok</td>
97
        <td><input type="text" name="year"  size="50" maxlength="4"<?php znova($year)?>/></td>
71
        <td><input type="text" name="year"  size="50" maxlength="4"<?php znova(@$_REQUEST['year'])?>/></td>
98 72
      </tr>
99 73
      <tr class="nadpis_sekce">
100 74
        <td>
101
          <input type="hidden" name="action" value="insert_new_source">
102 75
        </td>
103
        <td><input type="submit" value="Vlož"></td>
76
        <td><input type="submit" value="Vlož" name="submit_btn"></td>
104 77
      </tr>
105 78
    </form>
106 79
    </tbody>
107 80
  </table>
108
  
109
  <script language="javascript">
110
				<!--
111
					var focus = document.new_source_form.title;
112
  				focus.focus();
113
				-->
114
  </script>
81

  
115 82

  
old/html/multidic/app/webroot/administration/delete_author_of_source.php
4 4
  require_once("./classes/db.php");
5 5
  
6 6
  $spojeni = new DB_Sql();
7
  $dotaz = "DELETE FROM author_of_source WHERE \"IDsource\" = $source_id AND \"IDauthor\" = $author_id";
7
  $dotaz = "DELETE FROM author_of_source WHERE IDsource = $source_id AND IDauthor = $author_id";
8 8
  $spojeni->query($dotaz);
9 9
  if ($spojeni->connection->errno != 0) {
10 10
    print_hlasku("Autora se nepodařilo odebrat");
11 11
  }
12
  print_hlasku("Autor odebrán");
12
  else{
13
    print_hlasku("Autor odebrán");
14
  }
13 15
  echo_zpet_do_zdroju();
14 16
  
15 17
?>
old/html/multidic/app/webroot/administration/edit_source.php
3 3

  
4 4
$vypis_edit = true;
5 5

  
6
if (!Empty($action) && $action == "edit_source") {
6
if(isset($_REQUEST['submit_btn'])){
7 7
  
8
  if (Empty($title)) {
8
  if (Empty(@$_REQUEST['title'])) {
9 9
    print_hlasku("Název musíte vyplnit");
10 10
  }
11
  else if (Empty($from_page)) {
11
  else if (Empty(@$_REQUEST['from_page'])) {
12 12
    print_hlasku("Od stránky musíte vyplnit");
13 13
  }
14
  else if (Empty($to_page)) {
14
  else if (Empty(@$_REQUEST['to_page'])) {
15 15
    print_hlasku("Do stránky musíte vyplnit");
16 16
  }
17 17
  else {
18
    update_source($title, $subtitle, $place, $publication, $publication_no, 
19
                  $from_page, $to_page, $language, $year, $source_id);
18
    update_source(@$_REQUEST['title'], @$_REQUEST['subtitle'], @$_REQUEST['place'], @$_REQUEST['publication'], @$_REQUEST['publication_no'],
19
        @$_REQUEST['from_page'], @$_REQUEST['to_page'], @$_REQUEST['language'], @$_REQUEST['year'], @$_REQUEST['source_id']);
20 20
    //print_table_of_source();
21 21
    $vypis_edit = false;
22 22
  }
23 23
}
24
if($vypis_edit){
25
  
26
  $Record          = get_source($source_id);
27
  $title           = $Record[1];
28
  $subtitle        = $Record[2];
29
  $place           = $Record[3];
30
  $publication     = $Record[4];
31
  $publication_no  = $Record[5];
32
  $from_page       = $Record[6];
33
  $to_page         = $Record[7];
34
  $language        = $Record[8];
35
  $year            = $Record[9];
36

  
24
if($vypis_edit)
25
{
26
    $Record = get_source(@$_REQUEST['source_id']);
27
    $title = $Record[1];
28
    $subtitle = $Record[2];
29
    $place = $Record[3];
30
    $publication = $Record[4];
31
    $publication_no = $Record[5];
32
    $from_page = $Record[6];
33
    $to_page = $Record[7];
34
    $language = $Record[8];
35
    $year = $Record[9];
37 36

  
37
}
38 38
?>
39
<script language="JavaScript">
40
	function setFocus(object)
41
	{
42
	   	object.focus();
43
	   	object.select();
44
	}
45 39

  
46
  function validate_edit_source_form(form) {
47
    new_source_form = form;
48
    if (new_source_form.title.value == "") {
49
      alert("Položku musite vyplnit.");
50
      setFocus(new_source_form.title);
51
      return false;
52
    }
53
    if (new_source_form.from_page.value == "") {
54
      alert("Položku musite vyplnit.");
55
      setFocus(new_source_form.from_page);
56
      return false;
57
    }
58
    if (new_source_form.to_page.value == "") {
59
      alert("Položku musite vyplnit.");
60
      setFocus(new_source_form.to_page);
61
      return false;
62
    }
63
    return true;
64
  }
65
</script>
66 40
<table>
67 41
    <thead align="center"> <h3 class="nadpis2">Uprav zdroj</h3> </thead>
68 42
    <tbody>
69
    <form action="" method="POST" name="edit_source_form" onSubmit="return validate_edit_source_form(this)">
43
    <form action="" method="POST">
70 44
      <table border="0">
71 45
      <tr class="akt">
72 46
        <td>titul*</td>
......
106 80
      </tr>
107 81
      <tr class="nadpis_sekce">
108 82
        <td>
109
          <input type="hidden" name="action" value="edit_source">
110
          <input type="hidden" name="source_id" value="<?php echo $source_id?>">
83
          <input type="hidden" name="source_id" value="<?php echo @$_REQUEST['source_id']?>">
111 84
        </td>
112
        <td><input type="submit" value="Uprav"></td>
85
        <td><input type="submit" value="Uprav" name="submit_btn"></td>
113 86
      </tr>
114 87
    </form>
115 88
    </tbody>
116 89
  </table>
117
  
118
  <script language="javascript">
119
				<!--
120
					var focus = document.edit_source_form.title;
121
  				focus.focus();
122
				-->
123
  </script>
124
<?php
125
  }//end of else
126
?>
90

  
old/html/multidic/app/webroot/administration/edit_user.php
49 49
<table>
50 50
    <thead align="center"> <h3 class="nadpis2">Uprav uživatele</h3> </thead>
51 51
    <tbody>
52
    <form action="" method="POST" name="edit_user_form">
52
    <form action="" method="POST">
53 53
      <table border="0">
54 54
      <tr class="akt">
55 55
        <td>jméno*</td>
old/html/multidic/app/webroot/administration/list_source.php
2 2

  
3 3
require_once("./administration/source.php");
4 4

  
5
if (!Empty($action) && $action == "delete_source") {
5
if(isset($_REQUEST['delete-btn'])){
6 6
  $coun_true = 0;
7 7
  $coun_false = 0;
8
  if (Is_Array($smaz)) {
9
    for (Reset($smaz); Current($smaz); Next($smaz)) {
10
      if (delete_source(Key($smaz))) $coun_true++;
8
  if (Is_Array($_REQUEST['smaz'])) {
9
    for (Reset($_REQUEST['smaz']); Current($_REQUEST['smaz']); Next($_REQUEST['smaz'])) {
10
      if (delete_source(Key($_REQUEST['smaz']))) $coun_true++;
11 11
      else $coun_false++;
12 12
    }
13 13
  }
......
18 18
}
19 19

  
20 20

  
21
if (!Empty($serad)) {
22
  print_table_of_source($order, $od, $limit);
21
if (!Empty($_REQUEST['serad'])) {
22
  print_table_of_source(@$_REQUEST['order'], @$_REQUEST['od'], @$_REQUEST['limit']);
23 23
}
24 24
else {
25 25
  print_table_of_source();
old/html/multidic/app/webroot/administration/list_user.php
2 2

  
3 3
require_once("./administration/user.php");
4 4

  
5

  
6

  
7 5
if(isset($_REQUEST['delete-btn'])){
8 6

  
9

  
10 7
  $coun_true = 0;
11 8
  $coun_false = 0;
12 9
  if (Is_Array($_REQUEST['smaz'])) {
old/html/multidic/app/webroot/administration/source.php
27 27
function get_authors_of_source($IDsource) {
28 28
  require_once("./classes/db.php");
29 29
  $spojeni = new DB_Sql();
30
  $dotaz = "SELECT a.name, a.surname, a.\"IDauthor\"
30
  $dotaz = "SELECT a.name, a.surname, a.IDauthor
31 31
            FROM author_of_source f, author a 
32
            WHERE f.\"IDsource\" = '$IDsource'
33
              AND f.\"IDauthor\" = a.\"IDauthor\"";
32
            WHERE f.IDsource= $IDsource
33
              AND f.IDauthor = a.IDauthor";
34 34
  $spojeni->query($dotaz);
35 35
  $navrat = "";
36 36
  while ($spojeni->next_record()) {
......
44 44
function get_pocet_zdroju() {
45 45
  require_once("./classes/db.php");
46 46
  $spojeni = new DB_Sql();
47
  $dotaz = "SELECT \"IDsource\" FROM source ";
47
  $dotaz = "SELECT IDsource FROM source";
48 48
  $spojeni->query($dotaz);
49 49
  return $spojeni->num_rows();
50 50
}
......
118 118
}
119 119

  
120 120
function get_foot_of_table() {
121
  return '<tr class="nadpis_sekce"><td> <input type="submit" name="delete" value="Smaž"></td>
121
  return '<tr class="nadpis_sekce"><td> <input type="submit" name="delete-btn" value="Smaž"></td>
122 122
  <td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>';
123 123
}
124 124

  
125 125
function print_table_of_source($order = "IDsource", $od = 0, $limit = 30) {
126 126
  require_once("./classes/db.php");
127 127
  $spojeni = new DB_Sql();
128
  $dotaz = "SELECT * FROM source ORDER BY \"$order\" OFFSET $od LIMIT $limit";
128
  $dotaz = "SELECT * FROM source ORDER BY $order LIMIT $od, $limit";
129 129
  $radky = $spojeni->query($dotaz);
130 130
  $navrat = "<h3 class=\"nadpis2\">Výpis zdrojů</h3>";
131 131
  $navrat .= get_razeni($order, $od, $limit);
132 132
  $navrat .= "<table><form action=\"\" method=\"post\">";
133 133
  $navrat .= get_header_of_table();
134

  
134 135
  while ($spojeni->next_record()) {
135
    $navrat .= get_row_of_table($spojeni->Record, 1, 10);
136
    $navrat .= get_row_of_table($radky->fetch_array(), 1, 10);
136 137
  }
137 138
  $navrat .= get_foot_of_table();
138
  $navrat .= '<input type="hidden" name="action" value="delete_source">';
139
  $navrat .= '<input type="hidden" name="action" value="delete-btn">';
139 140
  $navrat .= "</form></table>";
140 141
  echo $navrat;
141

  
142
  
143 142
}
144 143

  
145 144

  
......
147 146
  require_once("./classes/db.php");
148 147
  $spojeni = new DB_Sql();
149 148
  
150
  $dotaz = "INSERT INTO source (\"title\", 
151
                                \"subtitle\", 
152
                                \"place\",
153
                                \"publication\",
154
                                \"publication_no\", 
155
                                \"from_page\",
156
                                \"to_page\",
157
                                \"language\",
158
                                \"year\") 
149
  $dotaz = "INSERT INTO source (title, 
150
                                subtitle, 
151
                                place,
152
                                publication,
153
                                publication_no, 
154
                                from_page,
155
                                to_page,
156
                                language,
157
                                year) 
159 158
                       VALUES ('$title',
160 159
                               '$subtitle',
161 160
                               '$place',
......
180 179

  
181 180
  require_once("./classes/db.php");
182 181
  $spojeni = new DB_Sql();
183
  $dotaz = "SELECT * FROM author_of_source WHERE \"IDsource\" = '$source_id'";
182
  $dotaz = "SELECT * FROM author_of_source WHERE IDsource = $source_id";
184 183
  $spojeni->query($dotaz);
185 184
  if ($spojeni->connection->errno != 0) {
186 185
    print_hlasku($spojeni->Error);
......
189 188
  if ($spojeni->num_rows() == 0)
190 189
    $jedna = true;
191 190
    
192
  $dotaz = "SELECT * FROM dict WHERE source = '$source_id'";
191
  $dotaz = "SELECT * FROM dict WHERE source = $source_id";
193 192
  $spojeni->query($dotaz);
194 193
  if ($spojeni->connection->errno != 0) {
195 194
    print_hlasku($spojeni->Error);
......
208 207
  }
209 208
  require_once("./classes/db.php");
210 209
  $spojeni = new DB_Sql();
211
  $dotaz = "DELETE FROM source WHERE \"IDsource\" = $ID";
210
  $dotaz = "DELETE FROM source WHERE IDsource = $ID";
212 211
  $spojeni->query($dotaz);
213 212
  if ($spojeni->connection->errno != 0) {
214 213
    return false;
215 214
  }
216
  $dotaz = "DELETE FROM author_of_source WHERE \"IDsource\" = $ID";
215
  $dotaz = "DELETE FROM author_of_source WHERE Dsource = $ID";
217 216
  $spojeni->query($dotaz);
218 217
  if ($spojeni->connection->errno != 0) {
219 218
    return false;
......
235 234
                            to_page = '$to_page',
236 235
                            language = '$language',
237 236
                            year = '$year'
238
                            WHERE \"IDsource\" = $source_id";
237
                            WHERE IDsource = $source_id";
239 238
  $spojeni->query($dotaz);
240 239
  if ($spojeni->connection->errno != 0) {
241 240
    print_hlasku("Zdroj se nepodařilo upravit.");
......
251 250
function get_source($source_id) {
252 251
  require_once("./classes/db.php");
253 252
  $spojeni = new DB_Sql();
254
  $dotaz = "SELECT * FROM source WHERE \"IDsource\" LIKE '$source_id'";
253
  $dotaz = "SELECT * FROM source WHERE IDsource LIKE $source_id";
255 254
  $radky = $spojeni->query($dotaz);
256

  
257
  $spojeni->next_record();
258
  
259
  return $spojeni->Record;
255
  return $spojeni->next_record();
260 256
}
261 257

  
262 258

  

Také k dispozici: Unified diff