[go: up one dir, main page]

Menu

[r19]: / admin / froogle.php  Maximize  Restore  History

Download this file

182 lines (151 with data), 5.5 kB

  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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
<?php
/*
$Id: froogle.php,v 1.1.1.1 2004/03/04 23:38:07 zip1 Exp $
http://www.oscommerce.com
Froogle Data Feeder!
Copyright (c) 2002 - 2005 Calvin K
Released under the GNU General Public License
*/
require('includes/application_top.php');
// Start TIMER
// -----------
$stimer = explode( ' ', microtime() );
$stimer = $stimer[1] + $stimer[0];
// -----------
$data_files_id1 = (int)$HTTP_POST_VARS['feed_froogle'];
//$data_files_id1 = '2';
$data_query_raw = tep_db_query("select * from " . TABLE_DATA_FILES . " where data_files_id = '" . $data_files_id1 . "' order by data_files_service ");
while ($data = tep_db_fetch_array($data_query_raw)) {
$data_files_id = $data[data_files_id];
$data_files_type = $data[data_files_type];
$data_files_disc = $data[data_files_disc];
$data_files_type1 = $data[data_files_type1];
$data_files_service = $data[data_files_service];
$data_status = $data[data_status];
$data_files_name = $data[data_files_name];
$data_image_url = $data[data_image_url];
$ftp_server = $data[data_ftp_server];
$ftp_user_name = $data[data_ftp_user_name];
$ftp_user_pass = $data[data_ftp_user_pass];
$ftp_directory = $data[data_ftp_directory];
$data_tax_class_id = $data[data_tax_class_id];
$data_convert_cur = $data[data_convert_cur];
$data_cur_use = $data[data_cur_use];
$data_cur = $data[data_cur];
$data_lang_use = $data[data_lang_use];
$data_lang = $data[data_lang];
}
$OutFile = $data_files_name;
$source_file = DIR_FS_ADMIN . "feeds/" . $data_files_name;
$destination_file= $data_files_name;
$already_sent = array();
// end configuration information
//Start FTP to Froogle
echo $source_file;
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->
<!-- body //-->
<table border="0" width="100%" cellspacing="2" cellpadding="2">
<tr>
<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
<!-- left_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
<!-- left_navigation_eof //-->
</table></td>
<!-- body_text //-->
<td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2" class="menuBoxHeading">
<tr>
<td><table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td class="pageHeading"><?php echo HEADING_TITLE ; ?></td>
</tr>
<tr>
<td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
</tr>
</table></td>
</tr>
<tr>
<td>
<?php
function ftp_file( $ftpservername, $ftpusername, $ftppassword, $ftpsourcefile, $ftpdestinationfile )
{
// set up basic connection
$conn_id = ftp_connect($ftpservername);
if ( $conn_id == false )
{
echo TEXT_INFO_FTP_ERROR1 . $ftpservername . "<br />\n" ;
return false;
}
// login with username and password
$login_result = ftp_login($conn_id, $ftpusername, $ftppassword);
// check connection
if ((!$conn_id) || (!$login_result)) {
echo TEXT_INFO_FTP_ERROR2 . "<br />\n";
echo TEXT_INFO_FTP_ERROR3 . $ftpservername . TEXT_INFO_FTP_ERROR4 . $ftpusername ."<br />\n";
return false;
} else {
echo TEXT_INFO_FTP_ERROR5 . $ftpservername . TEXT_INFO_FTP_ERROR4 . $ftpusername . "<br />\n";
}
if ( strlen( $ftpdirectory ) > 0 )
{
if (ftp_chdir($conn_id, $ftpdirectory )) {
echo TEXT_INFO_FTP_ERROR6 . ftp_pwd($conn_id) . "<br />\n";
} else {
echo TEXT_INFO_FTP_ERROR7 . $ftpservername . "<br />\n";
return false;
}
}
ftp_pasv ( $conn_id, true ) ;
// upload the file
$upload = ftp_put( $conn_id, $ftpdestinationfile, $ftpsourcefile, FTP_ASCII );
//echo $conn_id . $ftpdestinationfile . $ftpsourcefile ;
// check upload status
if (!$upload) {
echo $ftpservername . ' ' . $upload . TEXT_INFO_FTP_ERROR8 . "<br />\n";
return false;
} else {
echo sprintf(TEXT_INFO_FTP_ERROR9, $ftpsourcefile, $ftpservername, $ftpdestinationfile) . "<br />\n";
}
// close the FTP stream
ftp_close($conn_id);
return true;
}
ftp_file( $ftp_server, $ftp_user_name, $ftp_user_pass, $source_file, $destination_file);
//End FTP to Froogle
// End TIMER
// ---------
$etimer = explode( ' ', microtime() );
$etimer = $etimer[1] + $etimer[0];
echo '<tr><td> <p style="margin:auto; text-align:center">';
echo printf( TEXT_INFO_FTP_SCRITP_TIMER , ($etimer-$stimer) ) ;
echo tep_draw_form('data', FILENAME_FROOGLE_ADMIN, '', 'post', '');
echo '</p></td><td>';
// ---------
?>
<tr>
<td align="left" class="main"><br /><?php echo tep_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE); ?>
</form>
</td>
</tr>
</table></td>
<!-- body_text_eof //-->
</tr>
</table>
<!-- body_eof //-->
<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
<br />
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>