<?php require_once '../db_connect.php'; require_once 'ad_functions.php'; include_once 'cp_header.php'; include_once 'cp_leftCol.php'; ?> <div id='cp_main'> <?php if (isset($_GET['function'])) { switch ($_GET['function']) { case 'personalInfo': personalInfo(); break; case 'editPersonalInfo': editPersonalInfo(); break; default: echo '<p>Welcome to admin control panel!</p>'; break; } } if (isset($_POST['change'])) { $AdAdress = $_POST['AdAdress']; $AdTelephone = $_POST['AdTelephone']; $AdEmail = $_POST['AdEmail']; $query = "update Admin set AdAdress = '{$AdAdress}', AdTelephone = '{$AdTelephone}', AdEmail = '{$AdEmail}' where AdUsername = '******'"; if (!mysql_query($query)) { die('Fail to update personal information!<br/> ' . mysql_error()); } mysql_close($link);
} $person->updPersonalInfo($param); } function papers($code) { global $smarty, $db; $query = 'select code_paper from authoring where code_author = ' . $db->quote($code); $result =& $db->queryAll($query); foreach ($result as $val) { $paper = new Lesen_paper($val['code_paper']); } $smarty->assign('body', $smarty->fetch('AdmMyPapers.tpl')); } if (isset($_GET['option'])) { switch ($_GET['option']) { case 'myinfo': personalInfo(1); break; case 'mypapers': papers(1); break; case 'newpaper': addPaper(1); break; default: break; } } else { welcome('1'); } $smarty->display('page.tpl');
function getPersonalInfo($user) { $proInfo = personalInfo($user); return $proInfo; }