Preview: cms_edit.php
Size: 17.28 KB
/home/jambtst2015/public_html/giraffeng.com/admin/cms_edit.php
<?php include("includes/head.php"); ?>
<?php include("includes/header.php"); ?>
<script src="ckeditor/ckeditor.js"></script>
<?php
/*---For Add---*/
$cms_id = $_REQUEST['id'];
if(empty($_POST['submit'])){ $_POST['submit']=''; }
if($_POST['submit'] == 'Save'){
/*include("image_file.php");
if($_FILES['filename']['name']!='')
{
$src_subscription_form=$_FILES['filename']['tmp_name'];
$dest_subscription_form=time().$_FILES['filename']['name'];
$dest_subscription_form1="upload_file/".$dest_subscription_form;
//exit;
copy($src_subscription_form,$dest_subscription_form1);
}
*/
/*----check username----*/
$chksql = "select `id` from `contents` where `title`='".$_POST['title']."'";
$chkqry = mysql_query($chksql);
$getRow = mysql_num_rows($chkqry);
/*----end username check-*/
//else{
if($_POST['title'] == ''){
$error = 'Please enter title.';
}
else
{
$insSql = "update `contents` set ";
$insSql .= "title='".mysql_real_escape_string($_POST['title'])."', ";
$insSql .= "meta_title='".mysql_real_escape_string($_POST['meta_title'])."', ";
$insSql .= "meta_keywords='".mysql_real_escape_string($_POST['meta_keywords'])."', ";
$insSql .= "meta_description='".mysql_real_escape_string($_POST['meta_description'])."', ";
//$insSql .= "url='".mysql_real_escape_string($_POST['url'])."', ";
$insSql .= "content='".mysql_real_escape_string($_POST['bodyar11'])."', ";
$insSql .= "status='".$_POST['status']."', ";
$insSql .= "modified_date=now() where id = '".$cms_id."' ";
//echo $insSql;exit;
mysql_query($insSql);
//include("mailuser.php");
header('location:cmslist.php?success=2&page='.$_REQUEST['page'].'');
exit();
}
//}
}
else{
$_POST['name']='';
}
/*---End Add---*/
?>
<script>
function formSub(){
//alert(11111111);
document.formID.submit();
return true;
}
jQuery.noConflict();
(function($) {jQuery(document).ready(function(){
// binds form submission and fields to the validation engine
jQuery("#formID").validationEngine('attach', {
onValidationComplete: function(form, status){
//alert("The form status is: " +status+", it will never submit");
if(status == true){
//$('input[type="submit"]').attr('disabled','disabled');
return formSub();
}
}
});
});})(jQuery);
</script>
<div class="container_bottom_section tbl_cls_new">
<form name="formID" action="" method="post" id="formID" enctype="multipart/form-data">
<?php
$sql_data = mysql_fetch_array(mysql_query("SELECT * FROM contents WHERE id = '".$cms_id."'"));
?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<?php if(empty($error)){$error='';}
if($error!=''){
?>
<tr>
<td colspan="5">
<div class="error"><?php echo $error; ?></div>
</td>
</tr>
<?php } ?>
<tr>
<td valign="top">
<div class="tbl-out">
<p class="client_table">
<i class="fa fa-edit"></i> Edit Cms Page
</p>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="center-tbl new-tbl" style="width:100% !important">
<tr>
<td align="right" valign="top" class="left_head_form">*Title</td>
<td><input name="title" type="title" class="validate[required] textfield require_field" value="<?php echo $sql_data['title']; ?>"/></td>
</tr>
<tr>
<td align="right" valign="top" class="left_head_form">*Meta Title</td>
<td><input name="meta_title" type="title" class="validate[required] textfield require_field" value="<?php echo $sql_data['meta_title']; ?>"/></td>
</tr>
<tr>
<td align="right" valign="top" class="left_head_form">*Meta Keywords</td>
<td><input name="meta_keywords" type="title" class="validate[required] textfield require_field" value="<?php echo $sql_data['meta_keywords']; ?>"/></td>
</tr>
<tr>
<td align="right" valign="top" class="left_head_form">*Meta Description</td>
<td><input name="meta_description" type="title" class="validate[required] textfield require_field" value="<?php echo $sql_data['meta_description']; ?>"/></td>
</tr>
<tr>
<td align="right" valign="top" class="left_head_form">*Body Content</td>
<td>
<textarea class="ckeditor" cols="180" id="editor1"name="bodyar11"><?php echo htmlspecialchars_decode(stripslashes($sql_data['content'])); ?></textarea>
</td>
</tr>
<tr>
<td align="right" valign="top" class="left_head_form">Status</td>
<td><select name="status" class="selectfield require_select">
<option value="Active" <?php if($sql_data['status']=='Active') { ?>selected="selected"<?php } ?>>Active</option>
<option value="Inactive" <?php if($sql_data['status']=='Inactive') { ?>selected="selected"<?php } ?>>Inactive</option>
</select></td>
</tr>
</table>
</div>
</td>
</tr>
</table>
</td>
<td width="2%" valign="top"> </td>
<td width="34%" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="5" align="center">
<input name="submit" type="submit" value="Save" class="require float-none org" style=" margin-bottom:10px;" onclick="return Checkfiles();" />
<input type="button" name="back" id="back" class="require float-none" value="Cancel" style=" margin-bottom:10px;" onclick="window.history.back();" />
</td>
</tr>
</table>
</td>
</tr>
</table>
</form>
<div class="clear"></div>
</div>
<script type="text/javascript" src="js/tinymce/tinymce.min.js"></script>
<script type="text/javascript">
tinymce.init({
selector: "#bodyar11",
height : 225,
width : 750,
plugins: [
"advlist autolink autosave link image lists charmap print preview hr anchor pagebreak spellchecker",
"searchreplace wordcount visualblocks visualchars code fullscreen insertdatetime media nonbreaking",
"table contextmenu directionality emoticons template textcolor paste fullpage textcolor"
],
toolbar1: "newdocument fullpage | bold italic underline strikethrough | alignleft aligncenter alignright alignjustify | styleselect formatselect fontselect fontsizeselect | link image jbimages",
toolbar2: "cut copy paste | searchreplace | bullist numlist | outdent indent blockquote | undo redo | link unlink anchor image media code | inserttime preview | forecolor backcolor",
toolbar3: "table | hr removeformat | subscript superscript | charmap emoticons | print fullscreen | ltr rtl | spellchecker | visualchars visualblocks nonbreaking template pagebreak restoredraft",
menubar: false,
toolbar_items_size: 'small',
//relative_urls: false,
relative_urls : false,
remove_script_host : false,
convert_urls : true,
//document_base_url: 'http://www.insurancemall2.com/india/',
style_formats: [
{title: 'Bold text', inline: 'b'},
{title: 'Red text', inline: 'span', styles: {color: '#ff0000'}},
{title: 'Red header', block: 'h1', styles: {color: '#ff0000'}},
{title: 'Example 1', inline: 'span', classes: 'example1'},
{title: 'Example 2', inline: 'span', classes: 'example2'},
{title: 'Table styles'},
{title: 'Table row 1', selector: 'tr', classes: 'tablerow1'}
],
templates: [
{title: 'Test template 1', content: 'Test 1'},
{title: 'Test template 2', content: 'Test 2'}
]
});
</script>
<script type="text/javascript">
tinymce.init({
selector: "#bodytime",
height : 225,
width : 750,
plugins: [
"advlist autolink autosave link image lists charmap print preview hr anchor pagebreak spellchecker",
"searchreplace wordcount visualblocks visualchars code fullscreen insertdatetime media nonbreaking",
"table contextmenu directionality emoticons template textcolor paste fullpage textcolor"
],
toolbar1: "newdocument fullpage | bold italic underline strikethrough | alignleft aligncenter alignright alignjustify | styleselect formatselect fontselect fontsizeselect",
toolbar2: "cut copy paste | searchreplace | bullist numlist | outdent indent blockquote | undo redo | link unlink anchor image media code | inserttime preview | forecolor backcolor",
toolbar3: "table | hr removeformat | subscript superscript | charmap emoticons | print fullscreen | ltr rtl | spellchecker | visualchars visualblocks nonbreaking template pagebreak restoredraft",
menubar: false,
toolbar_items_size: 'small',
//relative_urls: false,
relative_urls : false,
remove_script_host : false,
convert_urls : true,
//document_base_url: 'http://www.insurancemall2.com/india/',
style_formats: [
{title: 'Bold text', inline: 'b'},
{title: 'Red text', inline: 'span', styles: {color: '#ff0000'}},
{title: 'Red header', block: 'h1', styles: {color: '#ff0000'}},
{title: 'Example 1', inline: 'span', classes: 'example1'},
{title: 'Example 2', inline: 'span', classes: 'example2'},
{title: 'Table styles'},
{title: 'Table row 1', selector: 'tr', classes: 'tablerow1'}
],
templates: [
{title: 'Test template 1', content: 'Test 1'},
{title: 'Test template 2', content: 'Test 2'}
]
});
tinymce.init({
selector: "#body_project_ending",
height : 225,
width : 750,
plugins: [
"advlist autolink autosave link image lists charmap print preview hr anchor pagebreak spellchecker",
"searchreplace wordcount visualblocks visualchars code fullscreen insertdatetime media nonbreaking",
"table contextmenu directionality emoticons template textcolor paste fullpage textcolor"
],
toolbar1: "newdocument fullpage | bold italic underline strikethrough | alignleft aligncenter alignright alignjustify | styleselect formatselect fontselect fontsizeselect",
toolbar2: "cut copy paste | searchreplace | bullist numlist | outdent indent blockquote | undo redo | link unlink anchor image media code | inserttime preview | forecolor backcolor",
toolbar3: "table | hr removeformat | subscript superscript | charmap emoticons | print fullscreen | ltr rtl | spellchecker | visualchars visualblocks nonbreaking template pagebreak restoredraft",
menubar: false,
toolbar_items_size: 'small',
//relative_urls: false,
relative_urls : false,
remove_script_host : false,
convert_urls : true,
//document_base_url: 'http://www.insurancemall2.com/india/',
style_formats: [
{title: 'Bold text', inline: 'b'},
{title: 'Red text', inline: 'span', styles: {color: '#ff0000'}},
{title: 'Red header', block: 'h1', styles: {color: '#ff0000'}},
{title: 'Example 1', inline: 'span', classes: 'example1'},
{title: 'Example 2', inline: 'span', classes: 'example2'},
{title: 'Table styles'},
{title: 'Table row 1', selector: 'tr', classes: 'tablerow1'}
],
templates: [
{title: 'Test template 1', content: 'Test 1'},
{title: 'Test template 2', content: 'Test 2'}
]
});
tinymce.init({
selector: "#body_payroll",
height : 225,
width : 750,
plugins: [
"advlist autolink autosave link image lists charmap print preview hr anchor pagebreak spellchecker",
"searchreplace wordcount visualblocks visualchars code fullscreen insertdatetime media nonbreaking",
"table contextmenu directionality emoticons template textcolor paste fullpage textcolor"
],
toolbar1: "newdocument fullpage | bold italic underline strikethrough | alignleft aligncenter alignright alignjustify | styleselect formatselect fontselect fontsizeselect",
toolbar2: "cut copy paste | searchreplace | bullist numlist | outdent indent blockquote | undo redo | link unlink anchor image media code | inserttime preview | forecolor backcolor",
toolbar3: "table | hr removeformat | subscript superscript | charmap emoticons | print fullscreen | ltr rtl | spellchecker | visualchars visualblocks nonbreaking template pagebreak restoredraft",
menubar: false,
toolbar_items_size: 'small',
//relative_urls: false,
relative_urls : false,
remove_script_host : false,
convert_urls : true,
//document_base_url: 'http://www.insurancemall2.com/india/',
style_formats: [
{title: 'Bold text', inline: 'b'},
{title: 'Red text', inline: 'span', styles: {color: '#ff0000'}},
{title: 'Red header', block: 'h1', styles: {color: '#ff0000'}},
{title: 'Example 1', inline: 'span', classes: 'example1'},
{title: 'Example 2', inline: 'span', classes: 'example2'},
{title: 'Table styles'},
{title: 'Table row 1', selector: 'tr', classes: 'tablerow1'}
],
templates: [
{title: 'Test template 1', content: 'Test 1'},
{title: 'Test template 2', content: 'Test 2'}
]
});
tinymce.init({
selector: "#body_supplemental_timesheet",
height : 225,
width : 750,
plugins: [
"advlist autolink autosave link image lists charmap print preview hr anchor pagebreak spellchecker",
"searchreplace wordcount visualblocks visualchars code fullscreen insertdatetime media nonbreaking",
"table contextmenu directionality emoticons template textcolor paste fullpage textcolor"
],
toolbar1: "newdocument fullpage | bold italic underline strikethrough | alignleft aligncenter alignright alignjustify | styleselect formatselect fontselect fontsizeselect",
toolbar2: "cut copy paste | searchreplace | bullist numlist | outdent indent blockquote | undo redo | link unlink anchor image media code | inserttime preview | forecolor backcolor",
toolbar3: "table | hr removeformat | subscript superscript | charmap emoticons | print fullscreen | ltr rtl | spellchecker | visualchars visualblocks nonbreaking template pagebreak restoredraft",
menubar: false,
toolbar_items_size: 'small',
//relative_urls: false,
relative_urls : false,
remove_script_host : false,
convert_urls : true,
//document_base_url: 'http://www.insurancemall2.com/india/',
style_formats: [
{title: 'Bold text', inline: 'b'},
{title: 'Red text', inline: 'span', styles: {color: '#ff0000'}},
{title: 'Red header', block: 'h1', styles: {color: '#ff0000'}},
{title: 'Example 1', inline: 'span', classes: 'example1'},
{title: 'Example 2', inline: 'span', classes: 'example2'},
{title: 'Table styles'},
{title: 'Table row 1', selector: 'tr', classes: 'tablerow1'}
],
templates: [
{title: 'Test template 1', content: 'Test 1'},
{title: 'Test template 2', content: 'Test 2'}
]
});
tinymce.init({
selector: "#body_staff_edit",
height : 225,
width : 750,
plugins: [
"advlist autolink autosave link image lists charmap print preview hr anchor pagebreak spellchecker",
"searchreplace wordcount visualblocks visualchars code fullscreen insertdatetime media nonbreaking",
"table contextmenu directionality emoticons template textcolor paste fullpage textcolor"
],
toolbar1: "newdocument fullpage | bold italic underline strikethrough | alignleft aligncenter alignright alignjustify | styleselect formatselect fontselect fontsizeselect",
toolbar2: "cut copy paste | searchreplace | bullist numlist | outdent indent blockquote | undo redo | link unlink anchor image media code | inserttime preview | forecolor backcolor",
toolbar3: "table | hr removeformat | subscript superscript | charmap emoticons | print fullscreen | ltr rtl | spellchecker | visualchars visualblocks nonbreaking template pagebreak restoredraft",
menubar: false,
toolbar_items_size: 'small',
//relative_urls: false,
relative_urls : false,
remove_script_host : false,
convert_urls : true,
//document_base_url: 'http://www.insurancemall2.com/india/',
style_formats: [
{title: 'Bold text', inline: 'b'},
{title: 'Red text', inline: 'span', styles: {color: '#ff0000'}},
{title: 'Red header', block: 'h1', styles: {color: '#ff0000'}},
{title: 'Example 1', inline: 'span', classes: 'example1'},
{title: 'Example 2', inline: 'span', classes: 'example2'},
{title: 'Table styles'},
{title: 'Table row 1', selector: 'tr', classes: 'tablerow1'}
],
templates: [
{title: 'Test template 1', content: 'Test 1'},
{title: 'Test template 2', content: 'Test 2'}
]
});
</script>
<?php include("includes/footer.php"); ?>
Directory Contents
Dirs: 17 × Files: 180