예제 #1
0
function lfGetCSVData()
{
    global $arrAUTHORITY;
    global $arrWORK;
    $oquery = new SC_Query();
    $cols = "authority,name,department,login_id,work";
    $oquery->setwhere("del_flg <> 1");
    $oquery->andwhere("member_id <> " . ADMIN_ID);
    $oquery->setoption("ORDER BY rank DESC");
    $list_data = $oquery->select($cols, "dtb_member");
    $max = count($list_data);
    for ($i = 0; $i < $max; $i++) {
        $line = "";
        $line .= "\"" . $arrAUTHORITY[$list_data[$i]['authority']] . "\",";
        $tmp = ereg_replace("\"", "\"\"", $list_data[$i]['name']);
        $line .= "\"" . $tmp . "\",";
        $tmp = ereg_replace("\"", "\"\"", $list_data[$i]['department']);
        $line .= "\"" . $tmp . "\",";
        $tmp = ereg_replace("\"", "\"\"", $list_data[$i]['login_id']);
        $line .= "\"" . $tmp . "\",";
        $line .= "\"" . $arrWORK[$list_data[$i]['work']] . "\"\n";
        $data .= $line;
    }
    $header = "\"権限\",\"名前\",\"所属\",\"ログインID\",\"稼働状況\"\n";
    return $header . $data;
}
예제 #2
0
 /**
  * SELECTボックス用リストを作成する.
  *
  * @param string $table テーブル名
  * @param string $keyname プライマリーキーのカラム名
  * @param string $valname データ内容のカラム名
  * @return array SELECT ボックス用リストの配列
  */
 function sfGetIDValueList($table, $keyname, $valname)
 {
     $objQuery = new SC_Query();
     $col = "{$keyname}, {$valname}";
     $objQuery->setwhere("del_flg = 0");
     $objQuery->setorder("rank DESC");
     $arrList = $objQuery->select($col, $table);
     $count = count($arrList);
     for ($cnt = 0; $cnt < $count; $cnt++) {
         $key = $arrList[$cnt][$keyname];
         $val = $arrList[$cnt][$valname];
         $arrRet[$key] = $val;
     }
     return $arrRet;
 }