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 $dat_name = $_POST['dat_name'];
21 $type1 = $_POST['type1'];
22 $type2 = $_POST['type2'];
24 //--- authorization ---
25 $user = chk_passwd( $user_id, $hashed_passwd);
31 //--- parameter check start ---
32 if(!chk_param($board_name) || !chk_param($dat_name) ||
37 if(!is_numeric($type1)){
41 if($type1!=2 && $type1!=3 && $type1!=5 && $type1!=6){
45 //--- parameter check end ---
47 $table_name = TABLE_PREFIX."tbl{$user->home_dir}";
49 select res_number, record_type from $table_name
50 where board_name='{$board_name}' and dat_name='{$dat_name}'
51 and ( record_type = '{$type1}'
54 if(chk_param($type2)){
55 if(!is_numeric($type2) ||
56 ($type2!=2 && $type2!=3 && $type2!=5 && $type2!=6) ||
61 $query = $query." or record_type = '{$type2}')";
68 $result = $db->execute($query);
76 $error = __FILE__."(".__LINE__.
77 ") An error occured during query.";
78 nc_logging($error, $e);
84 for($i = 0; $i < $result->num_rows; $i++){
85 $row = $result->fetch_assoc();
86 echo $row['record_type']."=".$row['res_number']."\n";