<?php
session_start();
 if(!($_SESSION['log'])){
	  header("Location:index.php");
	  }  
  	 include('includes/php/dbconnection.php');
	 
	

?>
<script language="javascript" type="text/javascript">
function mailcontent()
{
	var type = document.getElementById('type').value;
	window.location = "cmspages.php?type="+type;
}
</script>
	
	
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title><?php echo $page_title;?></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="includes/css/style.css" rel="stylesheet" type="text/css">
<script language="JavaScript">
</script>
<link href="includes/php/style.css" rel="stylesheet" type="text/css">
<link href="includes/css/main.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style1 {color: #999999}
.style3 {color: #2788BF; }
-->
</style>
</head>
<body topmargin="0" bottommargin="0">
<table width="80%" height="100%" border="0" align="center" cellpadding="0" cellspacing="0"  class="border-leftt">
  <tr> 
    <td height="10" colspan="2"><?php include('includes/php/top.php'); ?></td>
  </tr>
  <tr> 
   <td width="25%" valign="top" align="center"  bgcolor="#F2F2F4" style="padding-top:10px" class="cat_repeat"><?php include("includes/php/left_new.php");?></td>
    <td width="75%"  valign="top" class="border-right">
<form name="form1" method="post" action="process.php">
  <table width="96%" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr>
      <td width="100%" colspan="2">&nbsp;</td>
    </tr>
    <tr>
      <td colspan="2" class="heading-nml">&nbsp;&nbsp;Add New SMS Page </td>
    </tr>
    <tr>
      <td class="err-mesage"><?php echo $_SESSION['msg']; unset($_SESSION['msg']);?></td>
      <td align="right">&nbsp;</td>
    </tr>
    <tr><td colspan="2" align="center" class="err-mesage"><table width="100%" border="0" align="center" cellpadding="1" cellspacing="1" bordercolor="#EDA846" bgcolor="">
          <tr class="">
            <td>
			
			
		<input type="hidden" name="savepage" value="<?php echo $type; ?>" />	
			
			
			<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
				
                <tr class="cpHeading" bgcolor="#618e20">
                  <td width="18%" height="23"   style="padding-left: 5px; color:#FFFFFF;" bgcolor="#2788BF">&nbsp;</td>
				  <td width="19%"   style="padding-left: 5px; color:#FFFFFF;" bgcolor="#2788BF">&nbsp;</td>
				  <td width="18%"   style="padding-left: 5px; color:#FFFFFF;" bgcolor="#2788BF">&nbsp;</td>
				  <td width="19%"   style="padding-left: 5px; color:#FFFFFF;" bgcolor="#2788BF">&nbsp;</td>
				  <td width="26%" bgcolor="#2788BF" style="color:#FFFFFF;">&nbsp;</td>
                </tr>
                
				
                
				<tr >
                  <td height="35" class="welcome-text" style="padding-left: 5px;">Select Parent </td>
                  <td height="35" class="welcome-text" style="padding-left: 5px;">
                    <select name="parent_id" id="parent_id" class="txt_admin">
				   <option value="0">Choose One</option>
				   <?php
				   $tabsql="select * from cmspages where `type`='tabs' and parent_id='0'";
			  $select_results=mysql_query($tabsql);
			 
			//////////////child tab While loop///////////////   
			   while($parent_tab_row=mysql_fetch_array($select_results))
			   {
				  ?>
				 <option value="<?php echo $parent_tab_row['page_id'];?>"><?php echo $parent_tab_row['page_name'];?></option>

                    
<?php }?>
                          </select></td>
                  <td height="35" class="welcome-text" style="padding-left: 5px;">&nbsp;</td>
                  <td height="35" class="welcome-text" style="padding-left: 5px;">&nbsp;</td>
                  <td class="welcome-text" style="padding-left: 10px;">&nbsp;</td>
                </tr>
				<tr >
                  <td height="35" class="welcome-text" style="padding-left: 5px;">Page Name </td>
                  <td height="35" class="welcome-text" style="padding-left: 5px;">
                    <input name="page_name" type="text" id="page_name"></td>
                  <td height="35" class="welcome-text" style="padding-left: 5px;">&nbsp;</td>
                  <td height="35" class="welcome-text" style="padding-left: 5px;">&nbsp;</td>
                  <td class="welcome-text" style="padding-left: 10px;">&nbsp;</td>
                </tr>
				
				<tr >
                  <td height="35" class="welcome-text" style="padding-left: 5px;">Page Heading </td>
                  <td height="35" class="welcome-text" style="padding-left: 5px;">
                    <input name="page_heading" type="text" id="page_heading"></td>
                  <td height="35" class="welcome-text" style="padding-left: 5px;">&nbsp;</td>
                  <td height="35" class="welcome-text" style="padding-left: 5px;">&nbsp;</td>
                  <td class="welcome-text" style="padding-left: 10px;">&nbsp;</td>
                </tr>
				<tr>
                  <td height="35" class="welcome-text" style="padding-left: 5px;">Page Type </td>
                  <td height="35" class="welcome-text" style="padding-left: 5px;">
				  
				<select class="normal" name="type" id="type">
				   <option value="tabs">Tabs</option>
			       <option value="other">footer</option>
				   <option value="other">Other</option>
			   </select></td>
                  <td height="35" class="welcome-text" style="padding-left: 5px;">&nbsp;</td>
                  <td height="35" class="welcome-text" style="padding-left: 5px;">&nbsp;</td>
                  <td class="welcome-text" style="padding-left: 10px;">&nbsp;</td>
                </tr>
				<tr >
                  <td height="35" class="welcome-text" style="padding-left: 5px;">Page Status</td>
                  <td height="35" class="welcome-text" style="padding-left: 5px;">
                    <input name="status" type="checkbox" <?php if($row['status']==1){?> checked="checked"<?php }?>  value="1">
                 </td>
                  <td height="35" class="welcome-text" style="padding-left: 5px;">&nbsp;</td>
                  <td height="35" class="welcome-text" style="padding-left: 5px;">&nbsp;</td>
                  <td class="welcome-text" style="padding-left: 10px;">&nbsp;</td>
                </tr>
				
				<tr>
                  <td height="1" colspan="8"><?php 
		include("FCKeditor/fckeditor.php");
		$oFCKeditor = new FCKeditor('txtData');
		$oFCKeditor->BasePath = "FCKeditor/";
		//$oFCKeditor->Config['SkinPath'] = $ru.$fckpath.'editor/skins/silver/';
		$oFCKeditor->Width		= '100%' ;
		$oFCKeditor->Height		= '500' ;
		$oFCKeditor->Value = $htmlData;
		$oFCKeditor->Create();
		?></td>
                </tr>
				<tr>
                  <td height="1">&nbsp;</td>
                  <td height="1">&nbsp;</td>
                  <td height="1">&nbsp;</td>
                  <td height="1">&nbsp;</td>
                  <td height="1" colspan="4">&nbsp;</td>
                  </tr>
				
				<tr>
                  <td height="1" colspan="8" bgcolor="#dfd4d0">&nbsp;</td>
                </tr>
            </table></td>
          </tr>
      </table>
	  </td>
    <tr>
      <td colspan="2" align="left">
	  <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" bordercolor="#EDA846">
          <tr>
            <td height="18" colspan="5" align="center"><input type="submit" name="SaveTextData" value="Save"></td>
          </tr>
      </table></td>
    </tr>
  </table>
</form>
    </td>
  </tr>
  <tr> 
    <td height="10" colspan="2"><?php include('includes/php/bottom.php'); ?></td>
  </tr>
</table>
</body>
</html>
