MMCT TEAM
Server IP : 103.53.40.154  /  Your IP : 3.141.47.163
Web Server : Apache
System : Linux md-in-35.webhostbox.net 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64
User : ppcad7no ( 715)
PHP Version : 8.2.25
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0755) :  /home2/ppcad7no/emogli.com/../natureamrit.com/includes/../admin/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home2/ppcad7no/emogli.com/../natureamrit.com/includes/../admin/add_edit_team_member.php
<?php
require_once("../includes/dbsmain.inc.php");
ob_start();
$team_id=$_REQUEST['team_id'];
if(is_post_back()) {
if(!empty($team_id)){
$category_url=ami_crete_url($team_member_name);	
	////////////****************** IMAGE RESIZING START HERE *****************************//
//********** Code Created By Amitabh Kumar Sinha : Web Developer : Webkey Network Pvt. Ltd. *****************//
//**********  DATE : 31:07:2014 *****************//
//------------FUNCTION TO GET IMAGE EXTENSION START---------------//
 function getExtension($str) {
         $i = strrpos($str,".");
         if (!$i) { return ""; }
         $l = strlen($str) - $i;
         $ext = substr($str,$i+1,$l);
         return $ext;
 }
 //------------FUNCTION TO GET IMAGE EXTENSION END---------------//
 if($_SERVER["REQUEST_METHOD"] == "POST")
 {
 	$image =$_FILES["file"]["name"];
	$uploadedfile = $_FILES['file']['tmp_name']; 
 	if ($image){ 	
	    $DelImage=db_scalar("select team_member_image from tbl_our_team where 1 and team_member_id = '$team_id'");
	    @unlink("../team_images/$DelImage");
 		$filename = stripslashes($_FILES['file']['name']); 	
  		$extension = getExtension($filename);
 		$extension = strtolower($extension);		
		$imgNAME = $category_url.".".$extension;

move_uploaded_file($_FILES['file']['tmp_name'],"../team_images/$imgNAME");
}else{
$imgNAME=db_scalar("select team_member_image from tbl_our_team where 1 and team_member_id = '$team_id' ");
}

}

////////////****************** IMAGE RESIZING END HERE *****************************//
	
	
$editsql="update tbl_our_team set 
			team_member_name='$team_member_name',
			team_member_image='$imgNAME',
			team_member_designation='$team_member_designation',
			team_member_status='$team_member_status',
			team_member_qualification='$team_member_qualification'
			where team_member_id='$_REQUEST[team_id]' ";
			db_query($editsql);
			set_session_msg("Team Member Updated Successfully !");
			header("location:manage_our_team.php");	
			exit;		
}else{
$category_url=ami_crete_url($team_member_name);
	////////////****************** IMAGE RESIZING START HERE *****************************//
//********** Code Created By Amitabh Kumar Sinha : Web Developer : Webkey Network Pvt. Ltd. *****************//
//**********  DATE : 31:07:2014 *****************//
//------------FUNCTION TO GET IMAGE EXTENSION START---------------//
 function getExtension($str) {
         $i = strrpos($str,".");
         if (!$i) { return ""; }
         $l = strlen($str) - $i;
         $ext = substr($str,$i+1,$l);
         return $ext;
 }
 //------------FUNCTION TO GET IMAGE EXTENSION END---------------//
 if($_SERVER["REQUEST_METHOD"] == "POST")
 {
 	$image =$_FILES["file"]["name"];
	$uploadedfile = $_FILES['file']['tmp_name']; 
 	if ($image) { 	
	    $DelImage=db_scalar("select team_member_image from tbl_our_team where 1 and team_member_id = '$team_id'");
	    @unlink("../team_images/$DelImage");
 		$filename = stripslashes($_FILES['file']['name']); 	
  		$extension = getExtension($filename);
 		$extension = strtolower($extension);		
		$imgNAME = $category_url.".".$extension;

move_uploaded_file($_FILES['file']['tmp_name'],"../team_images/$imgNAME");
}
}

////////////****************** IMAGE RESIZING END HERE *****************************//
$testsql="insert into tbl_our_team set 
			team_member_name='$team_member_name',
			team_member_image='$imgNAME',
			team_member_designation='$team_member_designation',
			team_member_qualification='$team_member_qualification',
			team_member_status='$team_member_status',
			team_member_add_date=now()";
			db_query($testsql);
			set_session_msg("Team Member Added Successfully !");
			header("location:manage_our_team.php");	
			exit;		
    }
}
if($team_id!='') {
	$result = db_query("select * from tbl_our_team where team_member_id = '$team_id'");
	if ($line_raw = mysqli_fetch_array($result)) {
	 @extract($line_raw);
	}
}
?>
<script src="ckeditor/ckeditor.js"></script>
<style>
p.fck {
    width: 90%;
	float:left;
    margin: 0 auto;
 }
</style>
<link href="styles.css" rel="stylesheet" type="text/css">
<?php include("top.inc.php");?>
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td id="pageHead"><div id="txtPageHead">Add/Edit Member</div></td>
              </tr>
            </table>
            <div align="right"><a href="manage_testimonials.php" style="font-size:12px; font-weight:bold; margin-right:15px;">Back to Team Member List</a>&nbsp;</div>
            <form name="form1" method="post" enctype="multipart/form-data">
              <table width="95%"  border="0" align="center" cellpadding="0" cellspacing="0" class="tableForm">
                <tr>
                  <td width="20%" class="tdLabel">&nbsp;</td>
                  <td width="80%" class="tdData" style="padding-left:7px;"><strong><font color="red">
                    <?=display_sess_msg();?>
                    </font></strong></td>
                </tr>
                <tr>
                  <td width="20%" class="tdLabel" style="font-size:12px; padding:7px;">Team Member Name</td>
                  <td width="80%" class="tdData" style="font-size:12px; padding:7px;"><input name="team_member_name" style="width:350px; height:28px;" type="text" id="team_member_name"  value="<?=$team_member_name?>" class="textfield"  ></td>
                </tr>  
                <tr>
                  <td width="20%" class="tdLabel" style="font-size:12px; padding:7px;">Team Member Designation</td>
                  <td width="80%" class="tdData" style="font-size:12px; padding:7px;"><input name="team_member_designation" style="width:350px; height:28px;" type="text" id="team_member_designation"  value="<?=$team_member_designation?>" class="textfield"  ></td>
                </tr> 
                
                <tr>
                  <td width="20%" class="tdLabel" style="font-size:12px; padding:7px;">Team Member Qualification</td>
                  <td width="80%" class="tdData" style="font-size:12px; padding:7px;"><input name="team_member_qualification" style="width:350px; height:28px;" type="text" id="team_member_qualification"  value="<?=$team_member_qualification?>" class="textfield"  ></td>
                </tr> 
                
                 <?php if($team_member_image){ ?>
                <tr>
                  <td width="177" class="tdLabel" style="font-size:12px; padding:5px;">Current Image  :</td>
                  <td width="721" class="tdData" style="font-size:12px; padding:5px;"><img src="../team_images/<?=$team_member_image?>" height="70" width="70"  border="0"> </td>
                </tr>
                <? } ?>
                <tr>
                  <td class="tdLabel" style="font-size:12px; padding:5px;">Team Member Image :</td>
                  <td class="tdData" style="font-size:12px; padding:5px;"><input type="file" name="file" id="file"></td>
                </tr>                             
               			
               <!-- <tr>
                  <td class="tdLabel" style="font-size:12px; padding:7px;">Description:</td>
                  <td class="tdData" style="font-size:12px; padding:7px;"><p class="fck">
                      <textarea cols="80" id="editor1" name="test_description" rows="10"><?=$test_description?>
</textarea>
                      <script>

			// Replace the <textarea id="editor"> with an CKEditor
			// instance, using default configurations.
			CKEDITOR.replace( 'editor1', {
				uiColor: '#ACACAC',
				toolbar: [
					[ 'Bold', 'Italic', '-', 'NumberedList', 'BulletedList', '-', 'Link', 'Unlink' ],
					[ 'FontSize', 'TextColor', 'BGColor' ]
				]
			});

		</script>
                    </p></td>
                </tr>-->
                
                <tr>
                  <td class="tdLabel" style="font-size:12px; padding:7px;">Status:</td>
                  <td class="tdData" style="font-size:12px; padding:7px;"><select name="team_member_status" style="width:200px; height:26px;">
                      <option value="Active" <?php if($team_member_status=='Active'){ ?> selected="selected" <? } ?>>Active</option>
                      <option value="Inactive" <?php if($team_member_status=='Inactive'){ ?> selected="selected" <? } ?>>Inactive</option>
                    </select></td>
                </tr>
                <tr>
                  <td class="tdLabel" style="font-size:12px; padding:7px;">&nbsp;</td>
                  <td class="tdData" style="font-size:12px; padding:7px;">
                    <input type="image" name="imageField" src="images/buttons/submit.gif" style="width:100px; margin-bottom:25px;" /></td>
                </tr>
              </table>
            </form>
            <?php include("bottom.inc.php");?>

MMCT - 2023