<p> </p> <hr /> <p> </p> <h2>内容查看 </h2> <table width="100%" border="1" style="text-align:center"> <tr> <th>标题</th><th>发布时间</th> </tr> <?php // --id-- content-- times -- $pdo = new PdoMySQL(); $sql = "SELECT * FROM `YQ_about`"; $result = $pdo->getRow($sql); $times = $result['times']; if ($result != 0) { ?> <tr> <td><a href="../YQ_about.php" target="_blank">园区简介</a></td> <td><?php echo $times; ?> </td> </tr> <?php } ?>
<img src="images/info.png" alt="" title="" class="sidebar_icon_right" /> <p> 技术支持:<span> 21度传媒有限公司 </span> </p> </div> <div class="sidebar_box_bottom"></div> </div> </div> <div class="right_content"> <h2>用户管理</h2> <hr/> <br/> <?php $pdo = new PdoMySQL(); $sql = "SELECT * FROM admin WHERE id = 1"; $res = $pdo->getRow($sql); ?> <h2>修改用户信息</h2> <form action="doAction.php?table=admin" method="POST" > <p>用 户 名 :<input type="text" id="username" name="username" class="add_bar" value="<?php echo $res[username]; ?> "></p> <p>新 密 码 :<input type="password" id="password1" name="password1" class="add_bar" ?></p> <p>确认密码:<input type="password" id="password2" name="password2" class="add_bar" ?></p> <p><input type="submit" id="submit" name="submit" value="修改" onclick="return checkform()"></p> </form>
</div><!-- END of templatemo_header --> <div id="templatemo_menu" class="ddsmoothmenu"> <?php include_once "./include/menu.php"; ?> <br style="clear: left" /> </div> <!-- end of templatemo_menu --> <div id="templatemo_main"> <?php require_once 'admin/include.php'; $id = htmlspecialchars(trim($_GET["id"])); $pdo = new PdoMySQL(); $sql = "SELECT * FROM `YQ_set` WHERE id = 1"; $row = $pdo->getRow($sql); $times = $row['times']; $content = $row['content']; ?> <p>你现在的位置是:<a href="index.php">首页</a> > <a href="YQ_set.php">机构设置</a></p> <hr style="border : 1px dashed #036"/> <br/> <h3 align="center">机构设置</h3> <hr/> <br/> <span><?php echo $content; ?>
<?php include_once "./include/menu.php"; ?> <br style="clear: left" /> </div> <!-- end of templatemo_menu --> <div id="templatemo_main"> <p>你现在的位置是:<a href="index.php">首页</a> > <a href="index_CYZC.php">创业政策</a></p> <hr style="border : 1px dashed #036"/> <br/> <?php require_once 'admin/include.php'; $id = htmlspecialchars(trim($_GET["id"])); $pdo = new PdoMySQL(); if (!empty($id)) { $sql = "SELECT * FROM `index_CYZC` WHERE id = {$id}"; $row = $pdo->getRow($sql); $title = $row['title']; $author = $row['author']; $times = $row['times']; $content = $row['content']; $url = $row['url']; $size = $row['size']; ?> <h3 align="center"><?php echo $title; ?> </h3>
/* 关键字 */ $keyword = trim($_REQUEST['keyword']); if (!empty($keyword)) { $str = ""; $count = ""; /* 搜索表名称 */ $arr = array("index_YQDT" => '`title`,`content`', "index_CYZC" => '`title`,`content`', "index_CYTD" => '`title`,`content`', "index_TZGG" => '`title`,`content`', "index_ZYXZ" => '`title`', "YS_about" => '`title`,`content`', "YS_build" => '`title`,`content`', "CY_news" => '`title`,`content`', "CY_teamnews" => '`title`,`content`', "CY_job" => '`title`'); foreach ($arr as $key => $value) { $row = explode(",", $value); $title = str_replace("`", "", $row[0]); $content = str_replace("`", "", $row[1]); $sql = "SELECT * FROM " . $key . " "; for ($i = 0; $i < count($row); $i++) { $sql .= (preg_match('/WHERE/i', $sql) ? ' or ' : ' WHERE ') . $row[$i] . " like '%" . $keyword . "%' "; } $pdo = new PdoMySQL(); $pdo->query($sql); while ($site = PdoMySQL::$PDOStatement->fetch(constant("PDO::FETCH_ASSOC"))) { $title2 = str_ireplace($keyword, "<strong><font color='red'>" . $keyword . "</font></strong>", $site[$title]); $content2 = str_ireplace($keyword, "<font color='red'>" . $keyword . "</font>", cut_str_with_string(strip_tags($site[$content]), 180)); switch ($key) { case 'index_YQDT': $href = "index_YQDT.php?id=" . $site['id']; break; case 'index_CYZC': $href = "index_CYZC.php?id=" . $site['id']; break; case 'index_CYTD': $href = "index_CYTD.php?id=" . $site['id']; break; case 'index_TZGG':
</div></li> <?php } ?> </ul> <a href="index_TZGG.php" class="more">更多>></a> </div> <div class="half right"> <h2>资源下载</h2> <ul class="list_bullet"> <?php require_once 'admin/include.php'; $pdo = new PdoMySQL(); $sql = "SELECT * FROM `index_ZYXZ` ORDER BY id DESC LIMIT 5"; $result = $pdo->getAll($sql); foreach ($result as $row) { $id = $row['id']; $title = $row['title']; $times = $row['times']; //分割时间字符串 $time = explode(" ", $times); ?> <li ><a href = "index_ZYXZ.php?id=<?php echo $id; ?> "><?php echo $title;
/** * 销毁连接对象,关闭数据库 */ public static function close() { self::$link = null; }
<img src="images/info.png" alt="" title="" class="sidebar_icon_right" /> <p> 技术支持:<span> 21度传媒有限公司 </span> </p> </div> <div class="sidebar_box_bottom"></div> </div> </div> <div class="right_content"> <h2>总体概括</h2> <hr/> <br/> <?php $pdo = new PdoMySQL(); //园区动态 $sql = "select id from index_YQDT"; $rows = $pdo->getAll($sql); $rowCount1 = count($rows); //创业政策 $sql = "select id from index_CYZC"; $rows = $pdo->getAll($sql); $rowCount2 = count($rows); //创业团队 $sql = "select id from index_CYTD"; $rows = $pdo->getAll($sql); $rowCount3 = count($rows); //通知公告 $sql = "select id from index_TZGG"; $rows = $pdo->getAll($sql);
<?php header('content-type:text/html;charset=utf-8'); //1.包含所需文件 require_once 'swiftmailer-master/lib/swift_required.php'; require_once 'PdoMySQL.class.php'; require_once 'config.php'; require_once 'pwd.php'; //2.接收信息 $act = $_GET['act']; $username = addslashes($_POST['username']); $password = md5($_POST['password']); $email = $_POST['email']; $table = 'user'; //3.得到连接对象 $PdoMySQL = new PdoMySQL(); if ($act === 'reg') { $regtime = time(); //完成注册的功能 $token = md5($username . $password . $regtime); $token_exptime = $regtime + 24 * 3600; //过期时间 $data = compact('username', 'password', 'email', 'token', 'token_exptime', 'regtime'); $res = $PdoMySQL->add($data, $table); $lastInsertId = $PdoMySQL->getLastInsertId(); if ($res) { //发送邮件,以QQ邮箱为例 //配置邮件服务器,得到传输对象 $transport = Swift_SmtpTransport::newInstance('smtp.qq.com', 25); //设置登陆帐号和密码 $transport->setUsername('*****@*****.**');
} else { $sql = "UPDATE `contact` SET `times` ='{$times}' ,`content`='{$content}' WHERE `id` = '1' "; $pdo->execute($sql); } ?> <script type="text/javascript" language="javascript"> window.location.href="contact.php"; </script> <?php } ?> <?php //用户管理 if ($table == 'admin') { $username = $_POST['username']; $password = md5($_POST['password1']); $pdo = new PdoMySQL(); $sql = "UPDATE `admin` SET `username` ='{$username}' ,`password` = '{$password}' WHERE `id` = 1 "; $pdo->execute($sql); echo "修改成功,3秒后跳转到登录页面!<meta http-equiv='refresh' content='3;url=login.php'/>"; } ?>
/** * 抛出pdostatement对象异常 */ public static function haveErrorThrowException() { $obj = empty(self::$PDOStatement) ? self::$link : self::$PDOStatement; $arrError = $obj->errorInfo(); //print_r($arrError); if ($arrError[0] != '00000') { self::$error = 'SQL State: ' . $arrError[0] . '<br />SQL Error: ' . $arrError[2] . '<br />'; self::throwException(self::$error); return false; } if (self::$queryStr === '') { self::throwException('没有SQL语句'); } }