Preview: exam_board_view.php
Size: 5.24 KB
/home/jambtst2015/public_html/giraffeng.com/admin/exam_board_view.php
<?php include("includes/head.php"); ?>
<?php include("includes/header.php"); ?>
<?php
/*---For Add---*/
$exam_board_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 `exam_board_master` where `name`='".$_POST['title']."' and id != '".$exam_board_id."'";
$chkqry = mysql_query($chksql);
$getRow = mysql_num_rows($chkqry);
/*----end username check-*/
if($getRow > 0){
$error = 'This Name already exists.';
}
else{
if($_POST['name'] == ''){
$error = 'Please enter Title.';
}
else{
$insSql = "update `exam_board_master` set ";
$insSql .= "name='".mysql_real_escape_string($_POST['name'])."', ";
$insSql .= "no_of_subject='".mysql_real_escape_string($_POST['no_of_subject'])."', ";
$insSql .= "full_name='".mysql_real_escape_string($_POST['full_name'])."', ";
if($_FILES['filename']['name']!=''){
$insSql .= "logo='".mysql_real_escape_string($dest_subscription_form)."', ";
}
$insSql .= "status='".$_POST['status']."', ";
$insSql .= "modify_date=now() where id = '".$exam_board_id."' ";
//echo $insSql;exit;
mysql_query($insSql);
//include("mailuser.php");
header('location:exam_board.php?success=2&page='.$_REQUEST['page'].'');
exit();
}
}
}
else{
$_POST['name']='';
}
/*---End Add---*/
?>
<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 exam_board_master WHERE id = '".$exam_board_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 Form
</p>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="center-tbl new-tbl">
<tr>
<td align="right" valign="top" class="left_head_form">*Name</td>
<td><input name="name" type="title" class="validate[required] textfield require_field" value="<?php echo $sql_data['name']; ?>"/></td>
</tr>
<tr>
<td align="right" valign="top" class="left_head_form">*Full Name</td>
<td><input name="full_name" type="title" class="validate[required] textfield require_field" value="<?php echo $sql_data['full_name']; ?>"/></td>
</tr>
<tr>
<td align="right" valign="top" class="left_head_form">*No Of Subject</td>
<td><input name="no_of_subject" type="title" class="validate[required] textfield require_field" value="<?php echo $sql_data['no_of_subject']; ?>"/></td>
</tr>
<tr>
<td width="39%" align="right" valign="top" class="left_head_form">*Upload Logo</td>
<td width="61%"><input name="filename" id="filename" type="file" class="textfield require_field" />
<?php if($sql_data['logo']!=''){ ?>
<img src="upload_file/<?=$sql_data['logo']?>" class="upld" width='100'>
<?php } ?>
</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>
<?php include("includes/footer.php"); ?>
Directory Contents
Dirs: 17 × Files: 180