From 39b4e65156bb35e5a23ef1904d16716cd9562ab1 Mon Sep 17 00:00:00 2001 From: BigCoke233 Date: Fri, 10 Jul 2020 22:10:27 +0800 Subject: =?UTF-8?q?:zap:=20Perf:=20=E5=88=A4=E6=96=AD=20$=5FPOST['type']?= =?UTF-8?q?=20=E5=AD=98=E5=9C=A8=E5=90=8E=E5=86=8D=E8=BE=93=E5=87=BA?= =?UTF-8?q?=EF=BC=8C=E9=98=B2=E6=AD=A2=E4=B8=8D=E5=BF=85=E8=A6=81=E7=9A=84?= =?UTF-8?q?=E6=8A=A5=E9=94=99=E5=92=8C=E5=85=B6=E4=BB=96=E9=A3=8E=E9=99=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- libs/Options.php | 127 ++++++++++++++++++++++++++++--------------------------- 1 file changed, 64 insertions(+), 63 deletions(-) (limited to 'libs/Options.php') diff --git a/libs/Options.php b/libs/Options.php index 27f5265..ed2fce5 100755 --- a/libs/Options.php +++ b/libs/Options.php @@ -15,32 +15,32 @@ function themeConfig($form) { $sjdq=$db->fetchRow($db->select()->from ('table.options')->where ('name = ?', 'theme:'.$name)); $ysj = $sjdq['value']; if(isset($_POST['type'])){ - if($_POST["type"]=="备份模板设置数据"){ - if($db->fetchRow($db->select()->from ('table.options')->where ('name = ?', 'theme:'.$name.'bf'))){ - $update = $db->update('table.options')->rows(array('value'=>$ysj))->where('name = ?', 'theme:'.$name.'bf'); - $updateRows= $db->query($update); - }else{ - if($ysj){ - $insert = $db->insert('table.options') - ->rows(array('name' => 'theme:'.$name.'bf','user' => '0','value' => $ysj)); - $insertId = $db->query($insert); - } - } - } - if($_POST["type"]=="还原模板设置数据"){ - if($db->fetchRow($db->select()->from ('table.options')->where ('name = ?', 'theme:'.$name.'bf'))){ - $sjdub=$db->fetchRow($db->select()->from ('table.options')->where ('name = ?', 'theme:'.$name.'bf')); - $bsj = $sjdub['value']; - $update = $db->update('table.options')->rows(array('value'=>$bsj))->where('name = ?', 'theme:'.$name); - $updateRows= $db->query($update); - } - } - if($_POST["type"]=="删除备份数据"){ - if($db->fetchRow($db->select()->from ('table.options')->where ('name = ?', 'theme:'.$name.'bf'))){ - $delete = $db->delete('table.options')->where ('name = ?', 'theme:'.$name.'bf'); - $deletedRows = $db->query($delete); - } - } + if($_POST["type"]=="备份模板设置数据"){ + if($db->fetchRow($db->select()->from ('table.options')->where ('name = ?', 'theme:'.$name.'bf'))){ + $update = $db->update('table.options')->rows(array('value'=>$ysj))->where('name = ?', 'theme:'.$name.'bf'); + $updateRows= $db->query($update); + }else{ + if($ysj){ + $insert = $db->insert('table.options') + ->rows(array('name' => 'theme:'.$name.'bf','user' => '0','value' => $ysj)); + $insertId = $db->query($insert); + } + } + } + if($_POST["type"]=="还原模板设置数据"){ + if($db->fetchRow($db->select()->from ('table.options')->where ('name = ?', 'theme:'.$name.'bf'))){ + $sjdub=$db->fetchRow($db->select()->from ('table.options')->where ('name = ?', 'theme:'.$name.'bf')); + $bsj = $sjdub['value']; + $update = $db->update('table.options')->rows(array('value'=>$bsj))->where('name = ?', 'theme:'.$name); + $updateRows= $db->query($update); + } + } + if($_POST["type"]=="删除备份数据"){ + if($db->fetchRow($db->select()->from ('table.options')->where ('name = ?', 'theme:'.$name.'bf'))){ + $delete = $db->delete('table.options')->where ('name = ?', 'theme:'.$name.'bf'); + $deletedRows = $db->query($delete); + } + } } /** @@ -64,45 +64,46 @@ function themeConfig($form) {    '; - //备份数据提示 - if($_POST["type"]=="备份模板设置数据"){ - if($db->fetchRow($db->select()->from ('table.options')->where ('name = ?', 'theme:'.$name.'bf'))){ - echo '
备份已更新,请等待自动刷新!如果等不到请点击'; - ?>这里
-备份完成,请等待自动刷新!如果等不到请点击'; -?> 这里 -fetchRow($db->select()->from ('table.options')->where ('name = ?', 'theme:'.$name.'bf'))){ - echo '
检测到模板备份数据,恢复完成,请等待自动刷新!如果等不到请点击'; - ?> 这里
- -没有模板备份数据,恢复不了哦!'; - } - } - //删除数据提示 - if($_POST["type"]=="删除备份数据"){ - if($db->fetchRow($db->select()->from ('table.options')->where ('name = ?', 'theme:'.$name.'bf'))){ - echo '
删除成功,请等待自动刷新,如果等不到请点击'; -?> -这里
- -备份已经被删除了'; - ?>fetchRow($db->select()->from ('table.options')->where ('name = ?', 'theme:'.$name.'bf'))){ + echo '
备份已更新,请等待自动刷新!如果等不到请点击'; + ?>这里
+ 备份完成,请等待自动刷新!如果等不到请点击'; + ?> 这里 + fetchRow($db->select()->from ('table.options')->where ('name = ?', 'theme:'.$name.'bf'))){ + echo '
检测到模板备份数据,恢复完成,请等待自动刷新!如果等不到请点击'; + ?> 这里
+ + 没有模板备份数据,恢复不了哦!'; + } + } + //删除数据提示 + if($_POST["type"]=="删除备份数据"){ + if($db->fetchRow($db->select()->from ('table.options')->where ('name = ?', 'theme:'.$name.'bf'))){ + echo '
删除成功,请等待自动刷新,如果等不到请点击'; + ?> + 这里
+ + 备份已经被删除了'; + ?>'; } - echo '
'; - /** * 设置项 -- cgit v1.2.3