function getwebsitepages($websiteid) { $website = new Website(); $res = $website->fetchwebpages($websiteid); $pagearr = array(); $count = 0; while ($pagerow = $website->fetch_assoc($res)) { if (empty($pagecontent)) { $pagearr[$count] = $pagerow['page_id']; $count++; } } return $pagearr; }
$website = new Website(); $submenus = $website->editblankpages($websiteid, $pageid); $smenunum = $website->num_rows($submenus); if ($smenunum > 0) { ?> Want to add more submenu ? <select id='checksubmenu' name='checksubmenu'> <option value='' selected >Select</option> <option value='Yes'>Yes</option> <option value='No'>No</option> </select> <!--<input type='checkbox' id="checksubmenu" name='checksubmenu' value='yes'><br>--> <div id='submenudiv'> Submenu pages :<br> <?php while ($nonmenupages = $website->fetch_assoc($submenus)) { ?> <input type='checkbox' name='submenu[]' value='<?php echo $nonmenupages['page_id']; ?> ' > <?php echo $nonmenupages['page_name']; echo "<br>"; ?> <?php } } ?> </div> </div>
if (isset($_GET['pageurlid'])) { $pageid = Mod_addslashes($_GET['pageurlid']); $websiteid = $_SESSION['websiteid']; $website = new Website(); /***********for fetching particular page information *************/ $res = $website->fetchpage($websiteid, $pageid); $pagerow = $website->fetch_assoc($res); //print_r($pagerow); $pageid = $pagerow['page_id']; $pagename = $pagerow['page_name']; $pagecontent = $pagerow['page_content']; } /******* fetching website information ***************/ $website = new Website(); $webres = $website->fetchewebsiteinfo($websiteid); $webrow = $website->fetch_assoc($webres); //print_r($pagerow); $webid = $webrow['website_id']; $webname = $webrow['website_name']; $webusr = $webrow['user_id']; $webkeyword = $webrow['keyword']; $websitetitle = $webrow['site_title']; $webdescription = $webrow['meta_description']; $pagearr = $items; $limit = 1; $qty_items = count($items); $qty_pages = ceil($qty_items / $limit); $pageid = isset($_GET['pageurlid']) ? $_GET['pageurlid'] : null; $curr_page = array_search($pageid, $pagearr); $next_page = $curr_page < $qty_pages ? $curr_page + 1 : null; $prev_page = $curr_page > 1 ? $curr_page - 1 : null;
session_start(); include_once 'header.php'; include_once 'includes/website.php'; //include_once('adminmenu.php');\ $websiteid = 1; //fetch by $website = new Website(); $res = $website->fetchpage($websiteid, $pageid = 0); // To fetch pages by user_id //echo $res; if ($res > 0) { echo "<table id='pages' border='2' cellspacing='2px' cellwidth='5px' >"; echo "<tr><th>Sr.No.</th><th>Pages</th><th>Actions</th></tr>"; $count = 0; while ($pagerow = $website->fetch_assoc($res)) { $count++; //extract($pagerow); echo "<tr>"; echo "<td>{$count}</td><td>" . $pagerow['page_name'] . "</td><td><a href='viewpage.php?pageurlid=" . $pagerow['page_id'] . "'>view</a> | <a href='editpage.php?pageurlid=" . $pagerow['page_id'] . "'>Edit</a> | <a href='deletepage.php?pageurlid=" . $pagerow['page_id'] . "' onclick=\"return confirm('Are you Sure?');\"> Delete </a> </td>"; echo "</tr>"; } echo "</table>"; echo "<br><div id='pageNavPosition'></div>"; } else { echo "no pages found for particular users"; } ?> <body> <script type="text/javascript"><!--