forked from vrexperts/jwasser
/
edit.php
39 lines (32 loc) · 1.24 KB
/
edit.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php include("includes/application-top.php");
$dbObj = new DB();
$dbObj->fun_db_connect();
if(count($_POST)>0){
$arr=$_POST;
$image_info = getimagesize($_FILES["images"]["tmp_name"]);
$image_width = $image_info[0];
$image_height = $image_info[1];
if($_FILES['images']['name']!=''){
if($image_width>=400 && $image_height>=300)
{
$randnum = rand();
$str = str_replace(' ','_',$_FILES['images']['name']);
$Small_logo_ImgFName ="user/user_".$str;
$image = new SimpleImage();
$image->load($_FILES['images']['tmp_name']);
$image->resize(400,300);
$image->save($Small_logo_ImgFName);
$arr['images']= "user/user_".$str;
}
else
{
$_SESSION['msg']="Images Size To small";
redirectURL(SITE_ADMIN_URL."profile-edit.php");
}
}
$lastID = $dbObj->update_data(TABLE_USERS,'id',$arr,md5($_POST['id']));
if($lastID){$_SESSION['msg']="<span style=' color:green;font-size:13px;'>User Updated</span>";}
if($_REQUEST['action']=='edit'){redirectURL(SITE_ADMIN_URL."profile-edit.php?action=edit&id=".$_REQUEST['id']);}
else {redirectURL(SITE_ADMIN_URL."profile.php");}
}
?>