From 5a64d688b6f45fc13bed5ff3d21fa925f4f762fc Mon Sep 17 00:00:00 2001 From: hyzboy Date: Fri, 2 Sep 2016 14:41:18 +0400 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9BUITABLE=E6=8E=A7=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- form/form_editbox.php | 4 ++-- tools_firstpage.js | 12 ++++++------ tools_sql.php | 17 +++++++++++++---- ui_table.php | 4 ++-- 4 files changed, 23 insertions(+), 14 deletions(-) diff --git a/form/form_editbox.php b/form/form_editbox.php index 10116d7..bfe722b 100644 --- a/form/form_editbox.php +++ b/form/form_editbox.php @@ -3,14 +3,14 @@ function CreateInputGroup() { $type =func_get_arg(0); - $id =func_get_arg(1); + $name =func_get_arg(1); $label =func_get_arg(2); $size =func_get_arg(3); echo '
- '; + '; if(func_num_args()==5) { diff --git a/tools_firstpage.js b/tools_firstpage.js index 8fb7b87..e22858a 100644 --- a/tools_firstpage.js +++ b/tools_firstpage.js @@ -1,12 +1,12 @@ -function on_first_page() +function on_first_page() { var form=document.forms["cm_first_form"]; - var username=form["username"].value; - var password=form["password"].value; - - if(username==null||username==""){alert("username must be filled out");return;} - if(password==null||password==""){alert("password must be filled out");return;} +// var username=form["username"].value; +// var password=form["password"].value; +// +// if(username==null||username==""){alert("username must be filled out");return;} +// if(password==null||password==""){alert("password must be filled out");return;} form["width" ].value=document.body.clientWidth; form["height" ].value=document.body.clientHeight; diff --git a/tools_sql.php b/tools_sql.php index 4faf643..3e44343 100644 --- a/tools_sql.php +++ b/tools_sql.php @@ -1,6 +1,6 @@ query($sql_string); + $sql_result=$sql->query($sql_string); + + if($sql_result) + return $sql_result; + + echo 'SQL Insert error,SQLString: '.$sql_string.'
'; + echo 'SQL Error: '.$sql->error; + return null; } /** @@ -159,7 +165,10 @@ $resultmode=MYSQLI_STORE_RESULT; foreach($field_array as $field) - $data_array[$field]=$_POST[$field]; + { + if(isset($_POST[$field])&&strlen($_POST[$field])>0) + $data_array[$field]=$_POST[$field]; + } return sql_insert($table_name,$data_array,$resultmode); } diff --git a/ui_table.php b/ui_table.php index 7a97ba0..2f66215 100644 --- a/ui_table.php +++ b/ui_table.php @@ -46,9 +46,9 @@ echo '

'.$this->body.'

'; if($this->table_style) - echo ''; + echo '
'; else - echo '
'; + echo '
'; if($this->fields!=null) {