/admin/app/controllers/backdrop_controller.php
PHP | 2288 lines | 1765 code | 418 blank | 105 comment | 231 complexity | 8cebc18cc553a03b7820d334278c8e4f MD5 | raw file
Possible License(s): LGPL-2.1, AGPL-1.0
Large files files are truncated, but you can click here to view the full file
- <?php
- class BackdropController extends AppController
- {
- var $name='Backdrop';
- var $helpers = array('Pagination', 'error','Ajax');
- var $components = array('Pagination','Download','Sendmail');
-
- function backdropsizelist()
- {
- $categorylist = array('0'=>'Select Size',"6'X8'"=>"6'X8'","10'X10'"=>"10'X10'","20'X20'"=>"20'X20'");
- $this->set('sizelist',$categorylist);
- }
- function viewbackdrops($userType=null , $userId=null)
- {
- $this->checkSession();
- $this->layout = 'default_user';
- if($userType=='admin')
- $Qry = mysql_fetch_array(mysql_query("select * from backdrops where is_admin='Yes' and user_id=".base64_decode($userId)));
- else
- {
- if($userType=='admin')
- $Qry = mysql_fetch_array(mysql_query("select * from backdrops where is_admin='No' and user_id=".base64_decode($userId)));
- else
- $Qry = mysql_fetch_array(mysql_query("select * from backdrops where user_id=".base64_decode($userId).""));
-
- }
- $this->set('album', $Qry);
-
- $this->set('userType', $userType);
- $this->set('userId', $userId);
-
- }
- function backdropdetails($backdropUserType=null,$backdropUserId=null,$backdropid=null)
- {
- $this->checkSession();
- $this->layout = 'default_user';
- $this->set('BackdropUserType', $backdropUserType);
- $this->set('BackdropUserId', $backdropUserId);
- $this->set('Backdropid', $backdropid);
- $this->set('userType', $backdropUserType);
- $this->set('userId', $backdropUserId);
-
- $this->backdropcategory();
- $this->getbackdropdetails($backdropid);
- }
-
- function getbackdropdetails($backdropid=null)
- {
- /*getting out the backdrop details*/
- $selectbackdrop = "Select * from backdrops where id=".$backdropid."";
- $selectbackdrop_res = mysql_query($selectbackdrop);
- $selectbackdrop_arr = mysql_fetch_array($selectbackdrop_res);
-
- $this->set('BackdropTitle', stripslashes($selectbackdrop_arr['Name']));
- $this->set('BackdropDesc', stripslashes($selectbackdrop_arr['description']));
- $this->set('OriginalPrice', stripslashes($selectbackdrop_arr['original_price']));
- $this->set('ListingPrice', stripslashes($selectbackdrop_arr['listing_price']));
- $this->set('BackdropSize', stripslashes($selectbackdrop_arr['backdrop_size']));
- $this->set('Backdropcat', stripslashes($selectbackdrop_arr['backdrop_categories_id']));
- $this->set('Backdropfeatured', $selectbackdrop_arr['is_featured']);
- $this->set('Backdropresale', $selectbackdrop_arr['is_resale']);
-
- /// User belongs to query
- if($selectbackdrop_arr['belongstouser']>1)
- {
- $usernameQry = "Select username from users where id='".$selectbackdrop_arr['belongstouser']."'";
- $usernameQry_res = mysql_query($usernameQry);
- $usernameQry_arr = mysql_fetch_array($usernameQry_res);
- $backdropuser = $usernameQry_arr['username'];
- }
- else
- $backdropuser = 'admin';
-
- $this->set('Backdropbelongsto', $backdropuser);
- $this->set('Backdropapproved', $selectbackdrop_arr['is_approved']);
-
- if($selectbackdrop_arr['is_approved']==0)$apptxt = 'Awaiting';
- if($selectbackdrop_arr['is_approved']==1)$apptxt = 'Approved';
- if($selectbackdrop_arr['is_approved']==2)$apptxt = 'Disapproved' ;
-
- $this->set('Backdropapprovedtxt',$apptxt);
-
-
- }
- function savebackdropdetails($backdroptranId=null)
- {
-
- /* Save the updated records */
- $approvaltxt='awaiting';
- $rejecttxtmsg='';
- $updatebackdrop=0;
- if(isset($_REQUEST['backdropstatus']) && $_REQUEST['backdropstatus']!='')
- {
- $approvaltxt=$_REQUEST['backdropstatus'] ;
- }
- if(isset($_REQUEST['txtmsg'.$backdroptranId]) && $_REQUEST['txtmsg'.$backdroptranId]!='')
- {
- $rejecttxtmsg=$_REQUEST['txtmsg'.$backdroptranId] ;
- }
- @mysql_query("Update backdrop_tickets SET status='".$approvaltxt."' , admin_reject_msg='".$rejecttxtmsg."' where id='".$backdroptranId."' ");
- if($approvaltxt=='reject')
- $updatebackdrop = '2';
- if($approvaltxt=='approve')
- $updatebackdrop = '1';
- /* Select */
- $sectbackid = "SELECT backdrop_id from backdrop_tickets where id='".$backdroptranId."'" ;
- $sectbackid_res = mysql_query($sectbackid);
- $sectbackid_array = mysql_fetch_array($sectbackid_res);
- @mysql_query("Update backdrops SET is_approved='".$updatebackdrop."' where id='".$sectbackid_array['backdrop_id']."' ");
-
- $this->set('rejecttxtmsg',$rejecttxtmsg);
-
-
-
-
-
- if(isset($_REQUEST['hfresale']) && $_REQUEST['hfresale']==0)
- {
- $updatesql = "UPDATE backdrops SET original_price='".$_REQUEST['backdroporgprice']."' ,listing_price='".$_REQUEST['backdroplistprice']."',backdrop_size='".addslashes($_REQUEST['backdropsize'])."',backdrop_categories_id='".$_REQUEST['category']."',user_id='".$_SESSION['Admin_id']."',is_admin='Yes',is_approved='".$_REQUEST['backdropstatus']."' where id='".$sectbackid_array['backdrop_id']."' ";
-
-
-
- }else{
- $updatesql = "UPDATE backdrops SET original_price='".$_REQUEST['backdroporgprice']."' ,listing_price='".$_REQUEST['backdroplistprice']."',backdrop_size='".addslashes($_REQUEST['backdropsize'])."',backdrop_categories_id='".$_REQUEST['category']."' where id='".$sectbackid_array['backdrop_id']."' ";
- }
- //echo $updatesql ;
- //pr($_REQUEST);
- //exit();
-
- $updatesql_res = mysql_query($updatesql);
- $this->backdropcategory();
-
- $this->getbackdropdetails($sectbackid_array['backdrop_id']);
- $this->set('Backdropid',base64_encode($sectbackid_array['backdrop_id']));
-
-
- ##### USER EMAIL ADDRESS
- $selectBackdropuser = "Select user_details.email , user_details.first_name ,user_details.last_name from user_details Left JOIN backdrops On backdrops.belongstouser=user_details.user_id where backdrops.id='".$sectbackid_array['backdrop_id']."'" ;
- $selectBackdropuser_res = mysql_query($selectBackdropuser);
- $selectBackdropuser_arr = mysql_fetch_array($selectBackdropuser_res);
-
- $this->set('BackdropUserFirst',$selectBackdropuser_arr['first_name']);
- $this->set('BackdropUserLast',$selectBackdropuser_arr['last_name']);
-
- //////
- //pr($_REQUEST);
- /// echo $selectBackdropuser_arr['email'] ;
- $this->Sendmail->Mail();
- $this->Sendmail->From('xoadmin@gmail.com');
-
- $this->Sendmail->To($selectBackdropuser_arr['email']);
- $this->Sendmail->Cc("sanjib@navsoft.in");
- $this->Sendmail->Cc("sujoy@navsoft.in");
- $subject="Backdrop approval status";
- $this->Sendmail->Subject($subject);
- $this->Sendmail->layout='email';
- $this->Sendmail->view='mail_backdroppost';
- $this->Sendmail->startup($this);
- $messageBody=$this->Sendmail->bodyText();
- $this->Sendmail->Body($messageBody); // set the body
- $this->Sendmail->Priority(1) ; // set the priority to Low
- $this->Sendmail->Send(); /**/
-
-
- $this->redirect($_SERVER['HTTP_REFERER']);
- }
- function savetransactioncomment()
- {
- $statusDate=date("Y-m-d",strtotime($this->params['form']['statusDate']));
- mysql_query("
- UPDATE
- transaction_backdrop
- SET
- status='".$this->params['form']['status']."',status_date='".$statusDate."'
- WHERE id='".$this->params['form']['tranId']."'");
-
- $returnPage=$this->params['form']['returnurl'];
- $this->redirect("backdrop/".$returnPage);
- }
-
- function download_backdrop()
- {
- $fileName=$this->params['url']['f'];
- $basePath=realpath('../../app/webroot/user_backdrop_img').'/';
- //$basePath = str_replace("/",DS,$basePath);
-
-
- //if(file_exists($basePath.DS.$fileName)){
- // echo "Exists";
- //}
- //else{
- // echo "Not Exists";
- //}
- //
- //$basePath = MAINDOMAIN.'user_backdrop_img/';
- //$basePath = explode('/var/www/vhosts/xoimages.com',$basePath);
- //echo $basePath[1];
- //exit;
-
- $this->Download->downloadFile($basePath,$fileName);
- //$this->redirect($_SERVER['HTTP_REFERER']);
- }
-
-
- function managebackdropcategory()
- {
- $this->checkSession();
- $this->layout = 'default_user';
- }
-
- function managebackdrop()
- {
- $this->checkSession();
- $this->layout = 'default_user';
- }
-
- function createbackdrop($usertype=null,$userId=null)
- {
- $this->redirect('backdrop/newcreatebackdrop');
- $this->checkSession();
- $this->layout = 'default_user';
- $this->backdropcategory();
- $this->backdropsizelist();
-
- if($usertype)
- $this->set('Backdropusertype',$usertype);
- if($userId)
- $this->set('BackdropuserId',$userId);
-
- }
- function backdropcategory()
- {
- $evtcat = array();
- $evtcat['0']="Select Category";
- $select_ticket_cat = mysql_query("Select * from backdrop_categories");
- while($select_ticket_cat_arr = mysql_fetch_array($select_ticket_cat))
- {
- $evtcat[$select_ticket_cat_arr['id']] = $select_ticket_cat_arr['backdrop_cat_name'];
- }
- $this->set('backdropcat',$evtcat);
-
- $this->backdropsizelist();
- }
-
- function delbackdropcategory($catid=null)
- {
- $this->checkSession();
- if(isset($_REQUEST['box']))
- {
- /////IF SEARCH IS COLLECTIVE OR CHOSEN BY ADMIN SELECTION//////
-
- $arr = $_REQUEST['box'];
- foreach($arr as $key => $value)
- {
- $sql_det = "delete from `backdrop_categories` where `id` = '".$value."'";
- $res_det = mysql_query($sql_det);
- }
- }
- ////IF DELETE IS FOR A SPECIFIC USER////
- else
- {
- $sql_det = "delete from `backdrop_categories` where `id` = '".$catid."'";
- $res_det = mysql_query($sql_det);
- }
- //$user_id=$_REQUEST['id'];
- $this->redirect($_SERVER['HTTP_REFERER']);
- }
-
- function createbackdrop2($backdrop=null)
- {
- $this->checkSession();
- $this->layout = 'default_user';
- if($backdrop)
- $this->set('Backdropid', $backdrop);
-
- if($backdrop)
- {
- $this->backdropcategory();
- $this->getbackdropdetails($backdrop);
- //$this->set('Backdropid', $backdrop);
- }
-
- if (!empty($this->data))
- {
-
- //pr($_REQUEST);
- if(isset($_REQUEST['backdropId']) && $_REQUEST['backdropId']!='')
- $this->data['Backdrop']['user_id'] = $_REQUEST['backdropId'];
- else
- $this->data['Backdrop']['user_id'] = $_SESSION['Admin_id'];
-
- $this->data['Backdrop']['belongstouser'] = $_SESSION['Admin_id'];
- $this->data['Backdrop']['is_featured'] = $_REQUEST['backdropfeatured'];
- $this->data['Backdrop']['is_approved'] = $_REQUEST['backdropstatus'];
-
- //echo $this->data['Backdrop']['user_id'] ;
- //
- //exit();
-
- if($_REQUEST['category']==0)
- $this->data['Backdrop']['backdrop_categories_id'] = 1;
- else
- $this->data['Backdrop']['backdrop_categories_id'] = $_REQUEST['category'];
-
- if(isset($_REQUEST['backdropIdUser']) && $_REQUEST['backdropIdUser']=='admin')
- $this->data['Backdrop']['is_admin'] = 'Yes';
- else
- {
- if(isset($_REQUEST['backdropuser']) && $_REQUEST['backdropuser']=='user')
- $this->data['Backdrop']['is_admin'] = 'No';
- else
- $this->data['Backdrop']['is_admin'] = 'Yes';
-
- }
- $this->data['Backdrop']['backdrop_size'] = $_REQUEST['backdropsize'];
- //pr($this->data);
-
- if ($this->Backdrop->save($this->data))
- {
- $backdrop_id = $this->Backdrop->getLastInsertId();
- /* UPDATE THE BACKDROP TABLE WITH UNIQUE NUMBER*/
- $this->data['Backdrop']['id'] = $backdrop_id;
- $this->data['Backdrop']['backdrop_id'] = $backdrop_id.date('mdY');
- $this->Backdrop->save($this->data);
-
-
- $this->redirect('/backdrop/createbackdrop2/'.$backdrop_id);
- }
- }
-
- }
- function Delbackdrop($backdropid=null)
- {
- if($backdropid)
- {
- $delbackquery = "DELETE FROM backdrops where id='".base64_decode($backdropid)."'";
- $delbackquery_res = mysql_query($delbackquery);
- }
- $this->redirect($this->webroot.'backdrop/managebackdrop');
- }
-
- function Blocked($blocktype=null,$backdropid=null)
- {
- if($blocktype=='block')
- {
- $delbackquery = "UPdate backdrops SET is_blocked='1' where id='".base64_decode($backdropid)."'";
- $delbackquery_res = mysql_query($delbackquery);
- }
- else{
- if($blocktype=='unblock')
- {
- $delbackquery = "UPdate backdrops SET is_blocked='0' where id='".base64_decode($backdropid)."'";
- $delbackquery_res = mysql_query($delbackquery);
- }
-
- }
- $this->redirect($_SERVER['HTTP_REFERER']);
- }
-
-
- function deletebackdrop($usertype=null,$userId=null)
- {
- if($usertype)
- {
- if($usertype=='admin' && $userId>0)
- {
- $delbackquery = "DELETE FROM backdrops where is_admin='Yes' and user_id='".$userId."'";
- $delbackquery_res = mysql_query($delbackquery);
- }
- else
- {
- if($usertype=='user' && $userId>0)
- {
- $delbackquery = "DELETE FROM backdrops where is_admin='No' and user_id='".$userId."'";
- $delbackquery_res = mysql_query($delbackquery);
- }
- }
- }
- $this->redirect($_SERVER['HTTP_REFERER']);
-
- }
-
- function add_musicstep2()
- {
- $this->checkSession();
- $this->layout = 'default_user';
- }
- function delete_musicgroup($id=null)
- {
- $this->checkSession();
- if(isset($_REQUEST['box']))
- {
- /////IF SEARCH IS COLLECTIVE OR CHOSEN BY ADMIN SELECTION//////
-
- $arr = $_REQUEST['box'];
- foreach($arr as $key => $value)
- {
- $sql_det = "delete from `backdrops` where `user_id` = '".$value."'";
- $res_det = mysql_query($sql_det);
- }
- }
- ////IF DELETE IS FOR A SPECIFIC USER////
- else
- {
- $user_id=$_REQUEST['id'];
- $this->data['Music']['menu'] = $_REQUEST['menu'];
- $sql_det = "delete from `backdrops` where `user_id` = '".$user_id."'";
- $res_det = mysql_query($sql_det);
- }
- //$user_id=$_REQUEST['id'];
- $this->data['Music']['menu'] = $_REQUEST['menu'];
- if(isset($_REQUEST['page']))
- {
- $page = $_REQUEST['page'];
- }
- $this->flash('The post with id: '.$id.' has been deleted.', '/posts');
- $this->redirect('/backdrop/managebackdrop');
- }
-
- function managehotmusic()
- {
- $this->checkSession();
- $this->layout = 'default_user';
-
- }
- function edithotmusic()
- {
- $this->checkSession();
- $this->layout = 'default_user';
-
-
- $music_cat = array();
- $music_cat[0] = "Select Category";
- $select_music_category = mysql_query("Select * from music_categories");
- while($select_music_category_res = mysql_fetch_array($select_music_category))
- {
- $music_cat[$select_music_category_res['id']] = $select_music_category_res['music_cat_name'] ;
- }
- $this->set('music_category',$music_cat);
-
- }
- function saveedithotmusic()
- {
- $update_sql = "Update music_hot set title='".$_REQUEST['mustitle']."' , music_id =".$_REQUEST['musicinfo']." where id=".$_REQUEST['hid']."";
- mysql_query($update_sql);
- $this->redirect('/musics/edithotmusicphoto?id='.$_REQUEST['hid']);
- }
- function edithotmusicphoto()
- {
- $this->checkSession();
- $this->layout = 'default_user';
- }
- function listenhotmusic()
- {
- $this->checkSession();
- $this->layout = 'default_user';
- }
- function delhotmusic()
- {
- $this->checkSession();
- $this->layout = 'default_user';
- /* delete hot music */
- $delhot = mysql_query("Delete From music_hot where id=".$_REQUEST['id']."");
-
- $this->redirect('/musics/managehotmusic?menu='.$_REQUEST['menu']);
-
- }
- function delete_hotmusicgroup()
- {
- $this->checkSession();
- if(isset($_REQUEST['box']))
- {
- /////IF SEARCH IS COLLECTIVE OR CHOSEN BY ADMIN SELECTION//////
-
- $arr = $_REQUEST['box'];
- foreach($arr as $key => $value)
- {
- $sql_det = "delete from `music_hot` where `id` = '".$value."'";
- $res_det = mysql_query($sql_det);
- }
- }
- ////IF DELETE IS FOR A SPECIFIC USER////
- else
- {
- $user_id=$_REQUEST['id'];
- $this->data['Music']['menu'] = $_REQUEST['menu'];
- $sql_det = "delete from `music_hot` where `id` = '".$user_id."'";
- $res_det = mysql_query($sql_det);
- }
- //$user_id=$_REQUEST['id'];
- $this->data['Music']['menu'] = $_REQUEST['menu'];
- if(isset($_REQUEST['page']))
- {
- $page = $_REQUEST['page'];
- }
- $this->flash('The post with id: '.$id.' has been deleted.', '/posts');
- $this->redirect('/musics/managehotmusic?menu='.$this->data['Music']['menu'].'&page='.$page);
- }
- function add_hotmusic()
- {
- $this->checkSession();
- $this->layout = 'default_user';
-
- /* Grtting the Music caltegory*/
- $music_cat = array();
- $music_cat[0] = "Select Category";
- $select_music_category = mysql_query("Select * from music_categories");
- while($select_music_category_res = mysql_fetch_array($select_music_category))
- {
- $music_cat[$select_music_category_res['id']] = $select_music_category_res['music_cat_name'] ;
- }
- $this->set('music_category',$music_cat);
-
- }
- function addhotmusicstep2()
- {
- $this->checkSession();
- $this->layout = 'default_user';
- //pr($_REQUEST);
- /* Insert into table name */
- $inserhot = "INSERT INTO `music_hot` ( `id` , `title` , `music_desc` , `file_name` , `url` , `music_id` )
- VALUES ('', '".$_REQUEST['hottitle']."', '', '', '', '".$_REQUEST['musicinfo']."')" ;
- $inserhot_res = mysql_query($inserhot);
- $inserhot_res_id = mysql_insert_id();
- $this->redirect('/musics/edithotmusicphoto?id='.$inserhot_res_id);
-
- }
- function managefeaturedmusic()
- {
- $this->checkSession();
- $this->layout = 'default_user';
- }
-
-
-
- function delete_featuredmusicgroup()
- {
- $this->checkSession();
- if(isset($_REQUEST['box']))
- {
- /////IF SEARCH IS COLLECTIVE OR CHOSEN BY ADMIN SELECTION//////
-
- $arr = $_REQUEST['box'];
- foreach($arr as $key => $value)
- {
- $sql_det = "delete from `music_featured` where `id` = '".$value."'";
- $res_det = mysql_query($sql_det);
- }
- }
- ////IF DELETE IS FOR A SPECIFIC USER////
- else
- {
- $user_id=$_REQUEST['id'];
- $this->data['Music']['menu'] = $_REQUEST['menu'];
- $sql_det = "delete from `music_featured` where `id` = '".$user_id."'";
- $res_det = mysql_query($sql_det);
- }
- //$user_id=$_REQUEST['id'];
- $this->data['Music']['menu'] = $_REQUEST['menu'];
- if(isset($_REQUEST['page']))
- {
- $page = $_REQUEST['page'];
- }
- $this->flash('The post with id: '.$id.' has been deleted.', '/posts');
- $this->redirect('/musics/managefeaturedmusic?menu='.$this->data['Music']['menu'].'&page='.$page);
-
- }
- function delfeaturedmusic()
- {
- $this->checkSession();
- $this->layout = 'default_user';
- /* delete hot music */
- $delhot = mysql_query("Delete From music_featured where id=".$_REQUEST['id']."");
-
- $this->redirect('/musics/managefeaturedmusic?menu='.$_REQUEST['menu']);
-
- }
- function listenfeaturedmusic()
- {
- $this->checkSession();
- $this->layout = 'default_user';
- }
- function editfeaturedmusic()
- {
- $this->checkSession();
- $this->layout = 'default_user';
- $music_cat = array();
- $music_cat[0] = "Select Category";
- $select_music_category = mysql_query("Select * from music_categories");
- while($select_music_category_res = mysql_fetch_array($select_music_category))
- {
- $music_cat[$select_music_category_res['id']] = $select_music_category_res['music_cat_name'] ;
- }
- $this->set('music_category',$music_cat);
-
- }
- function saveeditfeaturedmusic()
- {
- $update_sql = "Update music_featured set title='".$_REQUEST['mustitle']."' , music_id =".$_REQUEST['musicinfo']." where id=".$_REQUEST['hid']."";
- mysql_query($update_sql);
- $this->redirect('/musics/editfeaturedmusicphoto?id='.$_REQUEST['hid']);
- }
- function editfeaturedmusicphoto()
- {
- $this->checkSession();
- $this->layout = 'default_user';
-
- }
- function managemusiccategory()
- {
- $this->checkSession();
- $this->layout = 'default_user';
- }
- function editbackdropcategory()
- {
- $this->checkSession();
- $this->layout = 'default_user';
- /* Get the category name*/
- $category_sql = "select * from backdrop_categories where id=".$_REQUEST['id']."";
- $category_res = mysql_fetch_array(mysql_query($category_sql));
- $this->set('catname', $category_res['backdrop_cat_name']);
- $this->set('catid', $category_res['id']);
-
- /**/
-
- }
- function saveeditcategory()
- {
- $this->checkSession();
- $this->layout = 'default_user';
-
- /* Updation Table name */
- if($_REQUEST['cattitle']!="")
- {
- $update_sql = "Update backdrop_categories set backdrop_cat_name='".addslashes($_REQUEST['cattitle'])."' where id = ".$_REQUEST['cid']."";
- mysql_query($update_sql);
- }
- $this->redirect('/backdrop/managebackdropcategory');
- /**/
-
- }
- function add_backdrop_category()
- {
- $this->checkSession();
- $this->layout = 'default_user';
- }
- function savenewcategory()
- {
- $this->checkSession();
- $this->layout = 'default_user';
-
- /* Updation Table name */
- if($_REQUEST['cattitle']!="")
- {
- $update_sql = "insert into backdrop_categories set backdrop_cat_name='".addslashes($_REQUEST['cattitle'])."'";
- mysql_query($update_sql);
- $catid = mysql_insert_id();
-
- }
- $this->redirect('/backdrop/managebackdropcategory');
- /**/
-
- }
- function managebackdropshipping()
- {
- $this->checkSession();
- $this->layout = 'default_user';
- if(isset($_REQUEST['pageaction']) && $_REQUEST['pageaction']!='')
- {
- if($_REQUEST['pageaction']=='block')
- {
- foreach($_REQUEST['box'] as $boxindex=>$boxvalue)
- {
- $updatesql = "UPDATE backdrop_shipping_master set blocked='1' where id='".$boxvalue."' and is_admin='1' and user_id='".$_SESSION['Admin_id']."'";
- $updatesql_res = mysql_query($updatesql);
- }
- }
- if($_REQUEST['pageaction']=='unblock')
- {
- foreach($_REQUEST['box'] as $boxindex=>$boxvalue)
- {
- $updatesql = "UPDATE backdrop_shipping_master set blocked='0' where id='".$boxvalue."' and is_admin='1' and user_id='".$_SESSION['Admin_id']."'";
- $updatesql_res = mysql_query($updatesql);
- }
- }
- if($_REQUEST['pageaction']=='delete')
- {
- foreach($_REQUEST['box'] as $boxindex=>$boxvalue)
- {
- $updatesql = "DELETE from backdrop_shipping_list where backdrop_shipping_master_id='".$boxvalue."' and user_id='".$_SESSION['Admin_id']."'";
- $updatesql_res = mysql_query($updatesql);
-
- $updatesql = "DELETE from backdrop_shipping_master where id='".$boxvalue."' and is_admin='1' and user_id='".$_SESSION['Admin_id']."'";
- $updatesql_res = mysql_query($updatesql);
- }
- }
-
- }
-
-
-
- }
- function editshippingcategory($shipid=null)
- {
- $this->checkSession();
- $this->layout = 'default_user';
- /* Shipping information */
- $shipcatsql = " SELECT * from backdrop_shipping_master where id='".base64_decode($shipid)."'";
- $shipcatsql_res = mysql_query($shipcatsql);
- $shipcatsql_arr = mysql_fetch_array($shipcatsql_res);
-
- $this->set('categoryName',$shipcatsql_arr['order_name']);
- $this->set('categoryDesc',$shipcatsql_arr['order_desc']);
- $this->set('categoryId',$shipcatsql_arr['id']);
- }
- function copyshippingcategory($shipid=null)
- {
- $this->checkSession();
- $this->layout = 'default_user';
- /* Shipping information */
- $shipcatsql = " SELECT * from backdrop_shipping_master where id='".base64_decode($shipid)."'";
- $shipcatsql_res = mysql_query($shipcatsql);
- $shipcatsql_arr = mysql_fetch_array($shipcatsql_res);
-
- $this->set('categoryName','Copy of '.$shipcatsql_arr['order_name']);
- $this->set('categoryDesc',$shipcatsql_arr['order_desc']);
- $this->set('categoryId',$shipcatsql_arr['id']);
- }
- function savecreatebackdropshipping()
- {
- $this->checkSession();
- $this->layout = 'default_user';
- if(isset($_REQUEST['shipcat']) && strlen($_REQUEST['shipcat'])>0)
- {
- $updatesql = "INSERT INTO backdrop_shipping_master set order_name='".addslashes($_REQUEST['shipcat'])."' ,order_desc='".addslashes($_REQUEST['shipcatdesc'])."', is_admin='1' , user_id='".$_SESSION['Admin_id']."'";
- $updatesql_res = mysql_query($updatesql);
- }
- $this->redirect('/backdrop/managebackdropshipping');
- }
-
- function savebackdropshipping()
- {
- $this->checkSession();
- $this->layout = 'default_user';
- if(isset($_REQUEST['shipcat']) && strlen($_REQUEST['shipcat'])>0)
- {
- if(isset($_REQUEST['catid']) && $_REQUEST['catid']>0)
- {
- $updatesql = "UPDATE backdrop_shipping_master set order_name='".addslashes($_REQUEST['shipcat'])."' ,order_desc='".addslashes($_REQUEST['shipcatdesc'])."' where id='".$_REQUEST['catid']."' and is_admin='1' and user_id='".$_SESSION['Admin_id']."'";
- $updatesql_res = mysql_query($updatesql);
- }
- }
-
- $this->redirect('/backdrop/managebackdropshipping');
- }
- function savecopybackdropshipping()
- {
- $this->checkSession();
- $this->layout = 'default_user';
- $catauth = "select * from backdrop_shipping_master where user_id = ".$_SESSION['Admin_id']." and order_name='".addslashes($_REQUEST['shipcat'])."'";
-
- $cataut_res = mysql_query($catauth);
- if(mysql_num_rows($cataut_res)==0)
- {
- if($_REQUEST['shipcat']!="")
- {
- $insert_sql = "Insert Into backdrop_shipping_master set is_admin='1',user_id= ".$_SESSION['Admin_id'].",order_name='".addslashes($_REQUEST['shipcat'])."', order_desc='".addslashes($_REQUEST['shipcatdesc'])."'";
- mysql_query($insert_sql);
- $newship = mysql_insert_id();
-
- if(isset($_REQUEST['catid']) && $_REQUEST['catid']!="")
- {
-
- $copyProduct = "INSERT INTO backdrop_shipping_list(backdrop_shipping_master_id,user_id,ship_name,ship_product_name,ship_price_from,ship_price_to,ship_postage)
- SELECT '$newship',user_id,ship_name,ship_product_name,ship_price_from,ship_price_to,ship_postage
- FROM backdrop_shipping_list where backdrop_shipping_master_id=".$_REQUEST['catid']."";
-
- mysql_query($copyProduct) ;
- }
- }
- }
-
- $this->redirect('/backdrop/managebackdropshipping');
-
- }
- function blockshippingcategory($backdrpid=null,$backdropstatus=null)
- {
- $this->checkSession();
- $this->layout = 'default_user';
-
- if($backdropstatus=='block')
- {
- $updatesql = "UPDATE backdrop_shipping_master set blocked='1' where id='".base64_decode($backdrpid)."' and is_admin='1' and user_id='".$_SESSION['Admin_id']."'";
- $updatesql_res = mysql_query($updatesql);
- }
- else
- {
- $updatesql = "UPDATE backdrop_shipping_master set blocked='0' where id='".base64_decode($backdrpid)."' and is_admin='1' and user_id='".$_SESSION['Admin_id']."'";
- $updatesql_res = mysql_query($updatesql);
- }
-
- $this->redirect('/backdrop/managebackdropshipping');
- }
- function delshippingcategory($backdrpid=null)
- {
- $this->checkSession();
- $this->layout = 'default_user';
- $updatesql = "DELETE from backdrop_shipping_list where backdrop_shipping_master_id='".base64_decode($backdrpid)."' and user_id='".$_SESSION['Admin_id']."'";
- $updatesql_res = mysql_query($updatesql);
-
- $updatesql = "DELETE from backdrop_shipping_master where id='".base64_decode($backdrpid)."' and is_admin='1' and user_id='".$_SESSION['Admin_id']."'";
- $updatesql_res = mysql_query($updatesql);
- $this->redirect('/backdrop/managebackdropshipping');
- }
-
- function createshipping()
- {
- $this->checkSession();
- $this->layout = 'default_user';
-
- }
- function shippinglist($baccatid=null)
- {
- $this->checkSession();
- $this->layout = 'default_user';
- $this->set('catid', $baccatid );
-
- if(isset($_REQUEST['pageaction']) && $_REQUEST['pageaction']=='delete')
- {
- foreach($_REQUEST['box'] as $boxindex=>$boxvalue)
- {
- $updatesql = "DELETE from backdrop_shipping_list where id='".$boxvalue."' and user_id='".$_SESSION['Admin_id']."'";
- $updatesql_res = mysql_query($updatesql);
- }
- }
-
-
- }
- function createshippinglist($catid=null)
- {
- $this->checkSession();
- $this->layout = 'default_user';
- $this->set('shipcatid', $catid);
- }
- function savecreatebackdropshippinglist()
- {
- $this->checkSession();
- $this->layout = 'default_user';
-
- $selectShipping = "Select * from backdrop_shipping_list where user_id=".$_SESSION['Admin_id']." and backdrop_shipping_master_id = ".$_REQUEST['editshipcat']." and ship_product_name = '".$_REQUEST['shipproduct']."' and ".$_POST['price_from']." between ship_price_from and ship_price_to";
-
- $ResCheckDiscFrom = mysql_query($selectShipping) or die('Line No 353');
- $NumResCheckDiscFrom = mysql_num_rows($ResCheckDiscFrom);
-
- if($_POST['price_to']!="")
- {
- $selectShipping = "Select * from backdrop_shipping_list where user_id=".$_SESSION['Admin_id']." and backdrop_shipping_master_id = ".$_REQUEST['editshipcat']." and ship_product_name = '".$_REQUEST['shipproduct']."' and ".$_POST['price_to']." between ship_price_from and ship_price_to";
-
- $ResCheckDiscTo = mysql_query($selectShipping) or die('Line No 360');
- $NumResCheckDiscTo = mysql_num_rows($ResCheckDiscTo);
- }
- else
- $NumResCheckDiscTo = 0;
-
- if($_POST['price_to']=="")
- $_POST['price_to'] = 0;
-
- if($NumResCheckDiscFrom==0 && $NumResCheckDiscTo==0)
- {
- $sql_insert_discount = "INSERT into backdrop_shipping_list SET backdrop_shipping_master_id = ".$_REQUEST['editshipcat'].",ship_product_name = '".$_REQUEST['shipproduct']."' , ship_price_from=".$_POST['price_from'].",ship_price_to=".$_POST['price_to'].",ship_postage=".$_POST['shipping_postage'].",user_id=".$_SESSION['Admin_id']."";
- $res_insert_discount = mysql_query($sql_insert_discount) or die(mysql_error().'Line No 40') ;
- $mid=mysql_insert_id();
-
- }
- $backUrl = "backdrop/shippinglist/".base64_encode($_REQUEST['editshipcat']) ;
- $this->redirect($backUrl);
- }
- function editshippingcategorylist($bacshipid=null)
- {
- $this->checkSession();
- $this->layout = 'default_user';
-
- $catauth = "select * from backdrop_shipping_list where id=".base64_decode($bacshipid)."";
- $cataut_res = mysql_query($catauth);
- $catauth_arr = mysql_fetch_array($cataut_res);
- $shipname = $catauth_arr['ship_name'];
- $shipprodname = $catauth_arr['ship_product_name'];
- $shippricefrom = $catauth_arr['ship_price_from'];
- $shippriceto = $catauth_arr['ship_price_to'];
- $shippostage = $catauth_arr['ship_postage'];
- $shipcatid = $catauth_arr['backdrop_shipping_master_id'];
-
- $this->set('shipName',$shipname);
- $this->set('shipprodname',$shipprodname);
- $this->set('shipprfrm',$shippricefrom);
- $this->set('shipprto',$shippriceto);
- $this->set('shippost',$shippostage);
- $this->set('shipcatid',$shipcatid);
- $this->set('shiprecid',base64_decode($bacshipid));
-
-
- }
- function saveeditbackdropshippinglist()
- {
- $this->checkSession();
- $this->layout = 'default_user';
-
- $selectShipping = "Select * from backdrop_shipping_list where user_id=".$_SESSION['Admin_id']." and backdrop_shipping_master_id = ".$_REQUEST['editshipcat']." and ship_product_name = '".$_REQUEST['shipproduct']."' and ".$_POST['price_from']." between ship_price_from and ship_price_to and id!=".$_REQUEST['recordid']."";
-
- $ResCheckDiscFrom = mysql_query($selectShipping) or die('Line No 353');
- $NumResCheckDiscFrom = mysql_num_rows($ResCheckDiscFrom);
-
- if($_POST['price_to']!="")
- {
- $selectShipping = "Select * from backdrop_shipping_list where user_id=".$_SESSION['Admin_id']." and backdrop_shipping_master_id = ".$_REQUEST['editshipcat']." and ship_product_name = '".$_REQUEST['shipproduct']."' and ".$_POST['price_to']." between ship_price_from and ship_price_to and id!=".$_REQUEST['recordid']."";
-
- $ResCheckDiscTo = mysql_query($selectShipping) or die('Line No 360');
- $NumResCheckDiscTo = mysql_num_rows($ResCheckDiscTo);
- }
- else
- $NumResCheckDiscTo = 0;
-
- if($_POST['price_to']=="")
- $_POST['price_to'] = 0;
-
- if($NumResCheckDiscFrom==0 && $NumResCheckDiscTo==0)
- {
-
- $order_sql = mysql_query("Select order_name from backdrop_shipping_master where id=".$_REQUEST['editshipcat']."") or die(mysql_error());
- $arr_order = mysql_fetch_array($order_sql);
-
- $sql_insert_discount = "Update backdrop_shipping_list SET backdrop_shipping_master_id = ".$_REQUEST['editshipcat'].", ship_product_name = '".$_REQUEST['shipproduct']."' , ship_price_from=".$_POST['price_from'].",ship_price_to=".$_POST['price_to'].",ship_postage=".$_POST['shipping_postage']." where id=".$_REQUEST['recordid']." and user_id=".$_SESSION['Admin_id']."";
-
-
- $res_insert_discount = mysql_query($sql_insert_discount) or die('Line No 40') ;
- }
- $backUrl = "backdrop/shippinglist/".base64_encode($_REQUEST['editshipcat'] );
- $this->redirect($backUrl);
-
- }
- function copyshippingcategorylist($bacshipid=null)
- {
- $this->checkSession();
- $this->layout = 'default_user';
-
- $catauth = "select * from backdrop_shipping_list where id=".base64_decode($bacshipid)."";
- $cataut_res = mysql_query($catauth);
- $catauth_arr = mysql_fetch_array($cataut_res);
- $shipname = $catauth_arr['ship_name'];
- $shipprodname = $catauth_arr['ship_product_name'];
- $shippricefrom = $catauth_arr['ship_price_from'];
- $shippriceto = $catauth_arr['ship_price_to'];
- $shippostage = $catauth_arr['ship_postage'];
- $shipcatid = $catauth_arr['backdrop_shipping_master_id'];
-
- $this->set('shipName',$shipname);
- $this->set('shipprodName',$shipprodname);
- $this->set('shipprfrm',$shippricefrom);
- $this->set('shipprto',$shippriceto);
- $this->set('shippost',$shippostage);
- $this->set('shipcatid',$shipcatid);
- $this->set('shiprecid',base64_decode($bacshipid));
-
-
- }
- function savecopybackdropshippinglist()
- {
- $this->checkSession();
- $this->layout = 'default_user';
-
- $selectShipping = "Select * from backdrop_shipping_list where user_id=".$_SESSION['Admin_id']." and backdrop_shipping_master_id = ".$_REQUEST['editshipcat']." and ship_product_name = '".$_REQUEST['shipproduct']."' and ".$_POST['price_from']." between ship_price_from and ship_price_to and id!=".$_REQUEST['recordid']."";
-
- $ResCheckDiscFrom = mysql_query($selectShipping) or die('Line No 353');
- $NumResCheckDiscFrom = mysql_num_rows($ResCheckDiscFrom);
-
- if($_POST['price_to']!="")
- {
- $selectShipping = "Select * from backdrop_shipping_list where user_id=".$_SESSION['Admin_id']." and backdrop_shipping_master_id = ".$_REQUEST['editshipcat']." and ship_product_name = '".$_REQUEST['shipproduct']."' and ".$_POST['price_to']." between ship_price_from and ship_price_to and id!=".$_REQUEST['recordid']."";
-
- $ResCheckDiscTo = mysql_query($selectShipping) or die('Line No 360');
- $NumResCheckDiscTo = mysql_num_rows($ResCheckDiscTo);
- }
- else
- $NumResCheckDiscTo = 0;
-
- if($_POST['price_to']=="")
- $_POST['price_to'] = 0;
-
- if($NumResCheckDiscFrom==0 && $NumResCheckDiscTo==0)
- {
-
- $sql_insert_discount = "INSERT into backdrop_shipping_list SET backdrop_shipping_master_id = ".$_REQUEST['editshipcat'].",ship_product_name = '".$_REQUEST['shipproduct']."',ship_price_from=".$_POST['price_from'].",ship_price_to=".$_POST['price_to'].",ship_postage=".$_POST['shipping_postage'].",user_id=".$_SESSION['Admin_id']."";
- $res_insert_discount = mysql_query($sql_insert_discount) or die('Line No 40') ;
- $mid=mysql_insert_id();
-
- }
- $backUrl = "backdrop/shippinglist/".base64_encode($_REQUEST['editshipcat']) ;
- $this->redirect($backUrl);
-
-
- }
- function delshippingcategorylist($shipid = null)
- {
- $this->checkSession();
- $this->layout = 'default_user';
-
- if($shipid)
- {
- $delqury = "DELETE from backdrop_shipping_list where id='".base64_decode($shipid)."' and user_id='".$_SESSION['Admin_id']."'";
- mysql_query($delqury);
- }
- $this->redirect($_SERVER['HTTP_REFERER']);
- }
- function managebackdropsaletax()
- {
- $this->checkSession();
- $this->layout = 'default_user';
- if(isset($this->data['Sale']['tax']))
- {
- mysql_query("UPDATE backdrop_saletax SET tax='".$this->data['Sale']['tax']."' WHERE user_id='".$this->data['Sale']['uid']."' AND is_admin='1' AND state_id='".$this->data['Sale']['sid']."'") or die(mysql_error());
- }
-
-
- $saletaxarr = array();
- $sqlsatetax = "select countries.id , countries.country_name , backdrop_saletax.user_id from backdrop_saletax , state , countries where user_id = ".$_SESSION['Admin_id']." and is_admin='1' and state_id=state.id and state.c_id=countries.id Group by countries.id";
- $sqlsatetax_res = mysql_query($sqlsatetax);
- $sqlsatetax_num = mysql_num_rows($sqlsatetax_res);
- if($sqlsatetax_num > 0)
- {
- while($sqlsatetax_res_arr = mysql_fetch_array($sqlsatetax_res))
- {
- $saletaxarr[$sqlsatetax_res_arr['id']] = $sqlsatetax_res_arr['country_name'] ;
- }
-
- }
- $this->set('saltaxnum', $sqlsatetax_num);
- $this->set('saltaxinfo', $saletaxarr);
- }
- function savesaletax()
- {
- $this->checkSession();
- $this->layout = 'default_user';
- $this->pageTitle = 'Sale Tax';
- $stateTax = $_REQUEST['saletax'] ;
- foreach($stateTax as $stateTax_index=> $stateTax_value )
- {
- if(isset($_REQUEST['saletax'][$stateTax_index]) && $_REQUEST['saletax'][$stateTax_index]!="")
- {
- $mynumber = $_REQUEST['saletax'][$stateTax_index] ;
- if($mynumber>0)
- {
- if (preg_match ("/^([0-9.,-]+)$/", $mynumber)) {
-
- /* Saving in the sale tax */
- $selectrec = "select * from backdrop_saletax where user_id = ".$_SESSION['Admin_id']." and state_id = ".$stateTax_index." and is_admin='1'" ;
- $selectrec_res = mysql_query($selectrec);
- if(mysql_num_rows($selectrec_res)>0)
- {
- $saletaxsql = "Update backdrop_saletax SET tax = ".$mynumber." where user_id = ".$_SESSION['Admin_id']." and state_id = ".$stateTax_index." and is_admin='1'" ;
- }
- else
- {
- $saletaxsql = "INSERT INTO backdrop_saletax SET tax = ".$mynumber." , user_id = ".$_SESSION['Admin_id']." , state_id = ".$stateTax_index.",is_admin='1'" ;
- }
- mysql_query($saletaxsql)or die(mysql_error());
- /* */
-
- }
- }
- }
-
- }
-
- $redirectURL = "backdrop/managebackdropsaletax";
- $this->redirect($redirectURL);
-
- }
-
- function activeshippingcategory($backdropid)
- {
- if(base64_decode($backdropid)>0)
- {
- $updateqry = "UPDATE backdrop_shipping_master SET is_active='1' Where user_id='".$_SESSION['Admin_id']."' and is_admin='1' and id='".base64_decode($backdropid)."'";
- $updateqry_res = mysql_query($updateqry);
- }
- else
- {
- $updateqry = "UPDATE backdrop_shipping_master SET is_active='0' Where user_id='".$_SESSION['Admin_id']."' and is_admin='1' and id!='".base64_decode($backdropid)."'";
- $updateqry_res = mysql_query($updateqry);
- }
- $redirectURL = "backdrop/managebackdropshipping";
- $this->redirect($redirectURL);
-
- }
-
- function managebackdropproduct()
- {
- $this->checkSession();
- $this->layout = 'default_user';
- if(isset($_REQUEST['pageaction']) && $_REQUEST['pageaction']!='')
- {
- if($_REQUEST['pageaction']=='block')
- {
- foreach($_REQUEST['box'] as $boxindex=>$boxvalue)
- {
- $updatesql = "UPDATE backdrop_product_master set blocked='1' where id='".$boxvalue."' and is_admin='1' and user_id='".$_SESSION['Admin_id']."'";
- $updatesql_res = mysql_query($updatesql);
- }
- }
- if($_REQUEST['pageaction']=='unblock')
- {
- foreach($_REQUEST['box'] as $boxindex=>$boxvalue)
- {
- $updatesql = "UPDATE backdrop_product_master set blocked='0' where id='".$boxvalue."' and is_admin='1' and user_id='".$_SESSION['Admin_id']."'";
- $updatesql_res = mysql_query($updatesql);
- }
- }
- if($_REQUEST['pageaction']=='delete')
- {
- foreach($_REQUEST['box'] as $boxindex=>$boxvalue)
- {
- $updatesql = "DELETE from backdrop_product_list where backdrop_shipping_master_id='".$boxvalue."' and user_id='".$_SESSION['Admin_id']."'";
- $updatesql_res = mysql_query($updatesql);
-
- $updatesql = "DELETE from backdrop_product_master where id='".$boxvalue."' and is_admin='1' and user_id='".$_SESSION['Admin_id']."'";
- $updatesql_res = mysql_query($updatesql);
- }
- }
-
- }
-
-
-
- }
- function editproductcategory($shipid=null)
- {
- $this->checkSession();
- $this->layout = 'default_user';
- /* Shipping information */
- $shipcatsql = " SELECT * from backdrop_product_master where id='".base64_decode($shipid)."'";
- $shipcatsql_res = mysql_query($shipcatsql);
- $shipcatsql_arr = mysql_fetch_array($shipcatsql_res);
-
- $this->set('categoryName',$shipcatsql_arr['order_name']);
- $this->set('categoryDesc',$shipcatsql_arr['order_desc']);
- $this->set('categoryId',$shipcatsql_arr['id']);
- }
-
- function saveeditproductcategory()
- {
- $this->checkSession();
- $this->layout = 'default_user';
-
- /* Updation Table name */
- if($_REQUEST['cattitle']!="")
- {
- echo $update_sql = "Update backdrop_product_master set order_name='".addslashes($_REQUEST['cattitle'])."',order_desc='".addslashes($_REQUEST['prodcatdesc'])."' where id = ".$_REQUEST['cid']."";
- mysql_query($update_sql);
- }
- $this->redirect('/backdrop/managebackdropproduct');
- /**/
-
- }
- function copyproductcategory($shipid=null)
- {
- $this->checkSession();
- $this->layout = 'default_user';
- /* Shipping information */
- $shipcatsql = " SELECT * from backdrop_product_master where id='".base64_decode($shipid)."'";
- $shipcatsql_res = mysql_query($shipcatsql);
- $shipcatsql_arr = mysql_fetch_array($shipcatsql_res);
-
- $this->set('categoryName','Copy of '.$shipcatsql_arr['order_name']);
- $this->set('categoryDesc',$shipcatsql_arr['order_desc']);
- $this->set('categoryId',$shipcatsql_arr['id']);
- }
- function savecopybackdropproduct()
- {
- $this->checkSession();
- $this->layout = 'default_user';
- $catauth = "select * from backdrop_product_master where order_name='".addslashes($_REQUEST['shipcat'])."'";
-
- $cataut_res = mysql_query($catauth);
- if(mysql_num_rows($cataut_res)==0)
- {
- if($_REQUEST['shipcat']!="")
- {
- $insert_sql = "Insert Into backdrop_product_master SET order_name='".addslashes($_REQUEST['shipcat'])."', order_desc='".addslashes($_REQUEST['shipcatdesc'])."'";
- mysql_query($insert_sql);
- $newship = mysql_insert_id();
-
- if(isset($_REQUEST['catid']) && $_REQUEST['catid']!="")
- {
-
- $copyProduct = "INSERT INTO backdrop_product_list(backdrop_product_master_id,product_name,product_desc,price)
- SELECT '$newship',product_name,product_desc,price
- FROM backdrop_product_list where backdrop_product_master_id=".$_REQUEST['catid']."";
-
- mysql_query($copyProduct) ;
- }
- }
- }
-
- $this->redirect('/backdrop/managebackdropproduct');
-
- }
- function blockproductcategory($backdrpid=null,$backdropstatus=null)
- {
- $this->checkSession();
- $this->layout = 'default_user';
-
- if($backdropstatus=='block')
- {
- $updatesql = "UPDATE backdrop_product_master set blocked='1' where id='".base64_decode($backdrpid)."'";
- $updatesql_res = mysql_query($updatesql);
- }
- else
- {
- $updatesql = "UPDATE backdrop_product_master set blocked='0' where id='".base64_decode($backdrpid)."'";
- $updatesql_res = mysql_query($updatesql);
- }
-
- $this->redirect('/backdrop/managebackdropproduct');
- }
- function delproductcategory($backdrpid=null)
- {
- $this->checkSession();
- $this->layout = 'default_user';
- $updatesql = "DELETE from backdrop_product_list where backdrop_shipping_master_id='".base64_decode($backdrpid)."'";
- $updatesql_res = mysql_query($updatesql);
-
- $updatesql = "DELETE from backdrop_product_master where id='".base64_decode($backdrpid)."'";
- $updatesql_res = mysql_query($updatesql);
- $this->redirect('/backdrop/managebackdropproduct');
- }
-
- function createproductcategory()
- {
- $this->checkSession();
- $this->layout = 'default_user';
-
- }
- function savecreatebackdropproduct()
- {
- $this->checkSession();
- $this->layout = 'default_user';
- if(isset($_REQUEST['shipcat']) && strlen($_REQUEST['shipcat'])>0)
- {
- $updatesql = "INSERT INTO backdrop_product_master set order_name='".addslashes($_REQUEST['shipcat'])."' ,order_desc='".addslashes($_REQUEST['shipcatdesc'])."'";
- $updatesql_res = mysql_query($updatesql);
- }
- $this->redirect('/backdrop/managebackdropproduct');
- }
- function productlist($baccatid=null)
- {
- $this->checkSession();
- $this->layout = 'default_user';
- $this->set('catid', $baccatid );
-
- if(isset($_REQUEST['pageaction']) && $_REQUEST['pageaction']=='delete')
- {
- foreach($_REQUEST['box'] as $boxindex=>$boxvalue)
- {
- $updatesql = "DELETE from backdrop_product_list where id='".$boxvalue."'";
- $updatesql_res = mysql_query($updatesql);
- }
- }
-
-
- }
- function savecreatebackdropproductlist()
- {
- $this->checkSession();
- $this->layout = 'default_user';
-
- $selectShipping = "Select * from backdrop_product_list where backdrop_product_master_id = ".$_REQUEST['editshipcat']." and product_name = '".$_REQUEST['shipproduct']."'";
-
- $ResCheckDiscFrom = mysql_query($selectShipping) or die('Line No 353');
- $NumResCheckDiscFrom = mysql_num_rows($ResCheckDiscFrom);
- if($NumResCheckDiscFrom==0 )
- {
- $sql_insert_discount = "INSERT into backdrop_product_list SET backdrop_product_master_id = ".$_REQUEST['editshipcat'].",product_name = '".$_REQUEST['shipproduct']."'";
- $res_insert_discount = mysql_query($sql_insert_discount) or die(mysql_error().'Line No 40') ;
- $mid=mysql_insert_id();
-
- }
- $backUrl = "backdrop/productlist/".base64_encode($_REQUEST['editshipcat']) ;
- $this->redirect($backUrl);
- }
- function createproductlist($catid=null)
- {
- $this->checkSession();
- $this->layout = 'default_user';
- $this->set('shipcatid', $catid);
- }
- function editshippingproductlist($bacshipid=null)
- {
- $this->checkSession();
- $this->layout = 'default_user';
-
- $catauth = "select * from backdrop_product_list where id=".base64_decode($bacshipid)."";
- $cataut_res = mysql_query($catauth);
- $catauth_arr = mysql_fetch_array($cataut_res);
- $shipprodname = $catauth_arr['product_name'];
- $shippricefrom = $catauth_arr['price'];
- $shipcatid = $catauth_arr['backdrop_product_master_id'];
-
- $this->set('prodName',$shipprodname);
- $this->set('prodPrice',$shippricefrom);
- $this->set('prodcatid',$shipcatid);
- $this->set('prodrecid',base64_decode($bacshipid));
-
-
- }
- function saveeditbackdropproductlist()
- {
- $this->checkSession();
- $this->layout = 'default_user';
-
- $selectShipping = "Select * from backdrop_product_list where backdrop_product_master_id = ".$_REQUEST['editshipcat']." and product_name = '".$_REQUEST['shipproduct']."' and id!=".$_REQUEST['recordid']."";
-
- $ResCheckDiscFrom = mysql_query($selectShipping) or die('Line No 353');
- $NumResCheckDiscFrom = mysql_num_rows($ResCheckDiscFrom);
-
- if($NumResCheckDiscFrom==0)
- {
- $sql_insert_discount = "Update backdrop_product_list SET backdrop_product_master_id = ".$_REQUEST['editshipcat'].", product_name = '".$_REQUEST['shipproduct']."' where id=".$_REQUEST['recordid']."";
- $res_insert_discount = mysql_query($sql_insert_discount) or die('Line No 40') ;
- }
- $backUrl = "backdrop/productlist/".base64_encode($_REQUEST['editshipcat'] );
- $this->redirect($backUrl);
-
- }
- function copyshippingproductlist($bacshipid=null)
- {
- $this->checkSession();
- $this->layout = 'default_user';
-
- $catauth = "select * from backdrop_product_list where id=".base64_decode($bacshipid)."";
- $cataut_res = mysql_query($catauth);
- $catauth_arr = mysql_fetch_array($cataut_res);
- $shipprodname = $catauth_arr['product_name'];
- $shippricefrom = $catauth_arr['price'];
- $shipcatid = $catauth_arr['backdrop_product_master_id'];
-
- $this->set('prodName',$shipprodname);
- $this->set('prodPrice',$shippricefrom);
- $this->set('prodcatid',$shipcatid);
- $this->set('prodrecid',base64_decode($bacshipid));
-
-
- }
- function savecopybackdropproductlist()
- {
- $this->checkSession();
- $this->layout = 'default_user';
-
- $selectShipping = "Select * from backdrop_product_list where backdrop_product_master_id = ".$_REQUEST['editshipcat']." and product_name = '".$_REQUEST['shipproduct']."' and id!=".$_REQUEST['recordid']."";
-
- $ResCheckDiscFrom = mysql_query($selectShipping) or die('Line No 353');
- $NumResCheckDiscFrom = mysql_num_rows($ResCheckDiscFrom);
-
- if($NumResCheckDiscFrom==0)
- {
-
- $sql_insert_discount = "INSERT into backdrop_product_list SET backdrop_product_master_id = ".$_REQUEST['editshipcat'].",product_name = '".$_REQUEST['shipproduct']."'";
- $res_insert_discount = mysql_query($sql_insert_discount) or die('Line No 40') ;
- $mid=mysql_insert_id();
-
- }
- $backUrl = "backdrop/productlist/".base64_encode($_REQUEST['editshipcat']) ;
- $this->redirect($backUrl);
- }
- function delshippingproductlist($shipid = null)
- {
- $this->checkSession();
- $this->layout = 'default_user';
-
- if($shipid)
- {
- $delqury = "DELETE from backdrop_product_list where id='".base64_decode($shipid)."'";
- mysql_query($delqury);
- }
- $this->redirect($_SERVER['HTTP_REFERER']);
- }
-
- function backdropsales($backdropuserid=null)
- {
- //pr($this->data);
- $this->checkSession();
- $this->set('backdropuser',$backdropuserid);
- $this->layout = 'default_user';
- $this->pageTitle = 'Backdrop Sales';
- //$this->backdropcategory();
-
- $this->set("display","none");
- $this->set("custOpen","Open");
- $this->set("textMonth","month");
- $this->set("textDay","day");
- $this->set("textYear","year");
- $this->set("textMonth2","month");
- $this->set("textDay2","day");
- $this->set("textYear2","year");
-
- $this->set("textMonth_2","month");
- $this->set("textDay_2","day");
- $this->set("textYear_2","year");
- $this->set("textMonth2_2","month");
- $this->set("textDay2_2","day");
- $this->set("textYear2_2","year");
-
- $this->set("past");
- $this->set("eventName");
- $this->set("invoice");
- $this->set("userId");
- $this->set("fDate");
- $this->set("tDate");
- $this->set("dateErr");
- if(isset($this->data['Backdrop']['eventname']) && ($this->data['Backdrop']['eventname'])!="")
- …
Large files files are truncated, but you can click here to view the full file