forked from mtawaf/PMB
-
Notifications
You must be signed in to change notification settings - Fork 0
/
export.php
57 lines (50 loc) · 2.45 KB
/
export.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<?php
// +-------------------------------------------------+
// © 2002-2004 PMB Services / www.sigb.net pmb@sigb.net et contributeurs (voir www.sigb.net)
// +-------------------------------------------------+
// $Id: export.php,v 1.4 2013-04-08 14:56:07 mbertin Exp $
// définition du minimum nécéssaire
$base_path=".";
$base_auth = "ADMINISTRATION_AUTH|CATALOGAGE_AUTH";
$base_title = "";
$base_noheader=1;
$base_nosession=1;
require_once ("$base_path/includes/init.inc.php");
switch($quoi) {
// Export de procédures
case "procs":
switch($sub) {
case "caddie" :
header("Content-Type: application/download\n");
header("Content-Disposition: atachement; filename=\"caddie_proc_".$id.".sql\"");
$req="select type, name, requete, comment, autorisations, parameters from caddie_procs where idproc='$id' ";
$res = mysql_query($req,$dbh);
if ($p=mysql_fetch_object($res)) {
$exp="INSERT INTO caddie_procs set type='".addslashes($p->type)."', name='".addslashes($p->name)."', requete='".addslashes($p->requete)."', comment='".addslashes($p->comment)."', autorisations='1', parameters='".addslashes($p->parameters)."' ";
echo $exp ;
}
break;
case "empr_caddie" :
header("Content-Type: application/download\n");
header("Content-Disposition: atachement; filename=\"empr_caddie_proc_".$id.".sql\"");
$req="select type, name, requete, comment, autorisations, parameters from empr_caddie_procs where idproc='$id' ";
$res = mysql_query($req,$dbh);
if ($p=mysql_fetch_object($res)) {
$exp="INSERT INTO empr_caddie_procs set type='".addslashes($p->type)."', name='".addslashes($p->name)."', requete='".addslashes($p->requete)."', comment='".addslashes($p->comment)."', autorisations='1', parameters='".addslashes($p->parameters)."' ";
echo $exp ;
}
break;
case "actionsperso" :
header("Content-Type: application/download\n");
header("Content-Disposition: atachement; filename=\"admin_proc_".$id.".sql\"");
$req="select name, requete, comment, autorisations, parameters from procs where idproc='$id' ";
$res = mysql_query($req,$dbh);
if ($p=mysql_fetch_object($res)) {
$exp="INSERT INTO procs set name='".addslashes($p->name)."', requete='".addslashes($p->requete)."', comment='".addslashes($p->comment)."', autorisations='1', parameters='".addslashes($p->parameters)."' ";
echo $exp ;
}
break;
}
break;
}
mysql_close($dbh);