3 nce (ntch cloud environment.)
4 name: nc_update_readcnt_db.php
5 author: Akira Ohta (akohta001.gmail.com)
10 include_once "account.php";
11 include_once "preference.php";
12 include_once "database.php";
13 include_once "log.php";
14 include_once "http_util.php";
15 include_once "error_code.php";
17 $user_id = $_POST['user'];
18 $hashed_passwd = $_POST['hashed_passwd'];
19 $board_name = $_POST['board_name'];
20 $type1 = $_POST['type1'];
21 $type2 = $_POST['type2'];
23 //--- authorization ---
24 $user = chk_passwd( $user_id, $hashed_passwd);
30 //--- parameter check start ---
31 if(!chk_param($board_name) || !chk_param($type1)){
35 if(!is_numeric($type1)){
39 if($type1!=2 && $type1!=3 && $type1!=5 && $type1!=6){
43 //--- parameter check end ---
45 $table_name = TABLE_PREFIX."tbl{$user->home_dir}";
47 select res_number, record_type, dat_name from $table_name
48 where board_name='{$board_name}' and ( record_type = '{$type1}'
51 if(chk_param($type2)){
52 if(!is_numeric($type2) ||
53 ($type2!=2 && $type2!=3 && $type2!=5 && $type2!=6) ||
58 $query = $query." or record_type = '{$type2}')";
65 $result = $db->execute($query);
73 $error = __FILE__."(".__LINE__.
74 ") An error occured during query.";
75 nc_logging($error, $e);
81 for($i = 0; $i < $result->num_rows; $i++){
82 $row = $result->fetch_assoc();
83 echo $row['dat_name'].",".$row['record_type'].",".$row['res_number']."\n";