$value ): array_push($new_insert,$key); //フィールド名配列を作成 array_push($new_value,$value ); //値配列を作成 endforeach; $sql.=" ( " . implode(",",$new_insert) . " ) values"; $sql.=" ( " . implode(",",$new_value) . " )"; return $sql; } ### upate function updateSql( $table,$update,$where ){ if( $where != "" ): $sql="update {$table} set "; //tableをつける //フィールド名 foreach ( $update as $key => $value ): $sql .= $key."=".$value; endforeach; $sql .= " where ".$where; else: print $table."にupdateができませんでした。"; exit; endif; return $sql; } ### delete function deleteSql( $table,$where ){ if($where !="" ): $sql="delete from {$table}"; $sql .= " where ".$where; else: print $table."にdeleteができませんでした。"; endif; return $sql; } //************************************************** // function iemoji_encode ( $str, $opt = true ) //************************************************** // 機 能:i-mode基本絵文字を10進数SJIS表記に、 // 拡張絵文字を16進数Unicode表記に変換する。 // 引 数:$str = i-mode絵文字を含む文字列 // $opt = falseを指定すると絵文字を削除する。 // 戻り値:変換(削除)後の文字列 //************************************************** function iemoji_encode( $str, $opt = true ) { $str = unpack("C*", $str); $len = count($str); $buff = ""; $n = 1; while($n <= $len) { $ch1 = $str[$n]; $ch2 = $str[$n+1]; if((($ch1 == 0xF8) && (0x9F <= $ch2) && ($ch2 <= 0xFC)) || (($ch1 == 0xF9) && ((0x40 <= $ch2) && ($ch2 <= 0x49) || (0x50 <= $ch2) && ($ch2 <= 0x52) || (0x55 <= $ch2) && ($ch2 <= 0x57) || (0x5B <= $ch2) && ($ch2 <= 0x5E) || (0x72 <= $ch2) && ($ch2 <= 0x7E) || (0x80 <= $ch2) && ($ch2 <= 0xB0)))) { if($opt) $buff .= '&#'.strval(($ch1 << 8) + $ch2).';'; $n++; } elseif(($ch1 == 0xF9) && (0xB1 <= $ch2) && ($ch2 <= 0xFC)) { if($opt) $buff .= '&#x'.strtoupper(dechex(0xE700 + $ch2 - 165)).';'; $n++; } // 2バイト文字の処理 elseif(((0x81 <= $ch1) && ($ch1 <= 0x9f) ) || ((0xe0 <= $ch1) && ($ch1 <= 0xfc))){ $buff .= pack("C", $ch1) . pack("C", $ch2); $n++; } else $buff .= pack("C", $ch1); $n++; } return $buff; } //************************************************** // function iemoji_decode ( $str ) //************************************************** // 機 能:i-mode基本絵文字10進数SJIS表記と、拡張絵文字 // 16進数Unicode表記を、元の2バイトコードに変換する。 // 引 数:$str = HTML表記コード化されたi-mode絵文字を含む文字列 // 戻り値:変換(削除)後の文字列 //************************************************** function iemoji_decode( $str ) { $str = preg_split("/&#([x0-9A-F]{5});/", $str, -1, PREG_SPLIT_DELIM_CAPTURE); $line = count($str); $buff = ""; $n = 0; while($n < $line) { if($n % 2) { if(preg_match("/^[0-9]{5}$/", $str[$n])) { $temp = intval($str[$n]); if((0xF89F <= $temp) && ($temp <= 0xF8FC) || (0xF940 <= $temp) && ($temp <= 0xF949) || (0xF950 <= $temp) && ($temp <= 0xF952) || (0xF955 <= $temp) && ($temp <= 0xF957) || (0xF95B <= $temp) && ($temp <= 0xF95E) || (0xF972 <= $temp) && ($temp <= 0xF97E) || (0xF980 <= $temp) && ($temp <= 0xF9B0)) $buff .= pack("C*", $temp >> 8, $temp % 256); else $buff .= $str[$n]; } elseif(preg_match("/^xE7(0[\x43-\x46]|[1-4][0-9A-F]|5[0-7])$/", $str[$n], $temp)) $buff .= pack("C*", 0xF9, hexdec($temp[1]) + 165); else $buff .= $str[$n]; } else $buff .= $str[$n]; $n++; } return $buff; } ?>mysqlDBConnect(); } ### get all data by order function getData($type=""){ $sql = "select * from ".__DATABASE_TABLE_PREFIX."topics_tbl where t_delflag=0 order by t_date desc"; $res = $this->getQuery($sql); return $res; } ### get all data where active function getDataAlive($type=""){ if($type==""){ $sql = "select * from ".__DATABASE_TABLE_PREFIX."topics_tbl where t_display=1 and t_delflag=0 order by t_date desc"; }else{ $sql = "select * from ".__DATABASE_TABLE_PREFIX."topics_tbl where t_type='".$type."' and t_display=1 and t_delflag=0 order by t_date desc"; } $res = $this->getQuery($sql); return $res; } ### get data according to the area id function byTopicsId( $id ){ $sql = "select * from ".__DATABASE_TABLE_PREFIX."topics_tbl where t_id='".$id."' and t_delflag=0"; $res = $this->getQuery($sql); return $res; } } ### insert model class Topics_Insert extends mysqlDBConnect{ ### 潟潟鴻 function Topics_Insert(){ $this->mysqlDBConnect(); $date = sprintf("%04d-%02d-%02d", $_REQUEST['y'], $_REQUEST['m'], $_REQUEST['d']); $this->column = array( 't_date' => "'".$date."'" ,'t_title' => "'".$_REQUEST['title']."'" ,'t_text' => "'".$_REQUEST['text']."'" ,'t_pdf' => "'".$_REQUEST['pdf']."'" ,'t_link' => "'".$_REQUEST['link']."'" ,'t_type' => "'".$_REQUEST['type']."'" ,'t_display' => "'".$_REQUEST['display']."'" ,'t_regist' => "'".date('Y-m-d H:i:s')."'" ); ### 脂 if( $this->putQuery( insertSql( __DATABASE_TABLE_PREFIX."topics_tbl",$this->column ) ) ): endif; } } ### edit model class Topics_Edit extends mysqlDBConnect{ ### 潟潟鴻 function Topics_Edit(){ $this->mysqlDBConnect(); $date = sprintf("%04d-%02d-%02d", $_REQUEST['y'], $_REQUEST['m'], $_REQUEST['d']); $this->column = array( 't_date' => "'".$date."'" ,',t_title' => "'".$_REQUEST['title']."'" ,',t_text' => "'".$_REQUEST['text']."'" ,',t_pdf' => "'".$_REQUEST['pdf']."'" ,',t_link' => "'".$_REQUEST['link']."'" ,',t_type' => "'".$_REQUEST['type']."'" ,',t_display' => "'".$_REQUEST['display']."'" ); error_log(updateSql( __DATABASE_TABLE_PREFIX."topics_tbl",$this->column,"t_id='".$_REQUEST['id']."'" ) ); ### 贋 if( $this->putQuery( updateSql( __DATABASE_TABLE_PREFIX."topics_tbl",$this->column,"t_id='".$_REQUEST['id']."'" ) ) ): endif; } } ### delete record class Topics_Delete extends mysqlDBConnect{ ### 潟潟鴻 function Topics_Delete(){ $this->mysqlDBConnect(); ### if( $this->putQuery( deleteSql( __DATABASE_TABLE_PREFIX."topics_tbl","t_id='".$_REQUEST['id']."'" ) ) ): endif; } } ?>mysqlDBConnect(); } ### get all data by order function getData($parentId=""){ if($parentId==""){ $sql = "select * from ".__DATABASE_TABLE_PREFIX."category_tbl where c_parent_id=0 and c_delflag=0 order by c_order"; }else{ $sql = "select * from ".__DATABASE_TABLE_PREFIX."category_tbl where c_parent_id='".$parentId."' and c_delflag=0 order by c_order"; } $res = $this->getQuery($sql); return $res; } ### get Next Order number value of order column function getNextOrder(){ $sql = "select MAX(c_order) as max from ".__DATABASE_TABLE_PREFIX."category_tbl where c_delflag=0"; $res = $this->getQuery($sql); return $res[0]['max'] + 1; } ### get data according to the backnumber id function byCategoryId( $id ){ $sql = "select * from ".__DATABASE_TABLE_PREFIX."category_tbl where c_id='".$id."' and c_delflag=0"; $res = $this->getQuery($sql); return $res; } ### get data according to the backnumber id function getParentName( $id ){ $sql = "select * from ".__DATABASE_TABLE_PREFIX."category_tbl where c_id='".$id."' and c_delflag=0"; $res = $this->getQuery($sql); return $res[0]['c_title']; } } ### insert model class Category_Insert extends mysqlDBConnect{ ### 潟潟鴻 function Category_Insert(){ $this->mysqlDBConnect(); $this->column = array( 'c_title' => "'".$_REQUEST['title']."'" ,'c_order' => "'".$_REQUEST['order']."'" ,'c_regist' => "'".date('Y-m-d H:i:s')."'" ); ### 脂 if( $this->putQuery( insertSql( __DATABASE_TABLE_PREFIX."category_tbl",$this->column ) ) ): endif; } } ### edit model class Category_Edit extends mysqlDBConnect{ ### 潟潟鴻 function Category_Edit(){ $this->mysqlDBConnect(); $this->column = array( 'c_title' => "'".$_REQUEST['title']."'" ); error_log(updateSql( __DATABASE_TABLE_PREFIX."category_tbl",$this->column,"c_id='".$_REQUEST['id']."'" ) ); ### 贋 if( $this->putQuery( updateSql( __DATABASE_TABLE_PREFIX."category_tbl",$this->column,"c_id='".$_REQUEST['id']."'" ) ) ): endif; } } ### delete record class Category_Delete extends mysqlDBConnect{ ### 潟潟鴻 function Category_Delete(){ $this->mysqlDBConnect(); ### if( $this->putQuery( deleteSql( __DATABASE_TABLE_PREFIX."category_tbl","c_id='".$_REQUEST['id']."'" ) ) ): endif; } } ### sorting the data record class Category_Sort extends mysqlDBConnect{ ### 潟潟鴻 function Category_Sort(){ $this->mysqlDBConnect(); for( $i=0;$icolumn = array( 'c_order' => "'".$_REQUEST['c_order'][$i]."'" ); $where = "c_id='".$_REQUEST['sortid'][$i]."'"; // query $this->putQuery( updateSql( __DATABASE_TABLE_PREFIX."category_tbl",$this->column,$where ) ); } } } ?>mysqlDBConnect(); } ### get all data by order function getData($categoryId=""){ if($categoryId==""){ $sql = "select * from ".__DATABASE_TABLE_PREFIX."works_tbl where w_category_id=0 and w_delflag=0 order by w_date"; }else{ $sql = "select * from ".__DATABASE_TABLE_PREFIX."works_tbl where w_category_id='".$categoryId."' and w_delflag=0 order by w_date"; } $res = $this->getQuery($sql); return $res; } ### get Next Order number value of order column function getNextOrder(){ $sql = "select MAX(w_order) as max from ".__DATABASE_TABLE_PREFIX."works_tbl where w_delflag=0"; $res = $this->getQuery($sql); return $res[0]['max'] + 1; } ### get data according to the backnumber id function byWorksId( $id ){ $sql = "select * from ".__DATABASE_TABLE_PREFIX."works_tbl where w_id='".$id."' and w_delflag=0"; $res = $this->getQuery($sql); return $res; } } ### insert model class Works_Insert extends mysqlDBConnect{ ### 潟潟鴻 function Works_Insert(){ $this->mysqlDBConnect(); $date = sprintf("%02d-%02d-%02d", $_REQUEST['y'], $_REQUEST['m'], $_REQUEST['d']); $this->column = array( 'w_date' => "'".$date."'" ,'w_category_id' => "'".$_SESSION['c_category_id']."'" ,'w_name' => "'".$_REQUEST['name']."'" ,'w_address' => "'".$_REQUEST['address']."'" ,'w_work' => "'".$_REQUEST['work']."'" ,'w_order' => "'".$_REQUEST['order']."'" ,'w_regist' => "'".date('Y-m-d H:i:s')."'" ); ### 脂 if( $this->putQuery( insertSql( __DATABASE_TABLE_PREFIX."works_tbl",$this->column ) ) ): endif; } } ### edit model class Works_Edit extends mysqlDBConnect{ ### 潟潟鴻 function Works_Edit(){ $this->mysqlDBConnect(); $date = sprintf("%02d-%02d-%02d", $_REQUEST['y'], $_REQUEST['m'], $_REQUEST['d']); $this->column = array( 'w_date' => "'".$date."'" ,',w_name' => "'".$_REQUEST['name']."'" ,',w_address' => "'".$_REQUEST['address']."'" ,',w_work' => "'".$_REQUEST['work']."'" ); error_log(updateSql( __DATABASE_TABLE_PREFIX."works_tbl",$this->column,"w_id='".$_REQUEST['id']."'" ) ); ### 贋 if( $this->putQuery( updateSql( __DATABASE_TABLE_PREFIX."works_tbl",$this->column,"w_id='".$_REQUEST['id']."'" ) ) ): endif; } } ### delete record class Works_Delete extends mysqlDBConnect{ ### 潟潟鴻 function Works_Delete(){ $this->mysqlDBConnect(); ### if( $this->putQuery( deleteSql( __DATABASE_TABLE_PREFIX."works_tbl","w_id='".$_REQUEST['id']."'" ) ) ): endif; } } ### sorting the data record class Works_Sort extends mysqlDBConnect{ ### 潟潟鴻 function Works_Sort(){ $this->mysqlDBConnect(); for( $i=0;$icolumn = array( 'w_order' => "'".$_REQUEST['w_order'][$i]."'" ); $where = "w_id='".$_REQUEST['sortid'][$i]."'"; // query $this->putQuery( updateSql( __DATABASE_TABLE_PREFIX."works_tbl",$this->column,$where ) ); } } } ?>mysqlDBConnect(); } ### 鴻紊ч緇 function getUser($uId=""){ if($uId == ""){ $sql = "select * from ".__DATABASE_TABLE_PREFIX."user_tbl order by u_updated "; }else{ $sql = "select * from ".__DATABASE_TABLE_PREFIX."user_tbl where u_id=".$uId." limit 1"; } $res = $this->getQuery($sql); return $res; } ### 鴻紊ч緇 function verifyAuth($userName, $password){ $sql = "select * from ".__DATABASE_TABLE_PREFIX."user_tbl where u_login='".$userName."' and u_password='".$password."'and u_active=1 limit 1"; $res = $this->getQuery($sql); // Mysql_num_row is counting table row $count=count($res); //$countRev=count($resRev); $countRev=0; if($count==1 || $countRev==1){ //$_SESSION['empName']=$resEmp[0]['emp_name']; $_SESSION['adminid']=$res[0]['u_id']; //$_SESSION['empMail']=$resEmp[0]['emp_mail']; //$_SESSION['empName']='ゃ鴻≪<泣ゃ'; return true; }else{ return false; } } } ### edit model class User_Edit extends mysqlDBConnect{ ### 潟潟鴻 function User_Edit(){ $this->mysqlDBConnect(); $this->column = array( 'u_password' => "'".$_REQUEST['password']."'" ); error_log(updateSql( __DATABASE_TABLE_PREFIX."user_tbl",$this->column,"u_id='".$_SESSION['adminid']."'" ) ); ### 贋 if( $this->putQuery( updateSql( __DATABASE_TABLE_PREFIX."user_tbl",$this->column,"u_id='".$_SESSION['adminid']."'" ) ) ): endif; } } ?>
Fatal error: Class 'CategoryTbl' not found in /var/www/html/results/works.php on line 6