Location: PHPKode > projects > Pointter PHP CMS > pointtercms_package/pointtercms_package/pointtercms/admin/functions/editproductconfirm.php
<?php 

/***************************************************************************
 * Product Name			: Pointter PHP Content Management System
 * Version 			: V 1.2
 * Release Date			: 01/02/11
 * Copyright			: (C) 2011 PangramSoft / Murat Cevik
 * Program URL			: http://www.pointter.com
 * Company URL			: http://www.pangramsoft.com
 * Email Address                : hide@address.com
 
 ***************************************************************************/
 

/****************************************************************************

Pointter PHP Content Management System is licensed under Creative Commons Attribution Non-commercial No Derivatives 3.0 Unported (by-nc-nd) License.
To view a copy of this license, (a) visit http://creativecommons.org/licenses/by-nc-nd/3.0/ or (b) send a letter to Creative Commons, 171 2nd Street, 
Suite 300, San Francisco, California, 94105, USA.” 

You must not remove/modify/alter the copyright informations both visible and invisible forms in the source code and you must not remove/modify/alter 
the copyright informations in the footer part of the script including the Pointter image (png format file), hard link and title tag.

Please contact the copyright holder PangramSoft / Murat Cevik for a commercial license to remove the copyright information in the footer part of the script.


*****************************************************************************/

$name=$_POST[name];
$cat=$_POST[cat];
$url=$_POST[url];
$html=$_POST[html];


if ($cat=="No Selection")
{

//Upload Image File

if (is_uploaded_file($_FILES[imagefile][tmp_name]))
{
$image=basename($_FILES['imagefile']['name']);
$target_path="../../images/";
$target=$target_path.$image;

 if (eregi('image/',$_FILES['imagefile']['type']))
   {
    move_uploaded_file($_FILES['imagefile']['tmp_name'],$target);
    $image_check=1;
   }
}


 if ($name!="")
   {
    include '../../configset/conn.php';

    if ($image_check==1)
      mysql_query("UPDATE Products SET ProductName='$name',Html='$html',Image='$image' WHERE Url='$url'");
    else
      mysql_query("UPDATE Products SET ProductName='$name',Html='$html' WHERE Url='$url'");

    mysql_query("UPDATE Views SET Name='$name' WHERE Url='$url'");
    mysql_close($connect);
    header ("location:../editproduct.php");
   }
    else
        {
         include '../../configset/conn.php';

         if ($image_check==1)
           mysql_query("UPDATE Products SET Html='$html',Image='$image' WHERE Url='$url'");
         else
           mysql_query("UPDATE Products SET Html='$html' WHERE Url='$url'");

         mysql_close($connect);
         header ("location:../editproduct.php");
        }


}
 else
     {


//Upload Image File

if (is_uploaded_file($_FILES[imagefile][tmp_name]))
{
$image=basename($_FILES['imagefile']['name']);
$target_path="../../images/";
$target=$target_path.$image;

 if (eregi('image/',$_FILES['imagefile']['type']))
   {
    move_uploaded_file($_FILES['imagefile']['tmp_name'],$target);
    $image_check=1;
   }
}

      if ($name!="")
        {
         include '../../configset/conn.php';

         $subcat=mysql_query("SELECT * FROM Category WHERE Name='$cat'");
         $sub_row=mysql_fetch_array($subcat);

         if ($sub_row[Code]==1)
           {
            $sub_subcat=mysql_query("SELECT Name FROM Category WHERE CategoryID='$sub_row[Subcode]'");
            $subcat_row=mysql_fetch_array($sub_subcat);

            if ($image_check==1)
              mysql_query("UPDATE Products SET Category='$cat',ProductName='$name',Html='$html',Subcode='$subcat_row[Name]',Image='$image' WHERE Url='$url'");
            else
              mysql_query("UPDATE Products SET Category='$cat',ProductName='$name',Html='$html',Subcode='$subcat_row[Name]' WHERE Url='$url'");

           }
            else
                {

                if ($image_check==1)
                  mysql_query("UPDATE Products SET Category='$cat',ProductName='$name',Html='$html',Subcode='$cat',Image='$image' WHERE Url='$url'");
                else
                  mysql_query("UPDATE Products SET Category='$cat',ProductName='$name',Html='$html',Subcode='$cat' WHERE Url='$url'");

                } 
         mysql_query("UPDATE Views SET Name='$name' WHERE Url='$url'");
         mysql_close($connect);
         header ("location:../editproduct.php");
        }
         else
             {
              include '../../configset/conn.php';

              $subcat=mysql_query("SELECT * FROM Category WHERE Name='$cat'");
              $sub_row=mysql_fetch_array($subcat);

              if ($sub_row[Code]==1)
                {
                 $sub_subcat=mysql_query("SELECT Name FROM Category WHERE CategoryID='$sub_row[Subcode]'");
                 $subcat_row=mysql_fetch_array($sub_subcat);

                 if ($image_check==1)
                   mysql_query("UPDATE Products SET Category='$cat',Html='$html',Subcode='$subcat_row[Name]',Image='$image' WHERE Url='$url'");
                 else
                   mysql_query("UPDATE Products SET Category='$cat',Html='$html',Subcode='$subcat_row[Name]' WHERE Url='$url'");

                }
                 else
                     {
                    
                      if ($image_check==1)
                        mysql_query("UPDATE Products SET Category='$cat',Html='$html',Subcode='$cat',Image='$image' WHERE Url='$url'");
                      else
                        mysql_query("UPDATE Products SET Category='$cat',Html='$html',Subcode='$cat' WHERE Url='$url'");

                     }

              mysql_close($connect);
              header ("location:../editproduct.php");
             }

}


?>
Return current item: Pointter PHP CMS