commonfunctions->funsiteRuninIndia(); $lang = PROGRAMLANGUAGE; // $sPageTitle = "Inmonarch - $maincatname - $childcatname"; //$this -> set('sPageTitle',$sPageTitle); $CategoryArr2 = $this->Category->find('all', array('fields' => array('maincatid','maincatname','childcatname'),'conditions' => array('removed' => 'N','id'=>$childcatid),'limit'=>'1')); $maincatid=0; if(count($CategoryArr2)>0) { $maincatid=$CategoryArr2[0]['Category']['maincatid']; $maincatname=$CategoryArr2[0]['Category']['maincatname']; $childcatname=$CategoryArr2[0]['Category']['childcatname']; } $strlink=str_replace("'","_",$maincatname ); $this -> set('labelname',"$maincatname > $childcatname"); $this->set('childcatid', $childcatid); $this->set('maincatname', $maincatname); $this->set('childcatname', $childcatname); $BannerImage=""; $this->loadModel("Banner"); $BannerArr = $this->Banner->find('all', array('fields' => array('bannerimage','bannermap','desmap'),'conditions' => array('removed' => 'N','category_id'=>$childcatid,'catactive'=>'Y'),'order' => 'rand()','limit'=>'1')); if(count($BannerArr)>0) {$BannerImage=$BannerArr[0]['Banner']['bannerimage'];} else { $BannerArr = $this->Banner->find('all', array('fields' => array('bannerimage'),'conditions' => array('removed' => 'N'),'order' => 'rand()','limit'=>'1')); if(count($BannerArr)>0) {$BannerImage=$BannerArr[0]['Banner']['bannerimage'];} } $this->set('BannerImage', $BannerImage); $this->set('BannerArr', $BannerArr); //$condtions = "lngid='$lang' and lngid2='$lang' and lngid3='$lang' and Subcategory.removed='N' and childcatexist='Y' and subcatexist='Y' and Subcategory.childcatid=$childcatid "; # $criteria=NULL; # $order="subcatname Asc,id Asc"; # $arrSubcategory = $this->Subcategory->findAll($condtions, NULL, $order); // Extra parameters added # $this->set('arrSubcategory',$arrSubcategory); $arrSubcategory = $this->Subcategory->find('all', array( 'conditions' => array( 'Subcategory.removed' => 'N', 'childcatexist'=>'Y', 'subcatexist'=>'Y', 'Subcategory.childcatid'=>$childcatid, 'lngid2'=>$lang, 'lngid3'=>$lang, 'lngid'=>$lang ), 'Order'=>array('subcatname','id') )); $this->set('arrSubcategory',$arrSubcategory); $arrCategory = $this->Category->find('all', array('conditions' => array('Category.removed' => 'N','Category.id'=>$childcatid,'lngid2'=>$lang,'lngid'=>$lang))); $this->set('arrCategory',$arrCategory); $testimonaltitle=""; $postby=""; $testmetter=""; $this->loadModel("Testimonalview"); $TestimonalArr = $this->Testimonalview ->find('all', array('conditions' => array('removed' => 'N','category_id'=>$childcatid,'approved'=>'Y'),'order' => 'rand()','limit'=>'1')); if(count($TestimonalArr)>0) { $TestimonalArr=$TestimonalArr[0]; foreach($TestimonalArr as $key => $value) { $testimonalid=$value['id']; $testimonaltitle=$value['testimonaltitle']; $testmetter=$value['testmetter']; $postby=$value['postby']; } }else { $TestimonalArr = $this->Testimonalview ->find('all', array('conditions' => array('removed' => 'N','approved'=>'Y'),'order' => 'rand()','limit'=>'1')); if(count($TestimonalArr)>0) { $TestimonalArr=$TestimonalArr[0]; foreach($TestimonalArr as $key => $value) { $testimonalid=$value['id']; $testimonaltitle=$value['testimonaltitle']; $testmetter=$value['testmetter']; $postby=$value['postby']; } } } $this->set('testimonaltitle', $testimonaltitle); $this->set('postby', $postby); $this->set('testmetter', $testmetter); } function index($maincatid,$maincatname) { $this->commonfunctions->funsiteRuninIndia(); $lang = PROGRAMLANGUAGE; // $sPageTitle = "Monarch Garments - $maincatname"; // $this -> set('sPageTitle',$sPageTitle); //$strpath=$this->commonfunction->funCreatebookmarklink(); //$strpath=""; $MaincatArr = $this->Maincategory->find('all', array('fields' => array('maincatname'),'conditions' => array('removed' => 'N','id'=>$maincatid)), array('cache' => 'ItemMaincat', 'cacheConfig' => 'long')); if(count($MaincatArr)>0) { $maincatname=$MaincatArr[0]['Maincategory']['maincatname']; } $this -> set('labelname',"$maincatname"); $this->set('maincatid', $maincatid); $this->set('maincatname', $maincatname); $BannerImage=""; $this->loadModel("Banner"); //$BannerArr = $this->Banner->find('all', array('fields' => array('bannerimage'),'conditions' => array('removed' => 'N','maincategory_id'=>$maincatid),'order' => 'rand()','limit'=>'1')); $BannerArr = $this->Banner->find('all', array('fields' => array('bannerimage','bannermap','desmap'),'conditions' => array('removed' => 'N','maincategory_id'=>$maincatid,'catactive'=>'Y'),'order' => 'rand()','limit'=>'1'), array('cache' => 'BannerIndex', 'cacheConfig' => 'long')); if(count($BannerArr)>0) {$BannerImage=$BannerArr[0]['Banner']['bannerimage'];} else { //$BannerArr = $this->Banner->find('all', array('fields' => array('bannerimage'),'conditions' => array('removed' => 'N'),'order' => 'rand()','limit'=>'1')); $BannerArr = $this->Banner->find('all', array('fields' => array('bannerimage','bannermap','desmap'),'conditions' => array('removed' => 'N') ,'order' => 'rand()','limit'=>'1'), array('cache' => 'BannerIndex', 'cacheConfig' => 'long')); if(count($BannerArr)>0) {$BannerImage=$BannerArr[0]['Banner']['bannerimage'];} } $this->set('BannerImage', $BannerImage); $this->set('BannerArr', $BannerArr); //$arrMaincategory = $this->Maincategory->find('all', array('conditions' => array('Maincategory.removed' => 'N','Maincategory.id'=>$maincatid,'lngid'=>$lang))); $arrMaincategory = $this->Maincategory->find('all', array('conditions' => array('Maincategory.removed' => 'N','Maincategory.id'=>$maincatid,'lngid'=>$lang)), array('cache' => 'Maincategory', 'cacheConfig' => 'long')); $this->set('arrMaincategory',$arrMaincategory); //$condtions = "lngid='$lang' and lngid2='$lang' and Category.removed='N' and Category.maincatid=$maincatid "; $condtions = "Category.removed='N' and Category.maincatid='".$maincatid."' and lngid='".$lang."' and lngid2='".$lang."'"; $criteria=NULL; //list($order,$limit,$page) = $this->Pagination->init($condtions); // Added /*$this->paginate = array( 'conditions' => array($condtions), 'order' => array($order) );*/ $this->Pagination->modelClass = "Category"; list($order,$limit,$page) = $this->Pagination->init($condtions); // Added $order="childcatname Asc,id Asc"; $arrCategory = $this->Category->findAll($condtions, NULL, $order, $limit, $page); // Extra parameters added //$arrCategory = $this->Category->find('all', array('conditions' => array('Category.removed' => 'N','Category.maincatid'=>$maincatid,'lngid'=>$lang,'lngid2'=>$lang),'Order'=>array('childcatname','id'))); //$arrCategory = $this->Category->find('all', array('conditions' => array('Category.removed' => 'N','Category.maincatid'=>$maincatid,'lngid'=>$lang,'lngid2'=>$lang),'Order'=>array('childcatname','id')), array('cache' => 'Category', 'cacheConfig' => 'long')); //$arrCategory = $this->paginate('Category'); $this->set('arrCategory',$arrCategory); $testimonaltitle=""; $postby=""; $testmetter=""; $this->loadModel("Testimonalview"); //$TestimonalArr = $this->Testimonalview ->find('all', array('conditions' => array('removed' => 'N','maincategory_id'=>$maincatid,'approved'=>'Y'),'order' => 'rand()','limit'=>'1')); $TestimonalArr = $this->Testimonalview ->find('all', array('conditions' => array('removed' => 'N','maincategory_id'=>$maincatid,'approved'=>'Y'),'order' => 'rand()','limit'=>'1'), array('cache' => 'Category', 'cacheConfig' => 'long')); if(count($TestimonalArr)>0) { $TestimonalArr=$TestimonalArr[0]; foreach($TestimonalArr as $key => $value) { $testimonalid=$value['id']; $testimonaltitle=$value['testimonaltitle']; $testmetter=$value['testmetter']; $postby=$value['postby']; } }else { //$TestimonalArr = $this->Testimonalview ->find('all', array('conditions' => array('removed' => 'N','approved'=>'Y'),'order' => 'rand()','limit'=>'1')); $TestimonalArr = $this->Testimonalview ->find('all', array('conditions' => array('removed' => 'N','approved'=>'Y'),'order' => 'rand()','limit'=>'1'), array('cache' => 'Category', 'cacheConfig' => 'long')); if(count($TestimonalArr)>0) { $TestimonalArr=$TestimonalArr[0]; foreach($TestimonalArr as $key => $value) { $testimonalid=$value['id']; $testimonaltitle=$value['testimonaltitle']; $testmetter=$value['testmetter']; $postby=$value['postby']; } } } $this->set('testimonaltitle', $testimonaltitle); $this->set('postby', $postby); $this->set('testmetter', $testmetter); } function product($maincatid=null,$childcatid=null,$subcatid=null,$maincatName=null,$childcatName=null,$subcatName=null) { $this->commonfunctions->funsiteRuninIndia(); $lang = PROGRAMLANGUAGE; $strtitle=""; if($maincatName!="") { $MaincatArr = $this->Maincategory->find('all', array('fields' => array('maincatname'),'conditions' => array('removed' => 'N','id'=>$maincatid)), array('cache' => 'ItemMaincat', 'cacheConfig' => 'long')); $maincatName1=$MaincatArr[0]['Maincategory']['maincatname']; $strlink=str_replace("'","_",$maincatName1 ); //$strtitle=$strtitle." ".ucwords($maincatName1)." "; $strtitle=$strtitle."".ucwords($maincatName1).""; } if($childcatName!="") { $CategoryArr = $this->Category->find('all', array('fields' => array('maincatname','childcatname'),'conditions' => array('removed' => 'N','id'=>$childcatid,'maincatid'=>$maincatid)), array('cache' => 'ItemCategory', 'cacheConfig' => 'long')); $CatName=$CategoryArr[0]['Category']['childcatname']; $strlink=str_replace("'","_","$maincatName1/$CatName" ); //$strtitle=$strtitle." > ".ucwords($CatName).""; $strtitle=$strtitle." >".ucwords($CatName).""; } if($subcatName!="") { $SubcategoryArr = $this->Subcategory->find('all', array('fields' => array('maincatname','childcatname','subcatname'),'conditions' => array('removed' => 'N','id'=>$subcatid,'maincatid'=>$maincatid,'childcatid'=>$childcatid)), array('cache' => 'ItemCategory', 'cacheConfig' => 'long')); // $SubcategoryArr = $this->Subcategory->find('all', array('fields' => array('maincatname','childcatname','subcatname'),'conditions' => array('removed' => 'N','id'=>$subcatid,'childcatid'=>$childcatid,'maincatid'=>$maincatid,''=>)), array('cache' => 'ItemSubcat', 'cacheConfig' => 'long')); $subcatname=$SubcategoryArr[0]['Subcategory']['subcatname']; $strtitle=$strtitle." > $subcatname"; } $this -> set('labelname',"$strtitle"); $strcatnote=""; if($subcatid>0) {$strcatnote = $this->commonfunctions->Get1Value("subcategorylng","subcatcoment","subcatid='$subcatid' and lngid='$lang' ");} elseif($childcatid>0) {$strcatnote = $this->commonfunctions->Get1Value("childcategorylng","childcatdesc","childcatid='$childcatid' and lngid='$lang'");} elseif($maincatid>0) {$strcatnote = $this->commonfunctions->Get1Value("maincatlng","maincatdesc","maincatid='$maincatid' and lngid='$lang'");} $this->set("strcatnote",$strcatnote); $strtitle=""; if($maincatName!=""){$strtitle=$maincatName;} if($childcatName!=""){$strtitle=$strtitle.",$childcatName";} if($subcatName!=""){$strtitle=$strtitle.",$subcatName";} $this -> set('sPageTitle1',$strtitle); $this -> set('maincatid',$maincatid); $this -> set('childcatid',$childcatid); $this -> set('subcatid',$subcatid); $this -> set('maincatName',$maincatName); $this -> set('childcatName',$childcatName); $this -> set('subcatName',$subcatName); $BannerImage=""; $this->loadModel("Banner"); if($subcatid>0) { //$BannerArr = $this->Banner->find('all', array('fields' => array('bannerimage'),'conditions' => array('removed' => 'N','maincategory_id'=>$maincatid,'category_id'=>$childcatid,'subcategory_id'=>$subcatid),'order' => 'rand()','limit'=>'1')); $BannerArr = $this->Banner->find('all', array('fields' => array('bannerimage','bannermap','desmap'),'conditions' => array('removed' => 'N','maincategory_id'=>$maincatid,'category_id'=>$childcatid,'subcategory_id'=>$subcatid,'catactive'=>'Y' ),'order' => 'rand()','limit'=>'1'), array('cache' => 'Banner', 'cacheConfig' => 'long')); } elseif($childcatid>0) { //$BannerArr = $this->Banner->find('all', array('fields' => array('bannerimage'),'conditions' => array('removed' => 'N','maincategory_id'=>$maincatid,'category_id'=>$childcatid),'order' => 'rand()','limit'=>'1')); $BannerArr = $this->Banner->find('all', array('fields' => array('bannerimage','bannermap','desmap'),'conditions' => array('removed' => 'N','maincategory_id'=>$maincatid,'category_id'=>$childcatid ,'catactive'=>'Y'),'order' => 'rand()','limit'=>'1'), array('cache' => 'Banner', 'cacheConfig' => 'long')); } else { //$BannerArr = $this->Banner->find('all', array('fields' => array('bannerimage'),'conditions' => array('removed' => 'N','maincategory_id'=>$maincatid),'order' => 'rand()','limit'=>'1')); $BannerArr = $this->Banner->find('all', array('fields' => array('bannerimage','bannermap','desmap'),'conditions' => array('removed' => 'N','maincategory_id'=>$maincatid ,'order' => 'rand()','limit'=>'1')), array('cache' => 'Banner', 'cacheConfig' => 'long')); } if(count($BannerArr)>0) {$BannerImage=$BannerArr[0]['Banner']['bannerimage'];} else { $BannerArr = $this->Banner->find('all', array('fields' => array('bannerimage','bannermap','desmap'),'conditions' => array('removed' => 'N'),'order' => 'rand()','limit'=>'1'), array('cache' => 'Banner', 'cacheConfig' => 'long')); //$BannerArr = $this->Banner->find('all', array('fields' => array('bannerimage'),'conditions' => array('removed' => 'N','order' => 'rand()','limit'=>'1')), array('cache' => 'Banner', 'cacheConfig' => 'long')); if(count($BannerArr)>0) {$BannerImage=$BannerArr[0]['Banner']['bannerimage'];} } $this->set('BannerImage', $BannerImage); $this->set('BannerArr', $BannerArr); $testimonaltitle=""; $postby=""; $testmetter=""; $this->loadModel("Testimonalview"); if($subcatid>0) { //$TestimonalArr = $this->Testimonalview ->find('all', array('conditions' => array('removed' => 'N','maincategory_id'=>$maincatid,'category_id'=>$childcatid,'subcategory_id'=>$subcatid,'approved'=>'Y'),'order' => 'rand()','limit'=>'1')); $TestimonalArr = $this->Testimonalview ->find('all', array('conditions' => array('removed' => 'N','maincategory_id'=>$maincatid,'category_id'=>$childcatid,'subcategory_id'=>$subcatid,'approved'=>'Y'),'order' => 'rand()','limit'=>'1'), array('cache' => 'Testimonalview', 'cacheConfig' => 'long')); } elseif($childcatid>0) { //$TestimonalArr = $this->Testimonalview ->find('all', array('conditions' => array('removed' => 'N','maincategory_id'=>$maincatid,'category_id'=>$childcatid,'approved'=>'Y'),'order' => 'rand()','limit'=>'1')); $TestimonalArr = $this->Testimonalview ->find('all', array('conditions' => array('removed' => 'N','maincategory_id'=>$maincatid,'category_id'=>$childcatid,'approved'=>'Y'),'order' => 'rand()','limit'=>'1'), array('cache' => 'Testimonalview', 'cacheConfig' => 'long')); } else { //$TestimonalArr = $this->Testimonalview ->find('all', array('conditions' => array('removed' => 'N','maincategory_id'=>$maincatid,'approved'=>'Y'),'order' => 'rand()','limit'=>'1')); $TestimonalArr = $this->Testimonalview ->find('all', array('conditions' => array('removed' => 'N','maincategory_id'=>$maincatid,'approved'=>'Y'),'order' => 'rand()','limit'=>'1'), array('cache' => 'Testimonalview', 'cacheConfig' => 'long')); } if(count($TestimonalArr)>0) { $TestimonalArr=$TestimonalArr[0]; foreach($TestimonalArr as $key => $value) { $testimonalid=$value['id']; $testimonaltitle=$value['testimonaltitle']; $testmetter=$value['testmetter']; $postby=$value['postby']; } }else { //$TestimonalArr = $this->Testimonalview ->find('all', array('conditions' => array('removed' => 'N','approved'=>'Y'),'order' => 'rand()','limit'=>'1')); $TestimonalArr = $this->Testimonalview ->find('all', array('conditions' => array('removed' => 'N','approved'=>'Y'),'order' => 'rand()','limit'=>'1'), array('cache' => 'Testimonalview', 'cacheConfig' => 'long')); if(count($TestimonalArr)>0) { $TestimonalArr=$TestimonalArr[0]; foreach($TestimonalArr as $key => $value2) { $testimonalid=$value2['id']; $testimonaltitle=$value2['testimonaltitle']; $testmetter=$value2['testmetter']; $postby=$value2['postby']; } } } $this->set('testimonaltitle', $testimonaltitle); $this->set('postby', $postby); $this->set('testmetter', $testmetter); $condtions = "lngid='$lang'and removed='N' and dissapprove='Y'"; if($maincatid>0){$condtions = $condtions." and maincategory_id='$maincatid' ";} if($childcatid>0){$condtions = $condtions." and category_id='$childcatid' ";} if($subcatid>0){$condtions = $condtions." and subcategory_id='$subcatid' ";} $criteria=NULL; list($order,$limit,$page) = $this->Pagination->init($condtions); // Added $order="Item.itemtimes desc,Item.gorder desc,Item.id desc"; $arrItem = $this->Item->findAll($condtions, NULL, $order, $limit, $page); // Extra parameters added $totalcount = $this->Item->findAll($condtions, NULL, $order); // Extra parameters added $this->set('arrItem',$arrItem); $this->set('totalcount',$totalcount); } } ?>