| Server IP : 27.254.152.13 / Your IP : 216.73.217.38 Web Server : Apache/2 System : Linux ns1-252017.dragonhispeed.com 5.2.0 #1 SMP Fri Mar 29 22:50:14 MSK 2024 x86_64 User : coloflew ( 1072) PHP Version : 5.6.40 Disable Function : exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname MySQL : ON | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /home/coloflew/public_html/administrator/modules/dealer/ |
Upload File : |
<?php
$res = 0;
$linkurl = "index.php?name=gtchassis&file=picture&menu_id=".$_GET["menu_id"]."";
@$tableName = "menu";
@$tableNamePicture = "menu_picture";
@$getmenu = @$db->getOne(@$tableName,"*","menu_id='".@$_GET['menu_id']."'");
@$getfolder = @$getmenu["menu_name"];
if(@$_GET['act']=="add"){
//echo '<pre>';print_r($_POST);exit;
$timesave = time();
$lang = $db->getAll("language","*","","","");
if($lang){
foreach(@$_POST["fileName"] as $val => $key){
$arrData = array();
foreach($lang as $key => $value ){
$surfileexplode = explode(".",$val);
$surfilecount = count($surfileexplode);
$surfile=$surfileexplode[$surfilecount-1];
$surfile = strtolower($surfile);
$SCimage->load('uploads/'.@$val);
$SCimage->resizeToHeight(100);
$SCimage->save('../files/'.@$getfolder.'/small_'.$autoid.'_'.$timesave.'.'.$surfile);
$SCimage->resizeToHeight(414);
$SCimage->save('../files/'.@$getfolder.'/original_'.$autoid.'_'.$timesave.'.'.$surfile);
$SCimage->load('uploads/'.@$val);
$SCimage->save('../files/'.@$getfolder.'/large_'.$autoid.'_'.$timesave.'.'.$surfile);
@unlink("uploads/Crop_".@$val);;
@unlink("uploads/".@$val);
$arrData['menu_id'] = @$_GET['menu_id'];
$arrData['picture_title']= "";
$arrData['picture_name']= $autoid."_".$timesave.".".$surfile;
$arrData['picture_status']= "1";
$arrData['lang_code'] = $value['lang_code'];
foreach($arrData as $k => $v ){
$arrData[$k] = str_replace("'", "\'", $v);
}
//echo "<pre>"; print_r($arrData);
//exit;
$db->insertData(@$tableNamePicture,$arrData);
}
}
}
$msg = $lang_set['txtSaveComplete'];
$res = 1;
}elseif(@$_GET['act']=="del"){
$getdel = $db->getOne(@$tableNamePicture,"*","picture_id = '".$_GET["picture_id"]."'");
@unlink("../files/".@$getfolder."/small_".@$getdel["picture_name"]);
@unlink("../files/".@$getfolder."/original_".@$getdel["picture_name"]);
$db->deleteData(@$tableNamePicture,"picture_id = '".$_GET["picture_id"]."'");
}elseif(@$_GET['act']=="deleteall"){
@$arrData = array();
if(count(@$_POST['hdpicture_id']) > 0){
foreach(@$_POST['hdpicture_id'] as $key => $val){
@$arrData['picture_title'] = @$_POST['picture_title_'.@$val.''];
@$arrData['picture_status'] = @$_POST['picture_status_'.@$val.''];
@$arrData['picture_showdetail'] = @$_POST['picture_showdetail_'.@$val.''];
foreach(@$arrData as $k => $v ){
@$arrData[@$k] = str_replace("'", "\'", @$v);
}
@$datasu = @$db->updateData(@$tableNamePicture,@$arrData," picture_id='".@$val."'");
}
}
$msg = $lang_set['txtEditComplete'];
$res = 1;
}
$where_f = "menu_id = '".$_GET["menu_id"]."'";
$getPage = $db->getAll( @$tableNamePicture, "*",$where_f,"order by picture_id desc" );
//echo "<pre>"; print_r($getPage);
?>
<div class="content-box"><!-- Start Content Box -->
<div class="content-box-header">
<h3><?php echo $lang_set['picture_title']; ?></h3>
<ul class="content-box-tabs">
<li><a href="#tab1" <?php echo ($_GET['act']=="" ? 'class="default-tab"' : "" );?>><?php echo $lang_set['list_page']; ?></a></li>
<li><a href="#tab2" <?php echo ($_GET['act']=="edit" ? 'class="default-tab"' : "" );?>><?php echo $lang_set['add_page']; ?></a></li>
</ul>
<div class="clear"></div>
</div> <!-- End .content-box-header -->
<div class="content-box-content">
<div class="tab-content <?php echo ($_GET['act']!="edit" ? "default-tab" : "" );?>" id="tab1"> <!-- This is the target div. id must match the href of this div's tab -->
<?php if($res==1){?>
<div class="notification success png_bg">
<a href="#" class="close"><img src="images/icons/cross_grey_small.png" title="Close this notification" alt="close" /></a>
<div>
<?php echo $msg;?>
</div>
</div>
<meta http-equiv="refresh" content="0;URL=<?php echo $linkurl;?>">
<?php }?>
<form action="<?php echo $linkurl;?>&act=deleteall" method="post">
<?php if($getPage){?>
<table>
<tr style="background:#F3F3F3;">
<td width="150px"><?PHP echo $lang_set['picture_image'];?></td>
<td><?PHP echo $lang_set['picture_alt'];?></td>
<td width="50px"><?PHP echo $lang_set['picture_status'];?></td>
<td width="180px"><?PHP echo $lang_set['picture_showdetail'];?></td>
<td width="120px"></td>
</tr>
<?php foreach($getPage as $kfile => $vfile){?>
<tr style="background:#ffffff;">
<input type="hidden" name="hdpicture_id[]" value="<?php echo @$vfile['picture_id'];?>" />
<td style="vertical-align:middle"><img src="../files/<?PHP echo @$getfolder;?>/small_<?PHP echo $vfile["picture_name"];?>" border="0"
alt="<?PHP echo $vfile["picture_title"];?>" /> </td>
<td style="vertical-align:middle"><input type="text" name="picture_title_<?php echo @$vfile['picture_id'];?>" id="picture_title_<?php echo @$vfile['picture_id'];?>" class="text-input large-input" value="<?PHP echo $vfile["picture_title"];?>"/></td>
<td style="vertical-align:middle;">
<select name="picture_status_<?php echo $vfile['picture_id'];?>" class="styled styledmini">
<option value="1" <?php echo ($vfile['picture_status']=="1" ? "selected" : "");?>><?PHP echo $lang_set["show"];?></option>
<option value="0" <?php echo ($vfile['picture_status']=="0" ? "selected" : "");?>><?PHP echo $lang_set["hide"];?></option>
</select>
</td>
<td style="vertical-align:middle;">
<select name="picture_showdetail_<?php echo $vfile['picture_id'];?>" class="styled styledmini" style="width:100%">
<option value="1" <?php echo ($vfile['picture_showdetail']=="1" ? "selected" : "");?>><?PHP echo $lang_set["show"];?></option>
<option value="0" <?php echo ($vfile['picture_showdetail']=="0" ? "selected" : "");?>><?PHP echo $lang_set["hide"];?></option>
</select>
</td>
<td style="vertical-align:middle">
<a href="../files/<?PHP echo @$getfolder;?>/original_<?PHP echo $vfile["picture_name"];?>" target="_blank"><img src="images/icons/view-detail.png" border="0" /></a>
<a href="<?php echo $linkurl;?>&act=del&picture_id=<?php echo $vfile['picture_id']?>" title="Delete"><img src="images/icons/cross.png" alt="Delete" /></a></td></tr>
<?php }?>
</table>
<p>
<input type="submit" class="button" value="<?php echo $lang_set['update']; ?>" />
</p>
<?php }else{?>
<table width="100%">
<tr>
<td colspan="7" style="text-align:center"><?php echo @$lang_set['page_not_have']; ?>.</td>
</tr>
</table>
<?PHP }?>
</form>
</div> <!-- End #tab1 -->
<div class="tab-content <?php echo ($_GET['act']=="edit" ? "default-tab" : "" );?>" id="tab2">
<form action="<?php echo $linkurl;?>&act=add" method="post" id="formID1" enctype="multipart/form-data">
<div id="swfupload-control">
<p>Upload files each having maximum size of 2MB</p>
<input type="button" id="button" />
<p id="queuestatus" ></p>
<ol id="log"></ol>
</div>
<p>
<input type="submit" class="button" value="<?php echo $lang_set['submit']; ?>" />
</p>
</form>
</div> <!-- End #tab2 -->
</div> <!-- End .content-box-content -->
</div>