Convert Excel column name correctly
[phpmyadmin/arisferyanto.git] / libraries / transformations / application_octetstream__download.inc.php
blob20256323443c06bb78d377b7f54acef723551555
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * @package phpMyAdmin-Transformation
5 * @version $Id$
6 */
8 /**
11 function PMA_transformation_application_octetstream__download(&$buffer, $options = array(), $meta = '') {
12 global $row, $fields_meta;
14 if (isset($options[0]) && !empty($options[0])) {
15 $cn = $options[0]; // filename
16 } else {
17 if (isset($options[1]) && !empty($options[1])) {
18 foreach($fields_meta as $key => $val) {
19 if ($val->name == $options[1]) {
20 $pos = $key;
21 break;
24 if (isset($pos)) {
25 $cn = $row[$pos];
28 if (empty($cn)) {
29 $cn = 'binary_file.dat';
33 return
34 sprintf(
35 '<a href="transformation_wrapper.php%s&amp;ct=application/octet-stream&amp;cn=%s" title="%s">%s</a>',
37 $options['wrapper_link'],
38 urlencode($cn),
39 htmlspecialchars($cn),
40 htmlspecialchars($cn)