/**
  * 指定パス配下のディレクトリ取得する.
  *
  * @param string $dir 取得するディレクトリパス
  * @return void
  */
 function sfGetFileList($dir)
 {
     $arrFileList = array();
     $arrDirList = array();
     if (is_dir($dir)) {
         $dh = opendir($dir);
         if ($dh) {
             $cnt = 0;
             $arrDir = array();
             // 行末の/を取り除く
             while (($file = readdir($dh)) !== false) {
                 $arrDir[] = $file;
             }
             $dir = rtrim($dir, '/');
             // アルファベットと数字でソート
             natcasesort($arrDir);
             foreach ($arrDir as $file) {
                 // ./ と ../を除くファイルのみを取得
                 if ($file != '.' && $file != '..') {
                     $path = $dir . '/' . $file;
                     // SELECT内の見た目を整えるため指定文字数で切る
                     $file_size = SC_Utils_Ex::sfCutString(SC_Helper_FileManager::sfGetDirSize($path), FILE_NAME_LEN);
                     $file_time = date('Y/m/d', filemtime($path));
                     // ディレクトリとファイルで格納配列を変える
                     if (is_dir($path)) {
                         $arrDirList[$cnt]['file_name'] = $file;
                         $arrDirList[$cnt]['file_path'] = $path;
                         $arrDirList[$cnt]['file_size'] = $file_size;
                         $arrDirList[$cnt]['file_time'] = $file_time;
                         $arrDirList[$cnt]['is_dir'] = true;
                     } else {
                         $arrFileList[$cnt]['file_name'] = $file;
                         $arrFileList[$cnt]['file_path'] = $path;
                         $arrFileList[$cnt]['file_size'] = $file_size;
                         $arrFileList[$cnt]['file_time'] = $file_time;
                         $arrFileList[$cnt]['is_dir'] = false;
                     }
                     $cnt++;
                 }
             }
             closedir($dh);
         }
     }
     // フォルダを先頭にしてマージ
     return array_merge($arrDirList, $arrFileList);
 }
 /**
  * 指定パス配下のディレクトリ取得する.
  *
  * @param string $dir 取得するディレクトリパス
  * @return void
  */
 function sfGetFileList($dir)
 {
     $arrFileList = array();
     $arrDirList = array();
     if (is_dir($dir)) {
         if ($dh = opendir($dir)) {
             $cnt = 0;
             // 行末の/を取り除く
             while (($file = readdir($dh)) !== false) {
                 $arrDir[] = $file;
             }
             $dir = ereg_replace("/\$", "", $dir);
             // アルファベットと数字でソート
             natcasesort($arrDir);
             foreach ($arrDir as $file) {
                 // ./ と ../を除くファイルのみを取得
                 if ($file != "." && $file != "..") {
                     $path = $dir . "/" . $file;
                     // SELECT内の見た目を整えるため指定文字数で切る
                     $file_name = SC_Utils_Ex::sfCutString($file, FILE_NAME_LEN);
                     $file_size = SC_Utils_Ex::sfCutString($this->sfGetDirSize($path), FILE_NAME_LEN);
                     $file_time = date("Y/m/d", filemtime($path));
                     // ディレクトリとファイルで格納配列を変える
                     if (is_dir($path)) {
                         $arrDirList[$cnt]['file_name'] = $file;
                         $arrDirList[$cnt]['file_path'] = $path;
                         $arrDirList[$cnt]['file_size'] = $file_size;
                         $arrDirList[$cnt]['file_time'] = $file_time;
                         $arrDirList[$cnt]['is_dir'] = true;
                     } else {
                         $arrFileList[$cnt]['file_name'] = $file;
                         $arrFileList[$cnt]['file_path'] = $path;
                         $arrFileList[$cnt]['file_size'] = $file_size;
                         $arrFileList[$cnt]['file_time'] = $file_time;
                         $arrFileList[$cnt]['is_dir'] = false;
                     }
                     $cnt++;
                 }
             }
             closedir($dh);
         }
     }
     // フォルダを先頭にしてマージ
     return array_merge($arrDirList, $arrFileList);
 }
 /**
  * Page のプロセス.
  *
  * @return void
  */
 function process()
 {
     $arrSearch = array();
     // 検索項目表示用
     $objDb = new SC_Helper_DB_Ex();
     // 選択中のカテゴリIDを判定する
     $this->category_id = $objDb->sfGetCategoryId($_GET['product_id'], $_GET['category_id']);
     // カテゴリ検索用選択リスト
     $arrRet = $objDb->sfGetCategoryList('', true, ' ');
     if (is_array($arrRet)) {
         // 文字サイズを制限する
         foreach ($arrRet as $key => $val) {
             $arrRet[$key] = SC_Utils_Ex::sfCutString($val, SEARCH_CATEGORY_LEN, false);
         }
     }
     $this->arrCatList = $arrRet;
     $objSubView = new SC_SiteView();
     $objSubView->assignobj($this);
     $objSubView->display($this->tpl_mainpage);
 }
Esempio n. 4
0
 function sfArrKeyValues($arrList, $keyname, $valname, $len_max = '', $keysize = '', $connect = '')
 {
     $max = count($arrList);
     if ($len_max != '' && $max > $len_max) {
         $max = $len_max;
     }
     $keyValues = array();
     for ($cnt = 0; $cnt < $max; $cnt++) {
         if ($keysize != '') {
             $key = SC_Utils_Ex::sfCutString($arrList[$cnt][$keyname], $keysize);
         } else {
             $key = $arrList[$cnt][$keyname];
         }
         $val = $arrList[$cnt][$valname];
         if ($connect != '') {
             $keyValues[$key] .= "{$val}" . $connect;
         } else {
             $keyValues[$key][] = $val;
         }
     }
     return $keyValues;
 }
                <?php 
            }
            ?>
                <?php 
            echo is_array($_tmp = is_array($_tmp = is_array($_tmp = $this->_tpl_vars['disp_name']) ? $this->_run_mod_handler('script_escape', true, $_tmp) : smarty_modifier_script_escape($_tmp)) ? $this->_run_mod_handler('sfCutString', true, $_tmp, 10, false) : SC_Utils_Ex::sfCutString($_tmp, 10, false)) ? $this->_run_mod_handler('h', true, $_tmp) : smarty_modifier_h($_tmp);
            ?>
</a><br />
            <?php 
        } else {
            ?>
                <img src="<?php 
            echo is_array($_tmp = $this->_tpl_vars['TPL_URLPATH']) ? $this->_run_mod_handler('script_escape', true, $_tmp) : smarty_modifier_script_escape($_tmp);
            ?>
img/contents/folder_close.gif" alt="Folder">
                <?php 
            echo is_array($_tmp = is_array($_tmp = is_array($_tmp = $this->_tpl_vars['disp_name']) ? $this->_run_mod_handler('script_escape', true, $_tmp) : smarty_modifier_script_escape($_tmp)) ? $this->_run_mod_handler('sfCutString', true, $_tmp, 10, false) : SC_Utils_Ex::sfCutString($_tmp, 10, false)) ? $this->_run_mod_handler('h', true, $_tmp) : smarty_modifier_h($_tmp);
            ?>
</a><br />
            <?php 
        }
        ?>

            <?php 
        if ((is_array($_tmp = $this->_tpl_vars['arrTree'][$this->_sections['cnt']['index']]['display']) ? $this->_run_mod_handler('script_escape', true, $_tmp) : smarty_modifier_script_escape($_tmp)) == true) {
            ?>
                <div id="f<?php 
            echo is_array($_tmp = $this->_tpl_vars['arrTree'][$this->_sections['cnt']['index']]['category_id']) ? $this->_run_mod_handler('script_escape', true, $_tmp) : smarty_modifier_script_escape($_tmp);
            ?>
">
            <?php 
        } else {
 /**
  * メーカー検索用選択リストを取得する
  *
  * @return array $arrMakerList メーカー検索用選択リスト
  */
 function lfGetMakerList()
 {
     $objDb = new SC_Helper_DB_Ex();
     // メーカー検索用選択リスト
     $arrMakerList = $objDb->sfGetMakerList('', true);
     if (is_array($arrMakerList)) {
         // 文字サイズを制限する
         foreach ($arrMakerList as $key => $val) {
             $arrMakerList[$key] = SC_Utils_Ex::sfCutString($val, SEARCH_CATEGORY_LEN, false);
         }
     }
     return $arrMakerList;
 }
Esempio n. 7
0
 function lfGetDataColPDF($arrData, $arrDataCol, $len)
 {
     $max = count($arrData);
     $csv_data = "";
     for ($i = 0; $i < $max; $i++) {
         foreach ($arrDataCol as $val) {
             $arrRet[$i][$val] = SC_Utils_Ex::sfCutString($arrData[$i][$val], $len);
         }
         $csv_data .= SC_Utils_Ex::sfGetPDFList($arrRet[$i]);
     }
     return $csv_data;
 }
            $this->_sections['cnt']['index_prev'] = $this->_sections['cnt']['index'] - $this->_sections['cnt']['step'];
            $this->_sections['cnt']['index_next'] = $this->_sections['cnt']['index'] + $this->_sections['cnt']['step'];
            $this->_sections['cnt']['first'] = $this->_sections['cnt']['iteration'] == 1;
            $this->_sections['cnt']['last'] = $this->_sections['cnt']['iteration'] == $this->_sections['cnt']['total'];
            ?>
                <tr>
                    <td ><?php 
            echo is_array($_tmp = $this->_tpl_vars['arrBkupList'][$this->_sections['cnt']['index']]['bkup_name']) ? $this->_run_mod_handler('script_escape', true, $_tmp) : smarty_modifier_script_escape($_tmp);
            ?>
</td>
                    <td ><?php 
            echo is_array($_tmp = $this->_tpl_vars['arrBkupList'][$this->_sections['cnt']['index']]['bkup_memo']) ? $this->_run_mod_handler('script_escape', true, $_tmp) : smarty_modifier_script_escape($_tmp);
            ?>
</td>
                    <td align="center"><?php 
            echo is_array($_tmp = is_array($_tmp = $this->_tpl_vars['arrBkupList'][$this->_sections['cnt']['index']]['create_date']) ? $this->_run_mod_handler('script_escape', true, $_tmp) : smarty_modifier_script_escape($_tmp)) ? $this->_run_mod_handler('sfCutString', true, $_tmp, 19, true, false) : SC_Utils_Ex::sfCutString($_tmp, 19, true, false);
            ?>
</td>
                    <td align="center"><a href="javascript:;" onclick="fnRestore('<?php 
            echo is_array($_tmp = $this->_tpl_vars['arrBkupList'][$this->_sections['cnt']['index']]['bkup_name']) ? $this->_run_mod_handler('script_escape', true, $_tmp) : smarty_modifier_script_escape($_tmp);
            ?>
'); return false;"><?php 
            echo smarty_function_t(array('string' => 'tpl_Restore_01'), $this);
            ?>
</a></td>
                    <td align="center"><a href="javascript:;" onclick="fnModeSubmit('download','list_name','<?php 
            echo is_array($_tmp = $this->_tpl_vars['arrBkupList'][$this->_sections['cnt']['index']]['bkup_name']) ? $this->_run_mod_handler('script_escape', true, $_tmp) : smarty_modifier_script_escape($_tmp);
            ?>
'); return false;"><?php 
            echo smarty_function_t(array('string' => 'tpl_Download_01'), $this);
            ?>