本文整理汇总了PHP中Util::lengthCheck方法的典型用法代码示例。如果您正苦于以下问题:PHP Util::lengthCheck方法的具体用法?PHP Util::lengthCheck怎么用?PHP Util::lengthCheck使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Util
的用法示例。
在下文中一共展示了Util::lengthCheck方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: requestLogin
/**
* 로그인
* @return Object
* @throws Exception
*/
public function requestLogin()
{
//------------------------------------
// param valid check
//-------------------------------------
$loginId = $this->param['login_id'];
$loginPw = $this->param['login_pw'];
//길이 체크
if (!Util::lengthCheck($loginId, 6, 20)) {
throw new Exception('Invalid userId(length)');
}
if (!Util::lengthCheck($loginPw, 6, 20)) {
throw new Exception('Invalid password(length)');
}
//영문,숫자만 허용
if (!Util::isAlNum($loginId)) {
throw new Exception('Invalid userId(special character)');
}
//------------------------------------
// db work
//-------------------------------------
//다른 값들은 특정문자만 허용하도록 이미 체크했으므로
//비밀번호만 금칙문자 처리를 하면 된다.
$this->escapeString($loginPw);
$sql = "select uid from user_info where user_id = '{$loginId}' and user_pwd = sha1('{$loginPw}') AND auth_id = '9001';";
$this->querySql($sql);
if ($this->getNumRows() == 0) {
return null;
} else {
//uid 값이 들어있다. $reqInfo 값이 1 정보까지 포함. 0 이면 uid 만
$row = $this->fetchArrayRow();
$_SESSION['admin'] = $row[0];
return $row;
}
}
示例2: requestRegModify
public function requestRegModify()
{
//------------------------------------
// param valid check
//-------------------------------------
$uid = (int) $_SESSION[DBWork::sessionKey];
$co_id = (int) $_SESSION[DBWork::accountKey];
$item_cd = (int) $this->param['item_cd'];
$itemgrp_cd = (int) $this->param['itemgrp_cd'];
$item_nm = $this->param['item_nm'];
$item_qty = $this->param['item_qty'];
$item_danwi = $this->param['item_danwi'];
$item_in_danga = (int) $this->param['item_in_danga'];
$item_out_danga = (int) $this->param['item_out_danga'];
if (!$item_nm || !Util::lengthCheck($item_nm, 1, 45)) {
throw new Exception('Data length');
}
//------------------------------------
// db work
//------------------------------------
//itemgrp 와 외래키 설정
$sql = "INSERT INTO item (`co_id`, `item_cd`, `itemgrp_cd`, `item_nm`, `item_qty`, `item_danwi`, `item_in_danga`, \r\n\t\t\t\t\t\t\t\t\t`item_out_danga`, `reg_date`, `reg_uid`)\r\n\t\t\t\t\t\t\t\tVALUES \r\n\t\t\t\t\t\t\t\t({$co_id}, {$item_cd}, {$itemgrp_cd}, '{$item_nm}', '{$item_qty}', '{$item_danwi}',\r\n\t\t\t\t\t\t\t\t\t{$item_in_danga}, {$item_out_danga}, now(), {$uid})\r\n\t\t\t\t\t\t\t\tON DUPLICATE KEY UPDATE \r\n\t\t\t\t\t\t\t\t`item_cd` = {$item_cd}, `itemgrp_cd` = {$itemgrp_cd}, `item_nm` = '{$item_nm}',\r\n\t\t\t\t\t\t\t\t`item_qty` = '{$item_qty}', `item_danwi` = '{$item_danwi}', `item_in_danga` = {$item_in_danga}, \r\n\t\t\t\t\t\t\t\t`item_out_danga` = {$item_out_danga}, `reg_date` = now(), `reg_uid` = {$uid};";
$this->updateSql($sql);
return 1;
}
示例3: requestRegModify
public function requestRegModify()
{
//------------------------------------
// param valid check
//-------------------------------------
$uid = (int) $_SESSION[DBWork::sessionKey];
$co_id = (int) $_SESSION[DBWork::companyKey];
$customer_id = (int) $this->param['customer_id'];
$tr_nm = $this->param['tr_nm'];
$tr_daepyo = $this->param['tr_daepyo'];
$tr_saup_no = $this->param['tr_saup_no'];
$tr_jumin_no = $this->param['tr_jumin_no'];
$tr_up = $this->param['tr_up'];
$tr_jong = $this->param['tr_jong'];
$tr_zip = $this->param['tr_zip'];
$tr_addr = $this->param['tr_addr'];
$tr_tel = $this->param['tr_tel'];
$tr_phone = $this->param['tr_phone'];
$tr_fax = $this->param['tr_fax'];
$tr_email = $this->param['tr_email'];
$tr_bigo = $this->param['tr_bigo'];
$tr_bigo = $this->param['tr_bigo'];
//필수 항목 체크
if (!$tr_nm || $tr_nm == '') {
throw new Exception('tr_nm Not Value');
}
//길이 체크
if ($tr_nm && !Util::lengthCheck($tr_nm, 2, 120)) {
throw new Exception('tr_nm Invaild length');
}
//2015-11-13 필수 미필수 정의후 재정리
// if($tr_daepyo && !Util::lengthCheck($tr_daepyo, 2, 20)) throw new Exception('tr_daepyo Invaild length');
// if($tr_saup_no && !Util::lengthCheck($tr_saup_no, 2, 12)) throw new Exception('tr_saup_no Invaild length');
// if($tr_jumin_no && !Util::lengthCheck($tr_jumin_no, 2, 14)) throw new Exception('tr_jumin_no Invaild length');
// if($tr_up && !Util::lengthCheck($tr_up, 2, 45)) throw new Exception('tr_up Invaild length');
// if($tr_jong && !Util::lengthCheck($tr_jong, 2, 45)) throw new Exception('tr_jong Invaild length');
// if($tr_zip && !Util::lengthCheck($tr_zip, 2, 7)) throw new Exception('tr_zip Invaild length');
// if($tr_addr && !Util::lengthCheck($tr_addr, 2, 90)) throw new Exception('tr_addr Invaild length');
// if($tr_tel && !Util::lengthCheck($tr_tel, 2, 20)) throw new Exception('tr_tel Invaild length');
// if($tr_phone && !Util::lengthCheck($tr_phone, 2, 20)) throw new Exception('tr_phone Invaild length');
// if($tr_fax && !Util::lengthCheck($tr_fax, 2, 20)) throw new Exception('tr_fax Invaild length');
// if($tr_email && !Util::lengthCheck($tr_email, 2, 40)) throw new Exception('tr_email Invaild length');
// if($tr_bigo && !Util::lengthCheck($tr_bigo, 2, 45)) throw new Exception('tr_bigo Invaild length');
//특수 문자 제외
$this->escapeString($tr_nm);
//------------------------------------
// db work
//-------------------------------------
$sql = "INSERT INTO `customer` (`customer_id`, `co_id`, `tr_nm`, `tr_daepyo`, `tr_saup_no`, `tr_jumin_no`, `tr_up`\r\n\t\t\t\t\t, `tr_jong`, `tr_zip`, `tr_addr`, `tr_tel`, `tr_phone`, `tr_fax`, `tr_email`, `tr_bigo`, `reg_date`, `reg_uid`)\r\n\t\t\t\t\tVALUES ({$customer_id} , {$co_id}, '{$tr_nm}', '{$tr_daepyo}', '{$tr_saup_no}', '{$tr_jumin_no}','{$tr_up}'\r\n\t\t\t\t\t\t, '{$tr_jong}', '{$tr_zip}', '{$tr_addr}', '{$tr_tel}', '{$tr_phone}', '{$tr_fax}', '{$tr_email}','{$tr_bigo}', now(), {$uid})\t\t\t\t\t\t\r\n\t\t\t\tON DUPLICATE KEY UPDATE\r\n\t\t\t\t\t`customer_id` = {$customer_id} , `co_id` = {$co_id}, `tr_nm` = '{$tr_nm}', `tr_daepyo` = '{$tr_daepyo}', `tr_saup_no` = '{$tr_saup_no}', `tr_jumin_no` = '{$tr_jumin_no}',\r\n\t\t\t\t\t`tr_up` = '{$tr_up}', `tr_jong` = '{$tr_jong}', `tr_zip` = '{$tr_zip}', `tr_addr` = '{$tr_addr}',\r\n\t\t\t\t\t`tr_tel` = '{$tr_tel}', `tr_phone` = '{$tr_phone}', `tr_fax` = '{$tr_fax}', `tr_email` = '{$tr_email}',\r\n\t\t\t\t\t`tr_bigo` = '{$tr_bigo}', `reg_date` = now(), `reg_uid` = {$uid};";
$this->updateSql($sql);
return '00';
}
示例4: requestModify
public function requestModify()
{
//------------------------------------
// param valid check
//-------------------------------------
$uid = (int) $_SESSION[DBWork::sessionKey];
$co_id = (int) $_SESSION[DBWork::accountKey];
$_id = (int) $this->param['_id'];
$yyyymmdd = (int) $this->param['yyyymmdd'];
$memorial = $this->param['memorial'];
$input_type = (int) $this->param['input_type'];
if (!$yyyymmdd || !Util::lengthCheck($yyyymmdd, 8, 8)) {
throw new Exception('Date length');
}
//------------------------------------
// db work
//-------------------------------------
$sql = "UPDATE memorial_day SET\r\n\t\t\t\t`yyyymmdd` = {$yyyymmdd}, `memorial` = '{$memorial}', `input_type` = {$input_type},\r\n\t\t\t\t`reg_date` = now(), `reg_uid` = {$uid} WHERE co_id = {$co_id} and `_id` = {$_id};";
$this->updateSql($sql);
return 1;
}
示例5: requestList
public function requestList()
{
//------------------------------------
// param valid check
//-------------------------------------
$pageIndex = (int) $this->param['pg_inx'];
$searchValue = $this->param['svalue'];
$tblName = $this->getTableName($this->param['tbl_kind']);
//검색어 체크
if ($searchValue) {
if (!$searchValue || !Util::lengthCheck($searchValue, 2, 20)) {
throw new Exception('Board search param - title length');
}
$this->escapeString($searchValue);
}
//페이지 인덱스 체크
if ($pageIndex < 1 || $pageIndex > $this->max_page_index) {
throw new Exception('Board Invalid param.');
}
//------------------------------------
// db work
//-------------------------------------
$pageStart = $this->page_size * ($pageIndex - 1);
if ($searchValue) {
$sql = "select count(*) from {$tblName}" . "_board where faq_ques like {$searchValue} limit {$this->max_tot_count}";
} else {
$sql = "select count(*) from {$tblName}" . "_board limit {$this->max_tot_count}";
}
$this->querySql($sql);
//전체 질문 개수를 가져온다.
$row = $this->fetchArrayRow();
if ($searchValue) {
$sql = "select faq_id, faq_ques from {$tblName}" . "_board where faq_ques like {$searchValue} order by faq_id limit {$pageStart}, {$this->page_size}";
} else {
$sql = "select faq_id, faq_ques from {$tblName}" . "_board order by faq_id limit {$pageStart}, {$this->page_size}";
}
$this->querySql($sql);
//전체 아이템 개수 리턴
return $row[0];
}
示例6: requestModify
public function requestModify()
{
//------------------------------------
// param valid check
//-------------------------------------
$uid = (int) $_SESSION[DBWork::sessionKey];
$co_id = (int) $_SESSION[DBWork::accountKey];
$jakmok_code = (int) $this->param['jakmok_code'];
$jakmok_name = $this->param['jakmok_name'];
$use_yn = (int) $this->param['use_yn'];
$in_type = (int) $this->param['in_type'];
//작목 이름 체크
if ($jakmok_name) {
if (!$jakmok_name || !Util::lengthCheck($jakmok_name, 2, 20)) {
throw new Exception('JokMok_Name length');
}
$this->escapeString($jakmok_name);
}
//------------------------------------
// db work
//-------------------------------------
$sql = "call sp_jakmok_edit({$co_id}, {$jakmok_code}, '{$jakmok_name}' , {$uid}, {$use_yn}, {$in_type})";
$this->querySql($sql);
$row = $this->fetchArrayRow();
if ($row[0] == 0) {
return 0;
} else {
return $row[0];
}
}
示例7: requestCommentEdit
public function requestCommentEdit()
{
//------------------------------------
// param valid check
//------------------------------------
$postid = (int) $this->param['post_id'];
$tblName = $this->getTableName($this->param['tbl_kind']);
$cmt_message = $this->param['cmt_message'];
//댓글 아이디
$cmtid = (int) $this->param['comment_id'];
//댓글 작성자 user_id
$userid = (int) $this->param['user_id'];
//유효한 게시판 종류가 아니면
if ($tblName == null) {
throw new Exception('Comment Invalid param - table name');
}
//유효하지 않은 postid
if ($postid <= 0) {
throw new Exception('Invalid request');
}
if ($cmtid <= 0) {
throw new Exception('Invalid request');
}
//길이 체크
if (!Util::lengthCheck($cmt_message, 2, 500)) {
throw new Exception('Comment Invalid param - message length');
}
//자신의 글이 아니면 오류
$uid = (int) $_SESSION['uid'];
if ($uid == 0) {
throw new Exception('Invalid Session.');
}
if ($uid != $userid) {
throw new Exception('Invalid request');
}
//------------------------------------
// db work
//------------------------------------
$this->escapeString($cmt_message);
$sql = "update {$tblName}" . "_comment set comment_date = now(), message = '{$cmt_message}' where comment_id = {$cmtid} and post_id = {$postid} and user_id = {$uid}";
$this->updateSql($sql);
return $this->getAffectedRows() > 0;
}
示例8: changePwd
/**
* 비밀번호 변경
* @return uid
* @throws Exception
*/
public function changePwd()
{
//------------------------------------
// param valid check
//-------------------------------------
//필수
$cert = $_SESSION['cert'];
$login_id = $_SESSION['login_id'];
$loginPw = $this->param['pwd'];
//인증 체크
if ($cert != 'y') {
throw new Exception('휴대폰 인증을 해주십시요.');
}
//길이 체크
if (!Util::lengthCheck($loginPw, 6, 20)) {
throw new Exception('비밀번호 길이는 6~20자입니다.');
}
//------------------------------------
// db work
//-------------------------------------
//비밀번호만 금칙문자 처리를 하면 된다.
$this->escapeString($loginPw);
$sql = "UPDATE `user_info` SET `user_pwd` = sha1('{$loginPw}') WHERE `user_id` = '{$login_id}';";
$this->updateSql($sql);
return 'y';
}
示例9: requestModify
public function requestModify()
{
//------------------------------------
// param valid check
//-------------------------------------
$uid = (int) $_SESSION[DBWork::sessionKey];
$co_id = (int) $_SESSION[DBWork::accountKey];
$gycode = (int) $this->param['gycode'];
$gy_name = $this->param['gy_name'];
$gy_rem = $this->param['gy_rem'];
$use_yn = (int) $this->param['use_yn'];
if ($gycode < 100 or $gycode > 499) {
throw new Exception('GyCode Numbering Error');
}
//작목 이름 체크
if ($gy_name) {
if (!$gy_name || !Util::lengthCheck($gy_name, 2, 40)) {
throw new Exception('GyCode Name length');
}
$this->escapeString($gy_name);
}
//------------------------------------
// db work
//-------------------------------------
//if($sys)$sql = "call sp_gycode_sys_edit($co_id, $gycode, '$gy_name' ,'$gy_rem' , $uid ,$use_yn)";
//else
$sql = "call sp_gycode_edit({$co_id}, {$gycode}, '{$gy_name}' ,'{$gy_rem}' , {$uid} ,{$use_yn})";
$this->querySql($sql);
$row = $this->fetchArrayRow();
if ($row[0] == 0) {
return 0;
} else {
return $row[0];
}
}
示例10: requestModify
public function requestModify()
{
//------------------------------------
// param valid check
//-------------------------------------
$uid = (int) $_SESSION[DBWork::sessionKey];
$co_id = (int) $_SESSION[DBWork::accountKey];
$customer_id = (int) $this->param['customer_id'];
$tr_nm = $this->param['tr_nm'];
$tr_daepyo = $this->param['tr_daepyo'];
$tr_saup_no = $this->param['tr_saup_no'];
$tr_jumin_no = $this->param['tr_jumin_no'];
$tr_up = $this->param['tr_up'];
$tr_jong = $this->param['tr_jong'];
$tr_zip = $this->param['tr_zip'];
$tr_addr = $this->param['tr_addr'];
$tr_tel = $this->param['tr_tel'];
$tr_phone = $this->param['tr_phone'];
$tr_fax = $this->param['tr_fax'];
$tr_homepage = $this->param['tr_homepage'];
$tr_email = $this->param['tr_email'];
$tr_manager = $this->param['tr_manager'];
$tr_sdate = $this->param['tr_sdate'];
$tr_edate = $this->param['tr_edate'];
$cid_tel1 = $this->param['cid_tel1'];
$cid_tel2 = $this->param['cid_tel2'];
$cid_tel3 = $this->param['cid_tel3'];
$tr_bigo = $this->param['tr_bigo'];
$tr_chuchun = (int) $this->param['tr_chuchun'];
//작목 이름 체크
if ($tr_nm) {
if (!$tr_nm || !Util::lengthCheck($tr_nm, 2, 45)) {
throw new Exception('Customer Name length');
}
$this->escapeString($tr_nm);
}
//------------------------------------
// db work
//-------------------------------------
$customer_id = (int) $this->param['customer_id'];
$tr_nm = $this->param['tr_nm'];
$tr_daepyo = $this->param['tr_daepyo'];
$tr_saup_no = $this->param['tr_saup_no'];
$tr_jumin_no = $this->param['tr_jumin_no'];
$tr_up = $this->param['tr_up'];
$tr_jong = $this->param['tr_jong'];
$tr_zip = $this->param['tr_zip'];
$tr_addr = $this->param['tr_addr'];
$tr_tel = $this->param['tr_tel'];
$tr_phone = $this->param['tr_phone'];
$tr_fax = $this->param['tr_fax'];
$tr_homepage = $this->param['tr_homepage'];
$tr_email = $this->param['tr_email'];
$tr_manager = $this->param['tr_manager'];
$tr_sdate = $this->param['tr_sdate'];
$tr_edate = $this->param['tr_edate'];
$cid_tel1 = $this->param['cid_tel1'];
$cid_tel2 = $this->param['cid_tel2'];
$cid_tel3 = $this->param['cid_tel3'];
$tr_bigo = $this->param['tr_bigo'];
$tr_chuchun = (int) $this->param['tr_chuchun'];
$sql = "call sp_customer_edit({$customer_id}, {$co_id}, '{$tr_nm}', '{$tr_daepyo}', '{$tr_saup_no}', \r\n\t\t\t\t\t\t\t\t\t\t\t '{$tr_jumin_no}', '{$tr_up}', '{$tr_jong}', '{$tr_zip}', '{$tr_addr}', \r\n\t\t\t\t\t\t\t\t\t\t\t '{$tr_tel}', '{$tr_phone}', '{$tr_fax}', '{$tr_homepage}', '{$tr_email}', \r\n\t\t\t\t\t\t\t\t\t\t\t '{$tr_manager}', '{$tr_sdate}', '{$tr_edate}', '{$cid_tel1}', '{$cid_tel2}', \r\n\t\t\t\t\t\t\t\t\t\t\t '{$cid_tel3}', '{$tr_bigo}', {$tr_chuchun}, {$uid})";
$this->querySql($sql);
$row = $this->fetchMixedRow();
if ($row[0] == 0) {
return 0;
} else {
return $row[0];
}
}
示例11: requestFeedbackInsert
public function requestFeedbackInsert()
{
//------------------------------------
// param valid check
//-------------------------------------
$fdb_message = $this->param['fdb_message'];
$uid = $this->param['user_id'];
$nick = $this->param['nickname'];
//길이 체크
if (!Util::lengthCheck($fdb_message, 2, 500)) {
throw new Exception('Feedback Invalid param - message length');
}
//------------------------------------
// db work
//-------------------------------------
$this->escapeString($fdb_message);
//query-----------------------------
$sql = "insert into feedback_comment values (NULL, {$uid}, now(), '{$nick}', '{$fdb_message}')";
$this->updateSql($sql);
$sql = "select LAST_INSERT_ID()";
$this->querySql($sql);
//-------------------------------
$row = $this->fetchArrayRow();
//새로 추가된 comment_id 를 리턴한다.
return $row[0];
}
示例12: requestModify
public function requestModify()
{
//------------------------------------
// param valid check
//-------------------------------------
$uid = (int) $_SESSION[DBWork::sessionKey];
$co_id = (int) $_SESSION[DBWork::accountKey];
$work_cd = (int) $this->param['work_cd'];
$work_nm = $this->param['work_nm'];
$use_yn = $this->param['use_yn'];
//작목 이름 체크
if ($work_nm) {
if (!$work_nm || !Util::lengthCheck($work_nm, 2, 45)) {
throw new Exception('Work Code Name length');
}
$this->escapeString($work_nm);
}
//------------------------------------
// db work
//-------------------------------------
$sql = "call sp_work_cd_edit({$co_id}, {$work_cd}, '{$work_nm}' , {$uid}, '{$use_yn}')";
$this->querySql($sql);
$row = $this->fetchArrayRow();
if ($row[0] == 0) {
return 0;
} else {
return $row[0];
}
}
示例13: requestModify
public function requestModify()
{
//------------------------------------
// param valid check
//-------------------------------------
$uid = (int) $_SESSION[DBWork::sessionKey];
$co_id = (int) $_SESSION[DBWork::accountKey];
$_id = (int) $this->param['_id'];
$work_date = $this->param['work_date'];
$jakmok_cd = (int) $this->param['jakmok_cd'];
$work_cd = (int) $this->param['work_cd'];
$weather_cd = (int) $this->param['weather_cd'];
$work_area = (int) $this->param['work_area'];
$work_man = (int) $this->param['work_man'];
$work_time = (int) $this->param['work_time'];
$work_job = $this->param['work_job'];
if ($work_date) {
if (!$work_date || !Util::lengthCheck($work_date, 8, 8)) {
throw new Exception('Work Date length');
}
}
//------------------------------------
// db work
//-------------------------------------
//$sql = "call sp_workdairy_edit($_id, $co_id, '$work_date', $jakmok_cd, $work_cd, $weather_cd, $uid, $work_area, $work_man, $work_time , '$work_job')";
$sql = "UPDATE workdairy \r\n\t\t\t\t\tSET\r\n\t\t\t\t\t\t`work_date` = '{$work_date}', `jakmok_cd` = {$jakmok_cd}, `work_cd` = {$work_cd},\t`weather_cd` = {$weather_cd},\r\n\t\t\t\t\t\t`reg_uid` = {$uid},\t`reg_date` = NOW(), `work_area` = {$work_area}, `work_man` = {$work_man},\r\n\t\t\t\t\t\t`work_time` = {$work_time}, `work_job` = '{$work_job}'\r\n\t\t\tWHERE _id={$_id} and co_id = {$co_id};";
$this->updateSql($sql);
}