Your IP : 216.73.216.40


Current Path : /var/www/html/mmishra/indem/Parisarnews/
Upload File :
Current File : /var/www/html/mmishra/indem/Parisarnews/websites.php

<?php
checkAdmin($webid, $user, $role);
?>
Create/update website on this delivery platform. 
Familiarity with HTML tags is must for web authoring. 
Website can be put online/offline by setting status attribute. <br><br>
<?php
if ($role == 'admin') {
	$rowid = $_REQUEST['rowid'];
	$webid = $_SESSION['webid'];
	$title = $_POST['title'];
	$title_hindi = $_POST['title_hindi'];

	//if (isset($_POST["userfile"])) upload();
	$logo = $_POST["logo"];
	$banner = $_POST["banner"];
	$author = $_POST['author'];
	$contact = $_POST['contact'];
	$description = $_POST['description'];
	$keywords = $_POST['keywords'];
	if (!$keywords) $keywords = $title . ',' . $author;
	$footer = $_POST['footer'];
	$status = $_POST['status'];
	$bgcolor = 'white';$_POST['bgcolor'];
	$features = $_POST['features'];
	foreach ($features as $ft) {
		$feature .= $ft.',';
	}


	$submit = $_POST['submit'];

	$tbl = 'websites';

	switch ($submit) {
	case "SAVE":
        	if (mysql_num_rows(mysql_query("select * from $tbl where rowid=$rowid"))) {
                	mysql_query("update $tbl set webid='$webid',title='$title',logo='$logo',banner='$banner',
			author='$author',contact='$contact',description='$description',keywords='$keywords',footer='$footer',
			status='$status',bgcolor='$bgcolor',features='$feature',dateupdation=now() where rowid=$rowid");
                	//mysql_query("update webpages set webid='".$_POST["webid"]."' where webid='$webid'");
                	//mysql_query("update webusers set webid='".$_POST["webid"]."' where webid='$webid'");
                	//mysql_query("update metadata set webid='".$_POST["webid"]."' where webid='$webid'");
                	//mysql_query("update accesslogs set webid='".$_POST["webid"]."' where webid='$webid'");
        		//$_SESSION["webid"] = $_POST["webid"];
		
        	} else {
			$agPath = absolutePath($webid,'gallery');
			$adPath = absolutePath($webid,'documents');
			$aiPath = absolutePath($webid,'images');
			$amPath = absolutePath($webid,'multimedia');
			shell_exec("mkdir $agPath $adPath $aiPath $webid");
                	mysql_query("insert into $tbl
			(webid,title,logo,author,contact,description,keywords,footer,
			datecreation,dateupdation,dateaccess,status,bgcolor,features) 
			values('$webid','$title','$logo','$author','$contact','$description','$keywords','$footer',
			now(),now(),now(),'online','$bgcolor','$feature')");
        	}
        	break;

	case "DELETE":
        	mysql_query("delete from $tbl where rowid=$rowid");
		$rowid = 0;
        	break;
	}

	$rs = mysql_query("select * from $tbl where webid='$webid'");
	while ($o = mysql_fetch_object($rs)) {
		$rowid = $o->rowid;
		$title = $o->title;
		$logo = $o->logo;
		$banner = $o->banner;
		$author = $o->author;
		$contact = $o->contact;
        	$description = $o->description;
        	$keywords = $o->keywords;
        	$footer = $o->footer;
        	$status = $o->status;
        	$bgcolor = $o->bgcolor;
        	$features = $o->features;
	}
	echo "<center>
	<table>
	<tr bgcolor='silver' height='40'><td>WebID (URL to access this website)<br>
	<input type='hidden' name='rowid' value='$rowid'>
	<input type='text' name='webid' size='60' value='$webid' readonly>
	</td></tr>
	<tr><td>Org. Title (Appears at title bar of browser and in the banner)<br>
	<input type='text' name='title' size='60' value='$title'>
	</td></tr>
	<tr><td>Logo File (Appears in the banner)<br>
	<input type='text' name='logo' size='60' value='$logo'>
	</td></tr>
	<tr><td>Banner File (Appears at top of each page)<br>
	<input type='text' name='banner' size='60' value='$banner'>
	</td></tr>
	<tr><td>Author (Appears at homepage of this website)<br>
	<input type='text' name='author' size='60' value='$author'>
	</td></tr>
	<tr valign='top'><td>Contact (Appears in the banner)<br>
	<textarea name='contact' style='width: 100%'>$contact</textarea>
	</td></tr>
	<tr valign='top'><td>Description (Useful for search engines)<br>
	<textarea name='description' style='width: 100%'>$description</textarea>
	</td></tr>
	<tr valign='top'><td>Keywords (Useful for content indexing)<br>
	<input type='text' name='keywords' size='60' value='$keywords'>
	</td></tr>
	<tr valign='top'><td>Footer (Appears at bottom of each webpage)<br>
	<textarea name='footer' style='width: 100%'>$footer</textarea>
	</td></tr>

	<tr><td>Status (Offline site will not be accessible)<br>
	<select name='status' style='width: 200px'>";
	foreach ($statuss as $st) {
        	echo "<option value='$st'";
        	if ($status == $st) echo ' selected';
        	echo ">$st</option>";
	}
	echo "</select>
	</td></tr>
	<tr><td>Features (Links on page bootom)<br>
	<select name='features[]' multiple='multiple' size='5' style='width: 200px'>";
	foreach ($featuress as $ft) {
        	echo "<option value='$ft'";
        	if (stripos($features, $ft) !== FALSE) echo ' selected';
        	echo ">$ft</option>";
	}
	echo "</select>
	</td></tr>";
	/*
	echo "<tr><td>Background<br>
	<input type='text' name='bgcolor' size='20' value='$bgcolor'>
	<dir>
	<object classid='clsid:D27CDB6E-AE6D-11CF-96B8-444553540000' id='obj1'
	codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0'
	border='0' width='380' height='380'>
	<param name='movie' value='http://www.2createawebsite.com/build/color.swf'>
	<param name='quality' value='High'>
	<embed src='http://www.2createawebsite.com/build/color.swf' pluginspage='http://www.macromedia.com/go/getflashplayer'
	type='application/x-shockwave-flash' name='obj1' width='385' height='385' quality='High'>
	</object>
	</dir>
	</td></tr>";
	*/
	echo "<tr><th>
	<input type='submit' name='submit' value='SAVE' style='width: 80px'> ";
	if ($rowid) echo "<input type='submit' name='submit' value='DELETE' style='width: 80px'>";
	echo "</th></tr>
	</table>
	</center>";
} else
	echo "<h3>Access permission denied</h3>";
?>