Login   Register  
PHP Classes
elePHPant
Icontem

File: create_menu.html

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of MarPlo  >  Online PHP Menu Builder Class  >  create_menu.html  >  Download  
File: create_menu.html
Role: Auxiliary data
Content type: text/plain
Description: Page to set the menu
Class: Online PHP Menu Builder Class
Create hierarchic menus stored in a MySQL database
Author: By
Last change:
Date: 1 year ago
Size: 6,891 bytes
 

Contents

Class file image Download
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Multi-Level Menu Creator</title>
<meta name="description" content="Multi-Level Menu Creator script, Ajax,PHP-MySQL, from CoursesWeb.net" />
<meta name="keywords" content="Multi-Level menu, create menu, menu creator" />
<meta name="robots" content="ALL" />
<meta name="author" content="CoursesWeb.net" />
<link href="setmenu/style.css" rel="stylesheet" type="text/css" />
<link href="setmenu/hv_menu.css" rel="stylesheet" type="text/css" id="m_style" />
</head>
<body>
<h1>Multi-Level Menu Creator</h1>

<strong><u><em>Menu style</em></u>:</strong>
<label for="hv_menu"><input type="radio" name="mstyle" id="hv_menu" value="hv_menu" checked="checked" />Horizontal-Vertical</label>
<label for="vh_menu1"><input type="radio" name="mstyle" id="vh_menu1" value="vh_menu1" />Vertical-Horizontal 1</label>
<label for="vh_menu2"><input type="radio" name="mstyle" id="vh_menu2" value="vh_menu2" />Vertical-Horizontal 2</label>
<div id="showmenu">
 <h4>Your Menu</h4>
 <div id="m_menu"></div>
</div>

<ul id="ultabs">
 <li id="tabgets">Get Saved Menu</li>
 <li id="tabsets" class="tabvi">Set Menu</li>
 <li id="tabcodes">Get Code</li>
</ul>

<div id="gets">
 <h3>Get Saved Menu</h3><br/>
 <strong><em>From</em>:</strong> <label for="getxt"><input type="radio" name="geto" id="getxt" value="txt" checked="checked" />TXT file</label>
 <label for="getmysql"><input type="radio" name="geto" id="getmysql" value="mysql" />MySQL database</label><br/>
 <form action="#" method="post" id="fgets">
  <span>The name of the TXT file (without extension), or MySQL table in which a Menu is saved.</span><br/>
 Resource Name: <input type="text" name="getctg" id="getctg" maxlength="250" value="menu" /><br/>
  <input type="button" id="btnget" value="Load Menu" />
 </form>
</div>

<div id="sets">
 <h3>Set Categories / Sub-Categories</h3>
 <div id="slists">
  <em>Select to set Lists (Categories /Sub-categories /links) in your Menu.</em><br/>
  <div><strong id="sl">Root:</strong></div> <div><span id="n_sl"></span></div>
  <br style="clear:both" />
 </div>
 <form action="#" method="post" id="fset">
  <h4>Set Menu Items</h4>
  <strong><em>Category /Link Name</em>:</strong> <input type="text" name="namec" id="namec" size="25" maxlength="250" /><br/>
  <strong><em>Link Address</em>:</strong> <input type="text" name="lurl" id="lurl" size="33" maxlength="500" value="#" /><br/>
  <input type="button" id="addctg" value="Add Item / List" /><br/>
  IN: <span id="curentitem">Root</span><hr/>
  <input type="button" id="chgctg" value="Change Name / Link" /> &nbsp;
  <input type="button" id="delctg" value="Delete List" />
 </form>
 <form action="#" method="post" id="savedata">
  <h4>Save the Menu</h4>
  <strong><em>In</em>:</strong> <label for="totxt"><input type="radio" name="saveto" id="totxt" value="txt" checked="checked" />TXT File</label>
 <label for="tomysql"><input type="radio" name="saveto" id="tomysql" value="mysql" />MySQL Database</label>
 <label for="toboth"><input type="radio" name="saveto" id="toboth" value="both" />TXT and MySQL</label><br/>
 <div id="savename">
   <sub>(Name of the TXT file, or MySQL table in which data will be saved)</sub><br/>
  <strong><em>Resource Name</em>:</strong> <input type="text" name="ctgres" id="ctgres" maxlength="250" /><br/>
  <sup>- If the resource already exists, data will be replaced -</sup>
 </div>
 <div id="adm">
  <em>Here add the name and password set in "setmenu.php"</em><br/>
  Admin Name: &nbsp; &nbsp;&nbsp; <input type="text" name="admname" id="admname" maxlength="250" /><br/>
  Admin Password: <input type="password" name="admpass" id="admpass" maxlength="250" />
 </div>
  <input type="button" id="btnsave" value="Save" />
 </form>
 <br style="clear:both;" />
</div>

<div id="codes">
 <h3>Get Code</h3>
 <ul id="codetabs">
  <li id="tabchtml" class="tabvi">HTML and CSS Code</li>
  <li id="tabcjson">JSON Code</li>
  <li id="tabcsql">SQL Code</li>
 </ul>
 <div id="chtml">
   <h4>HTML and CSS Code for Menu</h4>
  <h5>HTML</h5>
   <p>- Copy and add this code in your HTML document, where you want to display the menu.</p>
  <textarea id="htmlcode" rows="10" cols="50"></textarea><hr/>
  <h5>CSS</h5>
  <p>- Copy this CSS code and add it in the CSS style of your web page.<br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
  <em>Edit /Modify the CSS properties according to your web page design.</em></p>
  <textarea id="csscode" rows="10" cols="50"></textarea>
 </div>
 <div id="cjson">
  <h4>JSON Code</h4>
  <p>- If you want to store the Menu code into a text file on server, copy this code and save it into a ".txt" file in "<strong>menus</strong>" directory.</p>
  <textarea id="jsoncode" rows="10" cols="50"></textarea><hr/>
  <p>- To include this Menu (saved in TXT file) in a php page, add the following code in your PHP file.<br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
  (<em>The "<strong>setmenu</strong>" directory with the "<strong>class.buildmenu.php</strong>" file, and the "<strong>menus</strong>" directory with TXT file must be in the same folder where you have the php file in which you include the Menu</em>).<br/>
  "file_name" is the name of the file in which you saved the JSON code.</p>
  <textarea id="phpctxt" rows="6" cols="50" readonly>&lt;?php
include('setmenu/class.buildmenu.php');
$obCtg = new buildMenu();
echo $obCtg-&gt;menuTxt('file_name.txt');
?&gt;</textarea>
 </div>
 <div id="csql">
  <h4>SQL Code</h4>
  <p>- This code can be used to create a table with the Menu structure in your database. For example, directly from PHPMyAdmin.<br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
  <em>Replace "table_name" with the name you want for Menu.</em></p>
  <textarea id="sqlcode" rows="8" cols="50"></textarea><hr/>
  <p>- To include this Menu (saved in MySQL) in a php page, add the following code in your PHP file.<br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
  (<em>The "<strong>setmenu</strong>" directory with the "<strong>class.buildmenu.php</strong>" file must be in the same folder where you have the php file</em>)<br/>
  "table_name" is the name of the MySQL table that stores the Menu.</p>
  <textarea id="phpcmysql" rows="10" cols="50" readonly>&lt;?php
// HERE add your data for connecting to MySQL database (MySQL server, user, password, database name)
define('DBHOST', 'localhost');
define('DBUSER', 'name');
define('DBPASS', 'password');
define('DBNAME', 'dbname');

include('setmenu/class.buildmenu.php');
$obCtg = new buildMenu();
echo $obCtg-&gt;menuMySQL('table_name');
?&gt;</textarea>
 </div>
</div>

<br/><br/>
<sup><a href="http://coursesweb.net/" title="Web programming and development courses">CoursesWeb.net</a></sup>
<script type="text/javascript" src="setmenu/setmenu.js"></script>
</body>
</html>