| Current Path : /var/www/html/mmishra/mm/ada/icdp/ |
| Current File : /var/www/html/mmishra/mm/ada/icdp/websites.php |
<?php
checkadmin($user);
?>
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
$rowid = $_REQUEST['rowid'];
$webid = $_SESSION['webid'];
$title = $_POST['title'];
//if (isset($_POST["userfile"])) upload();
$logo = "/$webid/images/logo1.jpg";
$author = $_POST['author'];
$contact = $_POST['contact'];
$description = $_POST['description'];
$keywords = $_POST['keywords'];
if (!$keywords) $keywords = $title . ',' . $author;
//$footer = quotemeta($_POST['footer']);
$footer = $_POST['footer'];
$status = $_POST['status'];
$bgcolor = $_POST['bgcolor'];
$submit = $_POST['submit'];
$tbl = 'websites';
$statuss = array('online','offline');
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',
author='$author',contact='$contact',description='$description',keywords='$keywords',footer='$footer',
status='$status',bgcolor='$bgcolor',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');
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)
values('$webid','$title','$logo','$author','$contact','$description','$keywords','$footer',
now(),now(),now(),'online','$bgcolor')");
}
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;
$author = $o->author;
$contact = $o->contact;
$description = $o->description;
$keywords = $o->keywords;
$footer = $o->footer;
$status = $o->status;
$bgcolor = $o->bgcolor;
}
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>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 (Appears in the banner)<br>
<input type='text' name='logo' size='60' value='$logo'>
</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>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>
<tr><th>
<input type='submit' name='submit' value='SAVE' style='width: 80px'> ";
if ($rowid > 0) echo "<input type='submit' name='submit' value='DELETE' style='width: 80px'>";
echo "</th></tr>
</table>
</center>";
?>