本文整理汇总了PHP中FileUpload::deleteFile方法的典型用法代码示例。如果您正苦于以下问题:PHP FileUpload::deleteFile方法的具体用法?PHP FileUpload::deleteFile怎么用?PHP FileUpload::deleteFile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileUpload
的用法示例。
在下文中一共展示了FileUpload::deleteFile方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: FileUpload
function m_uploadImage()
{
$fileUpload = new FileUpload();
$libFunc = new c_libFunctions();
$this->obDb->query = "select iVendorid_PK,vImage from " . SUPPLIERS . " where iVendorid_PK = " . $this->request['id'];
$row_code = $this->obDb->fetchQuery();
if ($this->libFunc->checkImageUpload("image")) {
$fileUpload->source = $_FILES["image"]["tmp_name"];
$fileUpload->target = $this->imagePath . "suppliers/" . $_FILES["image"]["name"];
$newName1 = $fileUpload->upload();
if ($newName1 != false) {
$image = $newName1;
}
if (!empty($row_code[0]->vImage)) {
$fileUpload->deleteFile($this->imagePath . "suppliers/" . $row_code[0]->vImage);
}
$imagename = "image";
} else {
$image = $row_code[0]->vImage;
}
$this->obDb->query = "UPDATE " . SUPPLIERS . " SET `vImage`='{$image}', `tmEditDate`='" . time() . "', `iAdminUser` ='" . $_SESSION['uid'] . "' where iVendorid_PK ='" . $this->request['id'] . "'";
$this->obDb->updateQuery();
$this->libFunc->m_mosRedirect(SITE_URL . "user/adminindex.php?action=supplier.uploadForm&status=1&id=" . $this->request['id']);
}
示例2: FileUpload
function m_uploadForm()
{
$obFile = new FileUpload();
$this->ObTpl = new template();
$this->ObTpl->set_file("Editor", $this->uploadTemplate);
$this->ObTpl->set_block("Editor", "TPL_IMAGE_BLK", "image_blk");
$this->ObTpl->set_var("TPL_VAR_DELETELINK", "");
if (!isset($this->request['id'])) {
echo "Sorry,Image is not available.";
exit;
}
#DEFAULT TYPE
if (!isset($this->request['type'])) {
$this->request['type'] = "menuheader";
}
if ($this->request['type'] == "menu") {
$this->obDb->query = $this->obDb->query = "SELECT vImage ";
$this->obDb->query .= " FROM " . MENUITEMS . " WHERE iMenuItemsId='" . $this->request['id'] . "'";
$rsImage = $this->obDb->fetchQuery();
} else {
$this->obDb->query = $this->obDb->query = "SELECT vImage ";
$this->obDb->query .= " FROM " . MENUHEADERS . " WHERE iHeaderid_PK='" . $this->request['id'] . "'";
$rsImage = $this->obDb->fetchQuery();
}
if ($this->libFunc->m_checkFileExist($rsImage[0]->vImage, "menu") && $rsImage[0]->vImage != "") {
$this->ObTpl->set_var("TPL_VAR_IMAGE", "<img src=" . $this->imageUrl . "menu/" . $rsImage[0]->vImage . " alt='" . $rsImage[0]->vImage . "' width=100 height=100>");
$this->ObTpl->set_var("TPL_VAR_DELETELINK", "<a href=" . SITE_URL . "ecom/adminindex.php?action=ec_menu.uploadForm&id=" . $this->request['id'] . "&type=" . $this->request['type'] . "&delete=1>Delete</a>");
if (isset($this->request['delete']) && $this->request['delete'] == 1) {
$source = $this->imagePath . "menu/" . $rsImage[0]->vImage;
$obFile->deleteFile($source);
$this->ObTpl->set_var("TPL_VAR_IMAGE", $this->libFunc->m_noImage());
$this->ObTpl->set_var("TPL_VAR_DELETELINK", "");
$this->request['msg'] = 1;
}
} else {
$this->ObTpl->set_var("TPL_VAR_IMAGE", $this->libFunc->m_noImage());
}
$this->ObTpl->parse("image_blk", "TPL_IMAGE_BLK");
$imgLabel = "image";
if (isset($this->request['status'])) {
$this->ObTpl->set_var("TPL_VAR_TOPMSG", "" . ucfirst($imgLabel) . " has been Updated");
} else {
$this->ObTpl->set_var("TPL_VAR_TOPMSG", "");
}
if (isset($this->request['msg'])) {
if ($this->request['msg'] == 1) {
$this->ObTpl->set_var("TPL_VAR_TOPMSG", "<span class='adminDetail'>" . MSG_IMGDELETE_SUCCESS . "</span>");
} elseif ($this->request['msg'] == 2) {
$this->ObTpl->set_var("TPL_VAR_TOPMSG", "<span class='adminDetail'>" . MSG_IMGDELETE_SUCCESS . "</span>");
} else {
$this->ObTpl->set_var("TPL_VAR_TOPMSG", "");
}
} elseif ($this->err == 1) {
$this->ObTpl->set_var("TPL_VAR_TOPMSG", "{$this->errMsg}");
}
$this->ObTpl->set_var("TPL_VAR_SITEURL", SITE_URL);
$this->ObTpl->set_var("TPL_VAR_ID", $this->request['id']);
$this->ObTpl->set_var("FORMURL", SITE_URL . "ecom/adminindex.php?action=ec_menu.upload&id=" . $this->request['id'] . "&type=" . $this->request['type']);
$this->ObTpl->pparse("return", "Editor");
exit;
}
示例3: FileUpload
function m_uploadForm()
{
$obFile = new FileUpload();
$this->ObTpl = new template();
$this->ObTpl->set_file("Editor", $this->uploadTemplate);
$this->ObTpl->set_block("Editor", "TPL_IMAGE_BLK", "image_blk");
$this->ObTpl->set_var("TPL_VAR_DELETELINK", "");
if (!isset($this->request['type'])) {
$this->request['type'] = "option";
}
if ($this->request['type'] == "choice") {
$this->obDb->query = "select iChoiceid_PK,vImage from " . CHOICES . " where iChoiceid_PK = " . $this->request['id'];
$rsImage = $this->obDb->fetchQuery();
} else {
$this->obDb->query = "select iOptionValueid_PK,vItem,vImage from " . OPTIONVALUES . " where iOptionValueid_PK = " . $this->request['id'];
$rsImage = $this->obDb->fetchQuery();
}
if ($this->libFunc->m_checkFileExist($rsImage[0]->vImage, "options") && $rsImage[0]->vImage != "") {
$this->ObTpl->set_var("TPL_VAR_IMAGE", "<img src=" . $this->imageUrl . "options/" . $rsImage[0]->vImage . " alt='" . $rsImage[0]->vImage . "' width=100 height=100>");
$this->ObTpl->set_var("TPL_VAR_DELETELINK", "<a href=" . SITE_URL . "ecom/adminindex.php?action=ec_option.uploadForm&id=" . $this->request['id'] . "&type=" . $this->request['type'] . "&delete=1>Delete</a>");
if (isset($this->request['delete']) && $this->request['delete'] == 1) {
$source = $this->imagePath . "options/" . $rsImage[0]->vImage;
$obFile->deleteFile($source);
$this->ObTpl->set_var("TPL_VAR_IMAGE", $this->libFunc->m_noImage());
$this->ObTpl->set_var("TPL_VAR_DELETELINK", "");
$this->request['msg'] = 1;
}
} else {
$this->ObTpl->set_var("TPL_VAR_IMAGE", $this->libFunc->m_noImage());
}
$this->ObTpl->parse("image_blk", "TPL_IMAGE_BLK");
$imgLabel = "image";
if (isset($this->request['status'])) {
$this->ObTpl->set_var("TPL_VAR_TOPMSG", "" . ucfirst($imgLabel) . " has been \tUpdated");
} else {
$this->ObTpl->set_var("TPL_VAR_TOPMSG", "");
}
if (isset($this->request['msg'])) {
if ($this->request['msg'] == 1) {
$this->ObTpl->set_var("TPL_VAR_TOPMSG", "<span class='adminDetail'>" . MSG_IMGDELETE_SUCCESS . "</span>");
} elseif ($this->request['msg'] == 2) {
$this->ObTpl->set_var("TPL_VAR_TOPMSG", "<span class='adminDetail'>" . MSG_IMGDELETE_SUCCESS . "</span>");
} else {
$this->ObTpl->set_var("TPL_VAR_TOPMSG", "");
}
} elseif ($this->err == 1) {
$this->ObTpl->set_var("TPL_VAR_TOPMSG", $this->errMsg);
}
$this->ObTpl->set_var("TPL_VAR_SITEURL", SITE_URL);
$this->ObTpl->set_var("TPL_VAR_ID", $this->request['id']);
$this->ObTpl->set_var("FORMURL", SITE_URL . "ecom/adminindex.php?action=ec_option.upload&id=" . $this->request['id'] . "&type=" . $this->request['type']);
$this->ObTpl->pparse("return", "Editor");
exit;
}
示例4: FileUpload
function m_deleteContent()
{
$obFile = new FileUpload();
$this->imagePath = SITE_PATH . "/images/";
if (isset($this->request['id']) && !empty($this->request['id'])) {
$this->obDb->query = "select vImage1,vImage2,vImage3 from " . CONTENTS . " where iContentid_PK=" . $this->request['id'];
$this->imagePath = $this->imagePath . "content/";
$rs = $this->obDb->fetchQuery();
$num_rows = $this->obDb->record_count;
if ($num_rows == 1) {
#DELETING IMAGES
if (!empty($rs[0]->vImage1) && file_exists($this->imagePath . $rs[0]->vImage1)) {
$obFile->deleteFile($this->imagePath . $rs[0]->vImage1);
}
if (!empty($rs[0]->vImage2) && file_exists($this->imagePath . $rs[0]->vImage2)) {
$obFile->deleteFile($this->imagePath . $rs[0]->vImage2);
}
if (!empty($rs[0]->vImage3) && file_exists($this->imagePath . $rs[0]->vImage3)) {
$obFile->deleteFile($this->imagePath . $rs[0]->vImage3);
}
#GETTING OWNER OF DELETED DEPARTMENT
$this->obDb->query = "select iOwner_FK,vOwnerType,iSort from " . FUSIONS . " where iSubId_FK=" . $this->request['id'] . " AND vtype='content'";
$rsOwner = $this->obDb->fetchQuery();
#DELETING CHILDS
$this->obDb->query = "SELECT iSubId_FK,vtype,iSort from " . FUSIONS . " where iOwner_FK=" . $this->request['id'] . " AND vOwnerType='content'";
$rsChild = $this->obDb->fetchQuery();
$rsChildCount = $this->obDb->record_count;
for ($i = 0; $i < $rsChildCount; $i++) {
#DELETING CONTENT
$this->obDb->query = "DELETE from " . CONTENTS . " where iContentid_PK='" . $rsChild[$i]->iSubId_FK . "'";
$this->obDb->updateQuery();
}
#DELETING CONTENT
$this->obDb->query = "DELETE from " . CONTENTS . " where iContentid_PK=" . $this->request['id'];
$this->obDb->updateQuery();
#DELETING RELATIONAL ENTRY FROM FUSION
$this->obDb->query = "DELETE from " . FUSIONS . " where (iOwner_FK='" . $this->request['id'] . "' AND vOwnerType='content') OR iSubId_FK=" . $this->request['id'] . " AND vtype='content'";
$this->obDb->updateQuery();
#RESORTING
if ($rsOwner[0]->iOwner_FK != '') {
$this->obDb->query = "UPDATE " . FUSIONS . " SET iSort=iSort-1 where (iSort>" . $rsOwner[0]->iSort . " AND iOwner_FK=" . $rsOwner[0]->iOwner_FK . " AND vOwnerType='" . $rsOwner[0]->vOwnerType . "' AND vtype='content') ";
$this->obDb->updateQuery();
}
}
} else {
$this->request['owner'] = 0;
}
$this->libFunc->m_mosRedirect(SITE_URL . "adminindex.php?action=home.creport");
}
示例5: FileUpload
function m_deleteImage()
{
$obFile = new FileUpload();
if (!isset($this->request['id'])) {
echo "Error-No product selected";
exit;
}
if (!isset($this->request['dir'])) {
$this->libFunc->m_mosRedirect(SITE_URL . "ecom/adminindex.php?action=ec_show.dspUploadFrm&id=" . $this->request['id'] . "&image=" . $this->request['image'] . "&type=" . $this->request['dir'] . "&msg=2");
}
if (!isset($this->request['image'])) {
$this->libFunc->m_mosRedirect(SITE_URL . "ecom/adminindex.php?action=ec_show.dspUploadFrm&id=" . $this->request['id'] . "&image=" . $this->request['image'] . "&type=" . $this->request['dir'] . "&msg=2");
}
if (!isset($this->request['name'])) {
$this->libFunc->m_mosRedirect(SITE_URL . "ecom/adminindex.php?action=ec_show.dspUploadFrm&id=" . $this->request['id'] . "&image=" . $this->request['image'] . "&type=" . $this->request['dir'] . "&msg=2");
}
if ($this->request['image'] == "image4") {
$deleteDir = "files";
} else {
$deleteDir = $this->request['dir'];
}
$filename = $deleteDir . "/" . $this->request['name'];
$source = $this->imagePath . $filename;
$obFile->deleteFile($source);
$this->libFunc->m_mosRedirect(SITE_URL . "ecom/adminindex.php?action=ec_show.dspUploadFrm&id=" . $this->request['id'] . "&image=" . $this->request['image'] . "&type=" . $this->request['dir'] . "&msg=1");
}
示例6: FileUpload
function m_deleteDepartment($depid, $endDeptId)
{
$obFile = new FileUpload();
$this->obDb->query = "SELECT iSubId_FK from " . FUSIONS . " WHERE iOwner_FK='" . $depid . "' AND vOwnerType='department' AND vtype='department'";
$rsChild = $this->obDb->fetchQuery();
$rsChildCount = $this->obDb->record_count;
if ($rsChildCount > 0 && !empty($rsChild[0]->iSubId_FK)) {
$this->m_deleteDepartment($rsChild[0]->iSubId_FK, $endDeptId);
}
$this->obDb->query = "SELECT iOwner_FK FROM " . FUSIONS . " WHERE iSubId_FK='" . $depid . "' AND vtype='department'";
$rsOwner = $this->obDb->fetchQuery();
$rsOwnCount = $this->obDb->record_count;
if ($rsOwnCount > 0) {
$this->obDb->query = "SELECT vTitle,vImage1,vImage2,vImage3 FROM " . DEPARTMENTS . " WHERE iDeptid_PK='" . $depid . "'";
$rs = $this->obDb->fetchQuery();
$num_rows = $this->obDb->record_count;
if ($num_rows == 1) {
#DELETING IMAGES
if (!empty($rs[0]->vImage1) && file_exists($this->imagePath . $rs[0]->vImage1)) {
$obFile->deleteFile($this->imagePath . $rs[0]->vImage1);
}
if (!empty($rs[0]->vImage2) && file_exists($this->imagePath . $rs[0]->vImage2)) {
$obFile->deleteFile($this->imagePath . $rs[0]->vImage2);
}
if (!empty($rs[0]->vImage3) && file_exists($this->imagePath . $rs[0]->vImage3)) {
$obFile->deleteFile($this->imagePath . $rs[0]->vImage3);
}
}
#DELETING RELATIONAL ENTRY FROM FUSION
$this->obDb->query = "DELETE FROM " . FUSIONS . " WHERE iSubId_FK='" . $depid . "' AND vtype='department'";
$this->obDb->updateQuery();
#DELETING DEPARTMENT
$this->obDb->query = "DELETE FROM " . DEPARTMENTS . " WHERE iDeptid_PK='" . $depid . "'";
$this->obDb->updateQuery();
$this->obDb->query = "DELETE FROM " . FUSIONS . " WHERE iOwner_FK='" . $depid . "' AND vtype='product' AND vOwnerType='department'";
$this->obDb->updateQuery();
$this->obDb->query = "DELETE FROM " . FUSIONS . " WHERE iOwner_FK='" . $depid . "' AND vtype='content' AND vOwnerType='department'";
$this->obDb->updateQuery();
if ($rsOwner[0]->iOwner_FK != $endDeptId && $rsOwner[0]->iOwner_FK != "") {
$this->m_deleteDepartment($rsOwner[0]->iOwner_FK, $endDeptId);
}
}
}
示例7: FileUpload
function m_deleteChoice()
{
$obFile = new FileUpload();
if (isset($this->request['choiceid']) && !empty($this->request['choiceid'])) {
$this->obDb->query = "SELECT vImage FROM " . CHOICES;
$this->obDb->query .= " WHERE iChoiceid_PK ='" . $this->request['choiceid'] . "'";
$rsImage = $this->obDb->fetchQuery();
$rsCount = $this->obDb->record_count;
if ($rsCount > 0) {
#DELETING IMAGES
if ($this->libFunc->m_checkFileExist($rsImage[0]->vImage, "options")) {
$obFile->deleteFile($this->imagePath . "options/" . $rsImage[0]->vImage);
}
#DELETING CHOICE
$this->obDb->query = "DELETE FROM " . CHOICES . " WHERE iChoiceid_PK ='" . $this->request['choiceid'] . "'";
$this->obDb->updateQuery();
}
}
$this->libFunc->m_mosRedirect(SITE_URL . "ecom/adminindex.php?action=ec_option.home");
exit;
}
示例8: FileUpload
function m_uploadImage()
{
$fileUpload = new FileUpload();
if ($this->request['type'] == "menu") {
$this->obDb->query = "SELECT vImage from " . MENUITEMS . " WHERE iMenuItemsId=" . $this->request['id'];
$rsImage = $this->obDb->fetchQuery();
} else {
$this->obDb->query = "SELECT vImage from " . MENUHEADERS . " WHERE iHeaderid_PK=" . $this->request['id'];
$rsImage = $this->obDb->fetchQuery();
}
if ($this->libFunc->checkImageUpload("image")) {
$fileUpload->source = $_FILES["image"]["tmp_name"];
$fileUpload->target = $this->imagePath . "menu/" . $_FILES["image"]["name"];
$newName1 = $fileUpload->upload();
if ($newName1 != false) {
$image = $newName1;
}
if (!empty($rsImage[0]->vImage)) {
$fileUpload->deleteFile($this->imagePath . "menu/" . $rsImage[0]->vImage);
}
$imagename = "image";
} else {
$image = $rsImage[0]->vImage;
}
if ($this->request['type'] == "menu") {
$this->obDb->query = "UPDATE " . MENUITEMS . " SET `vImage`='{$image}' ,`tmEditDate`='" . time() . "', `iAdminUser` ='" . $_SESSION['uid'] . "' WHERE iMenuItemsId ='" . $this->request['id'] . "'";
} else {
$this->obDb->query = "UPDATE " . MENUHEADERS . " SET `vImage`='{$image}',`tmEditDate`='" . time() . "', `iAdminUser` ='" . $_SESSION['uid'] . "' WHERE iHeaderid_PK ='" . $this->request['id'] . "'";
}
$this->obDb->updateQuery();
$this->libFunc->m_mosRedirect(SITE_URL . "ecom/adminindex.php?action=ec_menu.uploadForm&status=1&id=" . $this->request['id'] . "&type=" . $this->request['type']);
}
示例9: FileUpload
function m_uploadForm()
{
$obFile = new FileUpload();
$this->ObTpl = new template();
$this->ObTpl->set_file("Editor", $this->uploadTemplate);
$this->ObTpl->set_block("Editor", "TPL_IMAGE_BLK", "image_blk");
$this->ObTpl->set_var("image_blk", "");
$this->ObTpl->set_var("TPL_VAR_DELETELINK", "");
$this->obDb->query = "select iVendorid_PK,vImage from " . SUPPLIERS . " where iVendorid_PK = " . $this->request['id'];
$rsImage = $this->obDb->fetchQuery();
if ($this->libFunc->m_checkFileExist($rsImage[0]->vImage, "suppliers") && $rsImage[0]->vImage != "") {
$this->ObTpl->set_var("TPL_VAR_IMAGE", "<img src=" . $this->imageUrl . "suppliers/" . $rsImage[0]->vImage . " alt='No Image' width=100 height=100>");
$this->ObTpl->set_var("TPL_VAR_DELETELINK", "<a href=" . SITE_URL . "user/adminindex.php?action=supplier.uploadForm&id=" . $this->request['id'] . "&delete=1>Delete</a>");
if (isset($this->request['delete']) && $this->request['delete'] == 1) {
$source = $this->imagePath . "suppliers/" . $rsImage[0]->vImage;
$obFile->deleteFile($source);
$this->ObTpl->set_var("TPL_VAR_IMAGE", $this->libFunc->m_noImage());
$this->ObTpl->set_var("TPL_VAR_DELETELINK", "");
$this->request['msg'] = 1;
}
} else {
$this->ObTpl->set_var("TPL_VAR_IMAGE", $this->libFunc->m_noImage());
}
$this->ObTpl->parse("image_blk", "TPL_IMAGE_BLK");
$imgLabel = "Supplier's Logo";
if (isset($this->request['status'])) {
$this->ObTpl->set_var("TPL_VAR_TOPMSG", "" . ucfirst($imgLabel) . " has been Updated");
} else {
$this->ObTpl->set_var("TPL_VAR_TOPMSG", "");
}
$this->ObTpl->set_var("TPL_VAR_SITEURL", SITE_URL);
$this->ObTpl->set_var("TPL_VAR_ID", $this->request['id']);
if (isset($this->request['msg'])) {
if ($this->request['msg'] == 1) {
$this->ObTpl->set_var("TPL_VAR_TOPMSG", "<span class='adminDetail'>" . MSG_IMGDELETE_SUCCESS . "</span>");
} elseif ($this->request['msg'] == 2) {
$this->ObTpl->set_var("TPL_VAR_TOPMSG", "<span class='adminDetail'>" . MSG_IMGDELETE_SUCCESS . "</span>");
} else {
$this->ObTpl->set_var("TPL_VAR_TOPMSG", "");
}
} elseif ($this->err == 1) {
$this->ObTpl->set_var("TPL_VAR_TOPMSG", $this->errMsg);
}
$this->ObTpl->set_var("FORMURL", SITE_URL . "user/adminindex.php?action=supplier.upload&id=" . $this->request['id']);
$this->ObTpl->pparse("return", "Editor");
exit;
}
示例10: FileUpload
function m_deleteFile()
{
if (!isset($this->request['dir']) && empty($this->request['dir'])) {
$this->libFunc->m_mosRedirect(SITE_URL . "admin/adminindex.php?action=file.home&msg=1");
}
$this->defaultValues();
$fileUpload = new FileUpload();
$directory = $this->request['dir'];
$fname = $this->request['fname'];
if (is_file($this->imagePath . $directory . "/" . $fname)) {
$fileUpload->deleteFile($this->imagePath . $directory . "/" . $fname);
} else {
$this->libFunc->m_mosRedirect(SITE_URL . "admin/adminindex.php?action=file.list&msg=2&dir=" . $directory);
}
$this->libFunc->m_mosRedirect(SITE_URL . "admin/adminindex.php?action=file.list&msg=1&dir=" . $directory);
}
示例11: FileUpload
function m_uploadForm()
{
$obFile = new FileUpload();
$this->ObTpl = new template();
$this->ObTpl->set_file("TPL_EDITOR_FILE", $this->browseTemplate);
$this->ObTpl->set_var("GRAPHICSMAINPATH", GRAPHICS_PATH);
$this->ObTpl->set_var("TPL_VAR_DELETELINK", "");
$this->ObTpl->set_var("TPL_VAR_TOPMSG", "");
$this->ObTpl->set_var("TPL_VAR_SITEURL", SITE_URL);
$this->ObTpl->set_var("FORMURL", SITE_URL . "sales/adminindex.php?action=promotions.giftwrap.upload");
$this->ObTpl->set_var("TPL_VAR_ID", $this->request['id']);
$this->obDb->query = "SELECT vImage,vImageLarge FROM " . GIFTWRAPS . " WHERE iGiftwrapid_PK='" . $this->request['id'] . "'";
$rsImage = $this->obDb->fetchQuery();
if ($this->request['img'] == "vImage") {
if ($this->libFunc->m_checkFileExist($rsImage[0]->vImage, "giftwrap") && !empty($rsImage[0]->vImage)) {
$this->ObTpl->set_var("TPL_VAR_IMAGE", "<img src=" . $this->imageUrl . "giftwrap/" . $rsImage[0]->vImage . " width='100' height='100'>");
$this->ObTpl->set_var("TPL_VAR_DELETELINK", "<a href=" . SITE_URL . "sales/adminindex.php?action=promotions.giftwrap.uploadForm&id=" . $this->request['id'] . "&img=" . $this->request['img'] . "&delete=1>Delete</a>");
if (isset($this->request['delete']) && $this->request['delete'] == 1) {
$source = $this->imagePath . "giftwrap/" . $rsImage[0]->vImage;
$obFile->deleteFile($source);
$this->ObTpl->set_var("TPL_VAR_IMAGE", $this->libFunc->m_noImage());
$this->ObTpl->set_var("TPL_VAR_DELETELINK", "");
$this->request['msg'] = 3;
}
} else {
$this->ObTpl->set_var("TPL_VAR_IMAGE", $this->libFunc->m_noImage());
}
} elseif ($this->request['img'] == "vImageLarge") {
if ($this->libFunc->m_checkFileExist($rsImage[0]->vImageLarge, "giftwrap") && !empty($rsImage[0]->vImageLarge)) {
$this->ObTpl->set_var("TPL_VAR_IMAGE", "<img src=" . $this->imageUrl . "giftwrap/" . $rsImage[0]->vImageLarge . " width='100' height='100'>");
$this->ObTpl->set_var("TPL_VAR_DELETELINK", "<a href=" . SITE_URL . "sales/adminindex.php?action=promotions.giftwrap.uploadForm&id=" . $this->request['id'] . "&img=" . $this->request['img'] . "&delete=1>Delete</a>");
if (isset($this->request['delete']) && $this->request['delete'] == 1) {
$source = $this->imagePath . "giftwrap/" . $rsImage[0]->vImageLarge;
$obFile->deleteFile($source);
$this->ObTpl->set_var("TPL_VAR_IMAGE", $this->libFunc->m_noImage());
$this->ObTpl->set_var("TPL_VAR_DELETELINK", "");
$this->request['msg'] = 3;
}
} else {
$this->ObTpl->set_var("TPL_VAR_IMAGE", $this->libFunc->m_noImage());
}
}
if (isset($this->request['msg']) && $this->request['msg'] == 1) {
$this->ObTpl->set_var("TPL_VAR_TOPMSG", "<span class='adminDetail'>" . MSG_IMAGE_UPLOADED . "</span>");
} elseif (isset($this->request['msg']) && $this->request['msg'] == 2) {
$this->ObTpl->set_var("TPL_VAR_TOPMSG", "<span class='adminDetail'>" . MSG_IMAGE_NOTUPLOADED . "</span>");
} elseif (isset($this->request['msg']) && $this->request['msg'] == 3) {
$this->ObTpl->set_var("TPL_VAR_TOPMSG", "<span class='adminDetail'>" . MSG_IMGDELETE_SUCCESS . "</span>");
} else {
$this->ObTpl->set_var("TPL_VAR_TOPMSG", "Update Image");
}
$this->ObTpl->set_var("TPL_VAR_IMG", $this->request['img']);
$this->ObTpl->pparse("return", "TPL_EDITOR_FILE");
exit;
}