-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.php
148 lines (117 loc) · 4.08 KB
/
main.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
<?php
//************************************************************************
// Главный скрипт запуска всех скриптов
//************************************************************************
//require_once dirname(__FILE__) . '/lib/sql.php';
require_once dirname(__FILE__) . '/lib/curl_query.php';
require_once dirname(__FILE__) . '/lib/simple_html_dom.php';
//require_once dirname(__FILE__) . '/Get_Catalog.php';
require_once dirname(__FILE__) . '/Get_tovar.php';
require_once dirname(__FILE__) . '/export_catalog_to_xls.php';
require_once dirname(__FILE__) . '/export_tovar_to_xls.php';
echo "<style>form{margin:0}td{border-bottom: 1px solid grey;}</style>";
echo "<h2>Main Script</h2>";
echo '<table>';
echo '<tr><td style="border-style:hidden;width:200px">';
echo '<form method = "post">';
echo '<input type = "submit" name = "button4" value = "Load Catalog">';
echo '</td>';
echo '<td width="300px">';
echo '<div id="proc4">:</div>';
echo '</td></tr></table>';
echo '<br>';
echo '<br>';
echo '<table>';
echo '<tr><td style="border-style:hidden;width:200px">';
echo '<form method = "post">';
echo '<input type = "submit" name = "button5" value = "Load Tovar">';
echo '</td>';
echo '<td width="300px">';
echo '<div id="proc5">:</div>';
echo '</td></tr></table>';
echo '<br>';
echo '<br>*************************************************************************************************************************************';
echo '<br>';
echo '<br>';
echo '<br>';
echo '<br>';
echo '<table>';
echo '<tr><td style="border-style:hidden;width:200px">';
echo '<form method = "post">';
echo '<input type = "submit" name = "button3" value = "Compare Tovar">';
echo '</td>';
echo '<td width="300px">';
echo '<div id="proc3">:</div>';
echo '</td></tr></table>';
echo '<br>';
echo '<br>';
echo '<br>*************************************************************************************************************************************';
echo '<br>';
echo '<br>';
echo '<table>';
echo '<tr><td style="border-style:hidden;width:200px">';
echo '<form method = "post">';
echo '<input type = "submit" name = "button1" value = "Export Catalog to Excel">';
echo '</td>';
echo '<td width="300px">';
echo '<div id="proc1">:</div>';
echo '</td></tr></table>';
echo '<br>';
echo '<br>';
echo '<table>';
echo '<tr><td style="border-style:hidden;width:200px">';
echo '<form method = "post">';
echo '<input type = "submit" name = "button2" value = "Export Tovar to Excel">';
echo '</td>';
echo '<td width="300px">';
echo '<div id="proc2">:</div>';
echo '</td></tr></table>';
echo '<br>';
echo '<br>';
echo '<br>*************************************************************************************************************************************';
echo '<br>Log area:';
echo '<br>*************************************************************************************************************************************';
echo '<br>';
echo '<br>';
if ( isset ( $_POST['button1'] )) { //Export Catalog to Excel
ob_start();
echo '<script>
document.all.proc1.innerHTML = "'. catalog_to_xlsx () .' ";
</script>';
ob_flush();
flush();
}
if ( isset ( $_POST['button2'] )) { //Export Tovar to Excel
ob_start();
echo '<script>
document.all.proc2.innerHTML = "'. tovar_to_xlsx () .' ";
</script>';
ob_flush();
flush();
}
if ( isset ( $_POST['button3'] )) { //Compare Tovar
ob_start();
echo '<script>
document.all.proc3.innerHTML = "'. start_compare_tovar() .' ";
</script>';
ob_flush();
flush();
}
if ( isset ( $_POST['button4'] )) { //Load Catalog
ob_start();
echo '<script>
document.all.proc4.innerHTML = "'. start_get_catalog() .' ";
</script>';
ob_flush();
flush();
}
if ( isset ( $_POST['button5'] )) { //Load Tovar
ob_start();
echo "Start Load Tovar:";
echo '<script>
document.all.proc5.innerHTML = "'. start_get_tovar() .' ";
</script>';
ob_flush();
flush();
}
?>