PageRenderTime 63ms CodeModel.GetById 24ms RepoModel.GetById 1ms app.codeStats 0ms

/app/controllers/pages_controller.php

https://bitbucket.org/fxrialab/tickets
PHP | 1290 lines | 753 code | 269 blank | 268 comment | 113 complexity | 3aaf17eff6bdb61331a6a5347d522ebb MD5 | raw file
Possible License(s): LGPL-2.1, AGPL-1.0, GPL-2.0, MIT

Large files files are truncated, but you can click here to view the full file

  1. <?php
  2. /* SVN FILE: $Id: pages_controller.php 4786 2007-04-05 17:57:00Z phpnut $ */
  3. /**
  4. * Short description for file.
  5. *
  6. * This file is application-wide controller file. You can put all
  7. * application-wide controller-related methods here.
  8. *
  9. * PHP versions 4 and 5
  10. *
  11. * CakePHP(tm) : Rapid Development Framework <http://www.cakephp.org/>
  12. * Copyright 2005-2007, Cake Software Foundation, Inc.
  13. * 1785 E. Sahara Avenue, Suite 490-204
  14. * Las Vegas, Nevada 89104
  15. *
  16. * Licensed under The MIT License
  17. * Redistributions of files must retain the above copyright notice.
  18. *
  19. * @filesource
  20. * @copyright Copyright 2005-2007, Cake Software Foundation, Inc.
  21. * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
  22. * @package cake
  23. * @subpackage cake.cake.libs.controller
  24. * @since CakePHP(tm) v 0.2.9
  25. * @version $Revision: 4786 $
  26. * @modifiedby $LastChangedBy: phpnut $
  27. * @lastmodified $Date: 2007-04-05 12:57:00 -0500 (Thu, 05 Apr 2007) $
  28. * @license http://www.opensource.org/licenses/mit-license.php The MIT License
  29. */
  30. /**
  31. * Short description for class.
  32. *
  33. * This file is application-wide controller file. You can put all
  34. * application-wide controller-related methods here.
  35. *
  36. * Add your application-wide methods in the class below, your controllers
  37. * will inherit them.
  38. *
  39. * @package cake
  40. * @subpackage cake.cake.libs.controller
  41. */
  42. class PagesController extends AppController {
  43. public $filelayoutName='' ;
  44. public $Totalrecdisplay = 20;
  45. /**
  46. * Enter description here...
  47. *
  48. * @var unknown_type
  49. */
  50. var $name = 'Pages';
  51. /**
  52. * Enter description here...
  53. *
  54. * @var unknown_type
  55. */
  56. var $helpers = array('Html','Friendsurl','Ajax','common');
  57. /**
  58. * This controller does not use a model
  59. *
  60. * @var $uses
  61. */
  62. var $uses=array('Xoevent','User','UserAlbum');
  63. /**
  64. * Displays a view
  65. *
  66. */
  67. function mywebsite() {
  68. $this->pageTitle = 'My Home';
  69. //$this->layout='photo_website';
  70. //This is for the up
  71. // if(isset($this->params['url']['usr2']))
  72. // $userName=$this->params['url']['usr2'];
  73. // else
  74. // $userName = substr( $this->params['url']['url'], strpos($this->params['url']['url'], "=")+1,( strlen($this->params['url']['url'])-strpos(env("HTTP_HOST"), "=")) );
  75. //
  76. $userName=$this->params['url']['subDomain'];
  77. $this->set('subDmnUserName',$userName);
  78. //echo "SELECT UDTL.user_id userId,U.user_group_master_id GrpId FROM users U,user_details UDTL WHERE U.id=UDTL.user_id AND U.username='".$userName."'";
  79. $queryUsers=mysql_query("SELECT UDTL.user_id userId,U.user_group_master_id GrpId,UDTL.city,UDTL.state ,UDTL.c_id FROM users U,user_details UDTL WHERE U.id=UDTL.user_id AND U.username='".$userName."'") or die(" Error on line ".__LINE__.mysql_error());
  80. if(mysql_num_rows($queryUsers)>0) {
  81. $fetchUsers=mysql_fetch_array($queryUsers);
  82. $this->Session->write('PrjUserCityId', $fetchUsers['city']);
  83. $this->Session->write('PrjUserStateId', $fetchUsers['state']);
  84. $this->Session->write('PrjUserCountryId', $fetchUsers['c_id']);
  85. unset($_SESSION['PrjUserCityName']);
  86. unset($_SESSION['PrjUserStateName']);
  87. unset($_SESSION['PrjUserCountryName']);
  88. unset($_SESSION['PrjUserLocation']);
  89. $this->set('profileviewUid',$fetchUsers['userId']);
  90. /*if($fetchUsers['GrpId']==1) {
  91. $this->pageTitle = ucfirst($userName) .' Home';
  92. $this->layout='userprofilevisit';
  93. $this->userProfileLeftPanel();
  94. $this->userProfileLeftPanel(base64_encode($fetchUsers['userId']));
  95. $this->getMyComments($fetchUsers['userId']);
  96. $this->render("userweb");
  97. } //page for the users
  98. if($fetchUsers['GrpId']==2 || $fetchUsers['GrpId']==3) {
  99. $this->pageTitle = ucfirst($userName) .' Home';
  100. $this->Websitetemplateinfo($fetchUsers['userId']);
  101. $this->layout=$this->filelayoutName;
  102. $this->set('profileviewUid',$fetchUsers['userId']);
  103. $this->set('profileviewUgrpId',$fetchUsers['GrpId']);
  104. $this->photohome(base64_encode($fetchUsers['userId']));
  105. $this->eventhome();
  106. //this is set here beacuse the same CAROUSEL COMPONENT will be used in the view event page (VIEWXOEVENT)
  107. //this is set in viewxoevent function
  108. $this->set("caourselType","ALBUM");
  109. $this->render("photohome");
  110. } //page for the photographer
  111. */
  112. /* if($fetchUsers['GrpId']==3)
  113. {
  114. $this->pageTitle = ucfirst($userName) .' Home';
  115. $this->layout='userprofilevisit';
  116. $this->userProfileLeftPanel();
  117. $this->userProfileLeftPanel(base64_encode($fetchUsers['userId']));
  118. $this->getMyComments($fetchUsers['userId']);
  119. $this->render("userweb");
  120. //$this->render("orgweb");
  121. } //page for the organization
  122. */
  123. $this->redirect('tickets/index');
  124. }
  125. else {
  126. //header ("HTTP/1.0 404 Not Found");
  127. //die();
  128. $this->redirect('http://www.xoimages.com/tickets');
  129. }
  130. }
  131. function display() {
  132. if (!func_num_args()) {
  133. $this->redirect('/');
  134. }
  135. $path=func_get_args();
  136. if (!count($path)) {
  137. $this->redirect('/');
  138. }
  139. $count =count($path);
  140. $page =null;
  141. $subpage=null;
  142. $title =null;
  143. if (!empty($path[0])) {
  144. $page = $path[0];
  145. }
  146. if (!empty($path[1])) {
  147. $subpage = $path[1];
  148. }
  149. if (!empty($path[$count - 1])) {
  150. $title = ucfirst($path[$count - 1]);
  151. }
  152. $this->set('page', $page);
  153. $this->set('subpage', $subpage);
  154. $this->set('title', $title);
  155. $this->render(join('/', $path));
  156. }
  157. ########################## PHOTO GRAPHER WEB PAGES ####################################
  158. function Websitetemplateinfo($photoId) {
  159. ####### QUERY FOR WEBSITE LAYOUT ######
  160. $websiteQry = "SELECT layout,logoimage,backgroundimage,theme from photographer_website where user_id='".$photoId."'";
  161. $websiteQry_res = mysql_query($websiteQry);
  162. $layoutName='photoweblayout1';
  163. $weblogoimage = 'img/logo.gif';
  164. $styletheme='blue';
  165. $webbackimage = '';
  166. if(mysql_num_rows($websiteQry_res)>0) {
  167. $websiteQry_arr = mysql_fetch_array($websiteQry_res);
  168. if($websiteQry_arr['layout']!='')
  169. $layoutName = 'photoweblayout'.$websiteQry_arr['layout'];
  170. if($websiteQry_arr['logoimage']!='')
  171. $weblogoimage = 'photowebsite/logo/'.$websiteQry_arr['logoimage'];
  172. if($websiteQry_arr['theme']!='')
  173. $styletheme=$websiteQry_arr['theme'];
  174. if($websiteQry_arr['backgroundimage']!='')
  175. $webbackimage = 'photowebsite/background/'.$websiteQry_arr['backgroundimage'];
  176. }
  177. $this->filelayoutName=$layoutName;
  178. $this->set('layoutName',$layoutName);
  179. $this->set('layoutlogo',$weblogoimage);
  180. $this->set('styletheme',$styletheme);
  181. $this->set('layoutbackimage',$webbackimage);
  182. ########################################
  183. }
  184. function photohome($userId) {
  185. //$userId=base64_decode($userId);
  186. ############################### About us Txt ##########################
  187. $websiteQry = "SELECT IFNULL(aboutus,'Text awaiting')as abouttxt FROM photographer_website WHERE user_id='".base64_decode($userId)."'";
  188. $websiteQry_res = mysql_query($websiteQry);
  189. $websiteQry_arr = mysql_fetch_array($websiteQry_res);
  190. $this->set('content',substr($websiteQry_arr['abouttxt'],0,574));
  191. #####################################################################
  192. ################################ Gallery view ####################
  193. $criteria = " 1 and UserAlbum.user_id =".base64_decode($userId)." and UserAlbum.album_access='public'";
  194. $order = " id ";
  195. $this->set('album', $this->UserAlbum->findAll($criteria, NULL, $order, NULL, NULL));
  196. #################################################################
  197. }
  198. function photoaboutus() {
  199. ############################# URL CHECKING FOR USERNAME
  200. $userName=$this->params['url']['subDomain'];
  201. //$userName = 'aniphotoinav';
  202. $queryUsers=mysql_query("SELECT UDTL.user_id userId,U.user_group_master_id GrpId FROM users U,user_details UDTL WHERE U.id=UDTL.user_id AND U.username='".$userName."'") or die(" Error on line ".__LINE__.mysql_error());
  203. if(mysql_num_rows($queryUsers)>0) {
  204. $fetchUsers=mysql_fetch_array($queryUsers);
  205. $this->pageTitle = ucfirst($userName) .' About us';
  206. $this->Websitetemplateinfo($fetchUsers['userId']);
  207. $this->layout=$this->filelayoutName;
  208. $this->set('profileviewUid',$fetchUsers['userId']);
  209. $this->set('profileviewUgrpId',$fetchUsers['GrpId']);
  210. ############################### About us Txt ##########################
  211. $websiteQry = "SELECT IFNULL(aboutus,'Text awaiting')as abouttxt FROM photographer_website WHERE user_id='".$fetchUsers['userId']."'";
  212. $websiteQry_res = mysql_query($websiteQry);
  213. $websiteQry_arr = mysql_fetch_array($websiteQry_res);
  214. $this->set('content',$websiteQry_arr['abouttxt']);
  215. #####################################################################
  216. }
  217. #####################################
  218. }
  219. function phototestimonial() {
  220. ############################# URL CHECKING FOR USERNAME
  221. // if(isset($this->params['url']['usr2']))
  222. // $userName=$this->params['url']['usr2'];
  223. // else
  224. // $userName = substr( $this->params['url']['url'], strpos($this->params['url']['url'], "=")+1,( strlen($this->params['url']['url'])-strpos(env("HTTP_HOST"), "=")) );
  225. $userName=$this->params['url']['subDomain'];
  226. //$userName = 'aniphotoinav';
  227. $queryUsers=mysql_query("SELECT UDTL.user_id userId,U.user_group_master_id GrpId FROM users U,user_details UDTL WHERE U.id=UDTL.user_id AND U.username='".$userName."'") or die(" Error on line ".__LINE__.mysql_error());
  228. if(mysql_num_rows($queryUsers)>0) {
  229. $fetchUsers=mysql_fetch_array($queryUsers);
  230. if($fetchUsers['GrpId']>2)
  231. $this->pageTitle = ucfirst($userName) .' Admission';
  232. else
  233. $this->pageTitle = ucfirst($userName) .' Testimonial';
  234. $this->Websitetemplateinfo($fetchUsers['userId']);
  235. $this->layout=$this->filelayoutName;
  236. $this->set('profileviewUid',$fetchUsers['userId']);
  237. $this->set('profileviewUgrpId',$fetchUsers['GrpId']);
  238. ############################### About us Txt ##########################
  239. $websiteQry = "SELECT IFNULL(testimonial,'Text awaiting')as abouttxt FROM photographer_website WHERE user_id='".$fetchUsers['userId']."'";
  240. $websiteQry_res = mysql_query($websiteQry);
  241. $websiteQry_arr = mysql_fetch_array($websiteQry_res);
  242. $this->set('content',$websiteQry_arr['abouttxt']);
  243. #####################################################################
  244. }
  245. #####################################
  246. }
  247. function photoprice() {
  248. ############################# URL CHECKING FOR USERNAME
  249. // if(isset($this->params['url']['usr2']))
  250. // $userName=$this->params['url']['usr2'];
  251. // else
  252. // $userName = substr( $this->params['url']['url'], strpos($this->params['url']['url'], "=")+1,( strlen($this->params['url']['url'])-strpos(env("HTTP_HOST"), "=")) );
  253. $userName=$this->params['url']['subDomain'];
  254. //$userName = 'aniphotoinav';
  255. $queryUsers=mysql_query("SELECT UDTL.user_id userId,U.user_group_master_id GrpId FROM users U,user_details UDTL WHERE U.id=UDTL.user_id AND U.username='".$userName."'") or die(" Error on line ".__LINE__.mysql_error());
  256. if(mysql_num_rows($queryUsers)>0) {
  257. $fetchUsers=mysql_fetch_array($queryUsers);
  258. if($fetchUsers['GrpId']>2)
  259. $this->pageTitle = ucfirst($userName) .' Academic';
  260. else
  261. $this->pageTitle = ucfirst($userName) .' Price';
  262. $this->Websitetemplateinfo($fetchUsers['userId']);
  263. $this->layout=$this->filelayoutName;
  264. $this->set('profileviewUid',$fetchUsers['userId']);
  265. $this->set('profileviewUgrpId',$fetchUsers['GrpId']);
  266. ############################### About us Txt ##########################
  267. $websiteQry = "SELECT IFNULL(price,'Text awaiting')as abouttxt FROM photographer_website WHERE user_id='".$fetchUsers['userId']."'";
  268. $websiteQry_res = mysql_query($websiteQry);
  269. $websiteQry_arr = mysql_fetch_array($websiteQry_res);
  270. $this->set('content',$websiteQry_arr['abouttxt']);
  271. #####################################################################
  272. }
  273. #####################################
  274. }
  275. function photocontact() {
  276. ############################# URL CHECKING FOR USERNAME
  277. // if(isset($this->params['url']['usr2']))
  278. // $userName=$this->params['url']['usr2'];
  279. // else
  280. // $userName = substr( $this->params['url']['url'], strpos($this->params['url']['url'], "=")+1,( strlen($this->params['url']['url'])-strpos(env("HTTP_HOST"), "=")) );
  281. $userName=$this->params['url']['subDomain'];
  282. //$userName = 'aniphotoinav';
  283. $queryUsers=mysql_query("SELECT UDTL.user_id userId,U.user_group_master_id GrpId FROM users U,user_details UDTL WHERE U.id=UDTL.user_id AND U.username='".$userName."'") or die(" Error on line ".__LINE__.mysql_error());
  284. if(mysql_num_rows($queryUsers)>0) {
  285. $fetchUsers=mysql_fetch_array($queryUsers);
  286. $this->pageTitle = ucfirst($userName) .' Contact Us';
  287. $this->Websitetemplateinfo($fetchUsers['userId']);
  288. $this->layout=$this->filelayoutName;
  289. $this->set('profileviewUid',$fetchUsers['userId']);
  290. $this->set('profileviewUgrpId',$fetchUsers['GrpId']);
  291. ############################### About us Txt ##########################
  292. $websiteQry = "SELECT IFNULL(contactus,'Text awaiting')as abouttxt,googlelocation FROM photographer_website WHERE user_id='".$fetchUsers['userId']."'";
  293. $websiteQry_res = mysql_query($websiteQry);
  294. $websiteQry_arr = mysql_fetch_array($websiteQry_res);
  295. $this->set('content',$websiteQry_arr['abouttxt']);
  296. $expgoogleloc = explode(':',$websiteQry_arr['googlelocation']);
  297. if(isset($expgoogleloc[0]) &&$expgoogleloc[0]!=='')
  298. $googlelat = $expgoogleloc[0] ;
  299. else
  300. $googlelat = 48.8567;
  301. if(isset($expgoogleloc[1]) && $expgoogleloc[1]!=='')
  302. $googlelong = $expgoogleloc[1] ;
  303. else
  304. $googlelong = 2.35099;
  305. $this->set('googlelat',$googlelat);
  306. $this->set('googlelong',$googlelong);
  307. #####################################################################
  308. }
  309. #####################################
  310. }
  311. function photogallery() {
  312. ############################# URL CHECKING FOR USERNAME
  313. $userName=$this->params['url']['subDomain'];
  314. //$userName = 'aniphotoinav';
  315. $queryUsers=mysql_query("SELECT UDTL.user_id userId,U.user_group_master_id GrpId FROM users U,user_details UDTL WHERE U.id=UDTL.user_id AND U.username='".$userName."'") or die(" Error on line ".__LINE__.mysql_error());
  316. if(mysql_num_rows($queryUsers)>0) {
  317. $fetchUsers=mysql_fetch_array($queryUsers);
  318. $this->pageTitle = ucfirst($userName) .' Gallery';
  319. $this->Websitetemplateinfo($fetchUsers['userId']);
  320. $this->layout=$this->filelayoutName;
  321. $this->set('profileviewUid',$fetchUsers['userId']);
  322. $this->set('profileviewUgrpId',$fetchUsers['GrpId']);
  323. $this->set("caourselType","ALBUM");
  324. ############################### Album image and text ##########################
  325. $albumtit = "select * from user_albums where user_id='".$fetchUsers['userId']."' AND album_access='public'";
  326. $res_albumtit = mysql_query($albumtit);
  327. $album_no = mysql_num_rows($res_albumtit);
  328. if($album_no>0) {
  329. $res_albumtit_arr = mysql_fetch_array($res_albumtit);
  330. $this->set('albuminfo',$res_albumtit_arr['album_name']);
  331. $this->set('albumNum',$res_albumtit_arr['id']);
  332. if( isset($this->params['url']['album'])&& base64_decode($this->params['url']['album']) > 1)
  333. $albumid=$this->params['url']['album'];
  334. else
  335. $albumid= base64_encode($res_albumtit_arr['id']);
  336. /* Category name*/
  337. $categorySql = "Select album_name from user_albums where id='".base64_decode($albumid)."'";
  338. $categorySql_res = mysql_query($categorySql);
  339. $categorySql_arr = mysql_fetch_array($categorySql_res);
  340. $this->set('Categoryname',$categorySql_arr['album_name']);
  341. /**/
  342. ############################################# Cake AJAX Pagination
  343. /* Pagination and image listing */
  344. $select = " Select Xdet.* ";
  345. $from=" FROM user_albums X
  346. LEFT JOIN user_photo_albums Xdet ON X.id = Xdet.user_album_id AND X.user_id= Xdet.user_id ";
  347. $where="WHERE 1";
  348. if(base64_decode($albumid)>0)
  349. $where .=" AND X.id='".base64_decode($albumid)."'";
  350. $others=" ";
  351. $PassParameter="album=".$albumid;
  352. $CountField="X.id";
  353. $this->set("controller","pages");
  354. $this->set("action","photogallery");
  355. $this->set("parameter",$PassParameter);
  356. $this->pagination($select,$from,$where,$others,$CountField,$this->params['url'],$PassParameter);
  357. if(isset($this->params['url']['Page']) || isset($this->params['url']['viewphoto'])) {
  358. $this->render("photogallery2","ajax");
  359. }
  360. /**/
  361. ############################################# Cake AJAX Pagination
  362. $criteria = " 1 and UserAlbum.user_id =".$fetchUsers['userId']." AND album_access='public'";
  363. $order = " id ";
  364. $this->set('album', $this->UserAlbum->findAll($criteria, NULL, $order, NULL, NULL));
  365. ############################### Album image and text ##########################
  366. }
  367. else
  368. $this->set('albuminfo',"No");
  369. }
  370. #####################################
  371. }
  372. function photoevent() {
  373. //$userName=$this->params['url']['subDomain'];
  374. $userName = 'testOrganisation';
  375. $queryUsers=mysql_query("SELECT UDTL.user_id userId,U.user_group_master_id GrpId FROM users U,user_details UDTL WHERE U.id=UDTL.user_id AND U.username='".$userName."'") or die(" Error on line ".__LINE__.mysql_error());
  376. $fetchUsers=mysql_fetch_array($queryUsers);
  377. $this->pageTitle = ucfirst($userName) .' Event';
  378. $this->Websitetemplateinfo($fetchUsers['userId']);
  379. $this->layout=$this->filelayoutName;
  380. $this->set('profileviewUid',$fetchUsers['userId']);
  381. $this->set('profileviewUgrpId',$fetchUsers['GrpId']);
  382. $this->eventhome();
  383. /* EVENT Name*/
  384. $curDate=date("Y-m-d G:i:s");
  385. if(isset($_REQUEST['photoeventName']) && $_REQUEST['photoeventName']!='Event Name') {
  386. $evtname = $_REQUEST['photoeventName'];
  387. $_SESSION['sesData']['eventname'] = $evtname ;
  388. }
  389. else {
  390. $evtname ='';
  391. if(!isset($_SESSION['sesData']['eventname']))
  392. $_SESSION['sesData']['eventname'] = 'Event Name';
  393. }
  394. /* EVENT Name*/
  395. /* EVENT DATE*/
  396. if(isset($_REQUEST['photoeventDate']) && $_REQUEST['photoeventDate']!='mm/dd/yy') {
  397. $eventDate=date("Y-m-d",strtotime($_REQUEST['photoeventDate']));
  398. }
  399. else {
  400. $eventDate='';
  401. if(!isset($_SESSION['sesData']['eventdate']))
  402. $_SESSION['sesData']['eventdate'] = 'mm/dd/yy';
  403. }
  404. /* EVENT DATE*/
  405. /*EVENT CITY*/
  406. if(isset($_REQUEST['photoeventCity']) && $_REQUEST['photoeventCity']!='City, State of the Event') {
  407. $evtcity = $_REQUEST['photoeventCity'];
  408. $_SESSION['sesData']['photocity'] = 'City, State of the Event' ;
  409. }
  410. else {
  411. $evtcity = '';
  412. if(!isset($_SESSION['sesData']['photocity']))
  413. $_SESSION['sesData']['photocity'] = 'City, State of the Event';
  414. }
  415. $or1='';
  416. if(isset($_SESSION['sesData']['eventname']) && $_SESSION['sesData']['eventname']!='Event Name')
  417. $or1.=" AND ((
  418. XE.event_user = XU.id
  419. AND XU.user_group_master_id =3
  420. AND EUD.org_name LIKE '%".$_SESSION['sesData']['eventname']."%'
  421. ) OR (
  422. XE.event_user = XU.id
  423. AND XU.user_group_master_id =2
  424. AND XU.username LIKE '%".$_SESSION['sesData']['eventname']."%'
  425. ) OR (
  426. XE.user_id = XU.id
  427. AND XE.event_name LIKE '%".$_SESSION['sesData']['eventname']."%'
  428. ) )";
  429. if(isset($_SESSION['sesData']['eventdate']) && $_SESSION['sesData']['eventdate']!='mm/dd/yy')
  430. $or1.=" AND '".$_SESSION['sesData']['eventdate']."' BETWEEN XE.event_start_date AND XE.event_end_date";
  431. if(isset($_SESSION['sesData']['photocity']) && $_SESSION['sesData']['photocity']!="City, State of the Event")
  432. $or1.=" AND ((XE.event_city LIKE '%".$_SESSION['sesData']['photocity']."%') OR (XE.event_state LIKE '%".$_SESSION['sesData']['photocity']."%'))";
  433. if(isset($fetchUsers['userId']) && $fetchUsers['userId']!="")
  434. $or1.=" AND XE.user_id=XU.id AND XE.user_id ='".$fetchUsers['userId']."'";
  435. $or1.=" GROUP BY XE.id";
  436. $eventSec=" XE.event_cat IS NOT NULL";
  437. $select="SELECT XE.*,XC.category_name,XU.username";
  438. $from= " FROM xoevents XE,user_details EUD,users XU,xoevent_categorys XC WHERE XE.event_cat=XC.id AND XU.id= XE.user_id AND $eventSec AND is_temp='1' AND '".$curDate."' BETWEEN event_start_date AND event_end_date";
  439. //$from= " FROM xoevents XE,user_details EUD,users XU,xoevent_categorys XC WHERE XE.event_cat=XC.id AND XU.id= XE.user_id AND $eventSec AND is_temp='1'";
  440. $where=$or1;
  441. $others=" ";
  442. $PassParameter="";
  443. $CountField="XE.id";
  444. $this->set("controller","pages");
  445. $this->set("action","photoevent");
  446. $this->set("parameter",$PassParameter);
  447. $this->pagination($select,$from,$where,$others,$CountField,$this->params['url'],$PassParameter);
  448. if(isset($this->params['url']['Page'])) {
  449. $this->render("photoevent2","ajax");
  450. }
  451. }
  452. /* Organisation Website */
  453. function orgaboutus() {
  454. ############################# URL CHECKING FOR USERNAME
  455. $userName=$this->params['url']['subDomain'];
  456. //$userName = 'testOrganisation';
  457. $queryUsers=mysql_query("SELECT UDTL.user_id userId,U.user_group_master_id GrpId FROM users U,user_details UDTL WHERE U.id=UDTL.user_id AND U.username='".$userName."'") or die(" Error on line ".__LINE__.mysql_error());
  458. if(mysql_num_rows($queryUsers)>0) {
  459. $fetchUsers=mysql_fetch_array($queryUsers);
  460. $this->pageTitle = ucfirst($userName) .' About us';
  461. $this->Websitetemplateinfo($fetchUsers['userId']);
  462. $this->layout=$this->filelayoutName;
  463. $this->set('profileviewUid',$fetchUsers['userId']);
  464. $this->set('profileviewUgrpId',$fetchUsers['GrpId']);
  465. ############################### About us Txt ##########################
  466. $websiteQry = "SELECT IFNULL(aboutus,'Text awaiting')as abouttxt FROM photographer_website WHERE user_id='".$fetchUsers['userId']."'";
  467. $websiteQry_res = mysql_query($websiteQry);
  468. $websiteQry_arr = mysql_fetch_array($websiteQry_res);
  469. $this->set('content',$websiteQry_arr['abouttxt']);
  470. #####################################################################
  471. }
  472. #####################################
  473. }
  474. function orggallery() {
  475. ############################# URL CHECKING FOR USERNAME
  476. $userName=$this->params['url']['subDomain'];
  477. //$userName = 'testOrganisation';
  478. $queryUsers=mysql_query("SELECT UDTL.user_id userId,U.user_group_master_id GrpId FROM users U,user_details UDTL WHERE U.id=UDTL.user_id AND U.username='".$userName."'") or die(" Error on line ".__LINE__.mysql_error());
  479. if(mysql_num_rows($queryUsers)>0) {
  480. $fetchUsers=mysql_fetch_array($queryUsers);
  481. $this->pageTitle = ucfirst($userName) .' Gallery';
  482. $this->Websitetemplateinfo($fetchUsers['userId']);
  483. $this->layout=$this->filelayoutName;
  484. $this->set('profileviewUid',$fetchUsers['userId']);
  485. $this->set('profileviewUgrpId',$fetchUsers['GrpId']);
  486. $this->set("caourselType","ALBUM");
  487. ############################### Album image and text ##########################
  488. $albumtit = "select * from user_albums where user_id='".$fetchUsers['userId']."' AND album_access='public'";
  489. $res_albumtit = mysql_query($albumtit);
  490. $album_no = mysql_num_rows($res_albumtit);
  491. if($album_no>0) {
  492. $res_albumtit_arr = mysql_fetch_array($res_albumtit);
  493. $this->set('albuminfo',$res_albumtit_arr['album_name']);
  494. $this->set('albumNum',$res_albumtit_arr['id']);
  495. ############################################# Cake AJAX Pagination
  496. if( isset($this->params['url']['album'])&& base64_decode($this->params['url']['album']) > 1)
  497. $albumid=$this->params['url']['album'];
  498. else
  499. $albumid= base64_encode($res_albumtit_arr['id']);
  500. /* Category name*/
  501. $categorySql = "Select album_name from user_albums where id='".base64_decode($albumid)."'";
  502. $categorySql_res = mysql_query($categorySql);
  503. $categorySql_arr = mysql_fetch_array($categorySql_res);
  504. $this->set('Categoryname',$categorySql_arr['album_name']);
  505. /**/
  506. /* Pagination and image listing */
  507. $select = " Select Xdet.* ";
  508. $from=" FROM user_albums X
  509. LEFT JOIN user_photo_albums Xdet ON X.id = Xdet.user_album_id AND X.user_id= Xdet.user_id ";
  510. $where="WHERE 1";
  511. if(base64_decode($albumid)>0)
  512. $where .=" AND X.id='".base64_decode($albumid)."'";
  513. $others=" ";
  514. $PassParameter="album=".$albumid;
  515. $CountField="X.id";
  516. $this->set("controller","pages");
  517. $this->set("action","photogallery");
  518. $this->set("parameter",$PassParameter);
  519. $this->pagination($select,$from,$where,$others,$CountField,$this->params['url'],$PassParameter);
  520. if(isset($this->params['url']['Page']) || isset($this->params['url']['viewphoto'])) {
  521. $this->render("photogallery2","ajax");
  522. }
  523. /**/
  524. ############################################# Cake AJAX Pagination
  525. $criteria = " 1 and UserAlbum.user_id =".$fetchUsers['userId']." AND album_access='public'";
  526. $order = " id ";
  527. $this->set('album', $this->UserAlbum->findAll($criteria, NULL, $order, NULL, NULL));
  528. ############################### Album image and text ##########################
  529. }
  530. else
  531. $this->set('albuminfo',"No");
  532. }
  533. #####################################
  534. }
  535. function orgcontact() {
  536. ############################# URL CHECKING FOR USERNAME
  537. // if(isset($this->params['url']['usr2']))
  538. // $userName=$this->params['url']['usr2'];
  539. // else
  540. // $userName = substr( $this->params['url']['url'], strpos($this->params['url']['url'], "=")+1,( strlen($this->params['url']['url'])-strpos(env("HTTP_HOST"), "=")) );
  541. $userName=$this->params['url']['subDomain'];
  542. $userName = 'testOrganisation';
  543. $queryUsers=mysql_query("SELECT UDTL.user_id userId,U.user_group_master_id GrpId FROM users U,user_details UDTL WHERE U.id=UDTL.user_id AND U.username='".$userName."'") or die(" Error on line ".__LINE__.mysql_error());
  544. if(mysql_num_rows($queryUsers)>0) {
  545. $fetchUsers=mysql_fetch_array($queryUsers);
  546. $this->pageTitle = ucfirst($userName) .' Contact Us';
  547. $this->Websitetemplateinfo($fetchUsers['userId']);
  548. $this->layout=$this->filelayoutName;
  549. $this->set('profileviewUid',$fetchUsers['userId']);
  550. $this->set('profileviewUgrpId',$fetchUsers['GrpId']);
  551. ############################### About us Txt ##########################
  552. $websiteQry = "SELECT IFNULL(contactus,'Text awaiting')as abouttxt,googlelocation FROM photographer_website WHERE user_id='".$fetchUsers['userId']."'";
  553. $websiteQry_res = mysql_query($websiteQry);
  554. $websiteQry_arr = mysql_fetch_array($websiteQry_res);
  555. $this->set('content',$websiteQry_arr['abouttxt']);
  556. $expgoogleloc = explode(':',$websiteQry_arr['googlelocation']);
  557. if(isset($expgoogleloc[0]) &&$expgoogleloc[0]!=='')
  558. $googlelat = $expgoogleloc[0] ;
  559. else
  560. $googlelat = 48.8567;
  561. if(isset($expgoogleloc[1]) && $expgoogleloc[1]!=='')
  562. $googlelong = $expgoogleloc[1] ;
  563. else
  564. $googlelong = 2.35099;
  565. $this->set('googlelat',$googlelat);
  566. $this->set('googlelong',$googlelong);
  567. #####################################################################
  568. }
  569. #####################################
  570. }
  571. function orgevent() {
  572. $userName=$this->params['url']['subDomain'];
  573. //$userName = 'testOrganisation';
  574. $queryUsers=mysql_query("SELECT UDTL.user_id userId,U.user_group_master_id GrpId FROM users U,user_details UDTL WHERE U.id=UDTL.user_id AND U.username='".$userName."'") or die(" Error on line ".__LINE__.mysql_error());
  575. $fetchUsers=mysql_fetch_array($queryUsers);
  576. $this->pageTitle = ucfirst($userName) .' Event';
  577. $this->Websitetemplateinfo($fetchUsers['userId']);
  578. $this->layout=$this->filelayoutName;
  579. $this->set('profileviewUid',$fetchUsers['userId']);
  580. $this->set('profileviewUgrpId',$fetchUsers['GrpId']);
  581. $this->eventhome();
  582. /* EVENT Name*/
  583. $curDate=date("Y-m-d G:i:s");
  584. if(isset($_REQUEST['photoeventName']) && $_REQUEST['photoeventName']!='Event Name') {
  585. $evtname = $_REQUEST['photoeventName'];
  586. $_SESSION['sesData']['eventname'] = $evtname ;
  587. }
  588. else {
  589. $evtname ='';
  590. if(!isset($_SESSION['sesData']['eventname']))
  591. $_SESSION['sesData']['eventname'] = 'Event Name';
  592. }
  593. /* EVENT Name*/
  594. /* EVENT DATE*/
  595. if(isset($_REQUEST['photoeventDate']) && $_REQUEST['photoeventDate']!='mm/dd/yy') {
  596. $eventDate=date("Y-m-d",strtotime($_REQUEST['photoeventDate']));
  597. }
  598. else {
  599. $eventDate='';
  600. if(!isset($_SESSION['sesData']['eventdate']))
  601. $_SESSION['sesData']['eventdate'] = 'mm/dd/yy';
  602. }
  603. /* EVENT DATE*/
  604. /*EVENT CITY*/
  605. if(isset($_REQUEST['photoeventCity']) && $_REQUEST['photoeventCity']!='City, State of the Event') {
  606. $evtcity = $_REQUEST['photoeventCity'];
  607. $_SESSION['sesData']['photocity'] = 'City, State of the Event' ;
  608. }
  609. else {
  610. $evtcity = '';
  611. if(!isset($_SESSION['sesData']['photocity']))
  612. $_SESSION['sesData']['photocity'] = 'City, State of the Event';
  613. }
  614. $or1='';
  615. if(isset($_SESSION['sesData']['eventname']) && $_SESSION['sesData']['eventname']!='Event Name')
  616. $or1.=" AND ((
  617. XE.event_user = XU.id
  618. AND XU.user_group_master_id =3
  619. AND EUD.org_name LIKE '%".$_SESSION['sesData']['eventname']."%'
  620. ) OR (
  621. XE.event_user = XU.id
  622. AND XU.user_group_master_id =2
  623. AND XU.username LIKE '%".$_SESSION['sesData']['eventname']."%'
  624. ) OR (
  625. XE.user_id = XU.id
  626. AND XE.event_name LIKE '%".$_SESSION['sesData']['eventname']."%'
  627. ) )";
  628. if(isset($_SESSION['sesData']['eventdate']) && $_SESSION['sesData']['eventdate']!='mm/dd/yy')
  629. $or1.=" AND '".$_SESSION['sesData']['eventdate']."' BETWEEN XE.event_start_date AND XE.event_end_date";
  630. if(isset($_SESSION['sesData']['photocity']) && $_SESSION['sesData']['photocity']!="City, State of the Event")
  631. $or1.=" AND ((XE.event_city LIKE '%".$_SESSION['sesData']['photocity']."%') OR (XE.event_state LIKE '%".$_SESSION['sesData']['photocity']."%'))";
  632. if(isset($fetchUsers['userId']) && $fetchUsers['userId']!="")
  633. $or1.=" AND XE.user_id=XU.id AND XE.user_id ='".$fetchUsers['userId']."'";
  634. $or1.=" GROUP BY XE.id";
  635. $eventSec=" XE.event_cat IS NOT NULL";
  636. $select="SELECT XE.*,XC.category_name,XU.username";
  637. $from= " FROM xoevents XE,user_details EUD,users XU,xoevent_categorys XC WHERE XE.event_cat=XC.id AND XU.id= XE.user_id AND $eventSec AND is_temp='1' AND '".$curDate."' BETWEEN event_start_date AND event_end_date";
  638. //$from= " FROM xoevents XE,user_details EUD,users XU,xoevent_categorys XC WHERE XE.event_cat=XC.id AND XU.id= XE.user_id AND $eventSec AND is_temp='1'";
  639. $where=$or1;
  640. $others=" ";
  641. $PassParameter="";
  642. $CountField="XE.id";
  643. $this->set("controller","pages");
  644. $this->set("action","photoevent");
  645. $this->set("parameter",$PassParameter);
  646. $this->pagination($select,$from,$where,$others,$CountField,$this->params['url'],$PassParameter);
  647. if(isset($this->params['url']['Page'])) {
  648. $this->render("photoevent2","ajax");
  649. }
  650. }
  651. function orgschedule() {
  652. ############################# URL CHECKING FOR USERNAME
  653. // if(isset($this->params['url']['usr2']))
  654. // $userName=$this->params['url']['usr2'];
  655. // else
  656. // $userName = substr( $this->params['url']['url'], strpos($this->params['url']['url'], "=")+1,( strlen($this->params['url']['url'])-strpos(env("HTTP_HOST"), "=")) );
  657. $userName=$this->params['url']['subDomain'];
  658. //$userName='testOrganisation';
  659. $queryUsers=mysql_query("SELECT UDTL.user_id userId,U.user_group_master_id GrpId FROM users U,user_details UDTL WHERE U.id=UDTL.user_id AND U.username='".$userName."'") or die(" Error on line ".__LINE__.mysql_error());
  660. if(mysql_num_rows($queryUsers)>0) {
  661. $fetchUsers=mysql_fetch_array($queryUsers);
  662. if($fetchUsers['GrpId']>2)
  663. $this->pageTitle = ucfirst($userName) .' Schedule';
  664. else
  665. $this->pageTitle = ucfirst($userName) .' Testimonial';
  666. //We are setting this variable beaciuse that willl be use in login elemenet
  667. $this->set("controller",$this->params['controller']);
  668. $this->set("action",$this->params['action']);
  669. $this->Websitetemplateinfo($fetchUsers['userId']);
  670. $this->layout=$this->filelayoutName;
  671. $this->set('profileviewUid',$fetchUsers['userId']);
  672. $this->set('profileviewUgrpId',$fetchUsers['GrpId']);
  673. #################### LOGIN SECTION CODE
  674. #################### LOGIN SECTION CODE
  675. ############################### About us Txt ##########################
  676. $websiteQry = "SELECT IFNULL(testimonial,'Text awaiting')as abouttxt FROM photographer_website WHERE user_id='".$fetchUsers['userId']."'";
  677. $websiteQry_res = mysql_query($websiteQry);
  678. $websiteQry_arr = mysql_fetch_array($websiteQry_res);
  679. $this->set('content',$websiteQry_arr['abouttxt']);
  680. if(isset($this->data)) {
  681. $Id=$this->data['Event']['headerEventId'];
  682. $page=$this->data['Event']['page'];
  683. $this->set("Id",$Id);
  684. $this->set("page",$page);
  685. //pr($this->data);
  686. $wintype=$this->Login($this->data);
  687. $this->set("wintype",$wintype);
  688. }
  689. #####################################################################
  690. }
  691. #####################################
  692. }
  693. function orgticevent() {
  694. $userName=$this->params['url']['subDomain'];
  695. //$userName = 'testOrganisation';
  696. $queryUsers=mysql_query("SELECT UDTL.user_id userId,U.user_group_master_id GrpId FROM users U,user_details UDTL WHERE U.id=UDTL.user_id AND U.username='".$userName."'") or die(" Error on line ".__LINE__.mysql_error());
  697. $fetchUsers=mysql_fetch_array($queryUsers);
  698. $this->pageTitle = ucfirst($userName) .' Tickets';
  699. $this->Websitetemplateinfo($fetchUsers['userId']);
  700. $this->layout=$this->filelayoutName;
  701. $this->set('profileviewUid',$fetchUsers['userId']);
  702. $this->set('profileviewUgrpId',$fetchUsers['GrpId']);
  703. $curDate=date("Y-m-d");
  704. $this->set("Userid",$fetchUsers['userId']);
  705. $this->set("controller","pages");
  706. $this->set("action","orgticevent");
  707. $select="SELECT T.* ,TV.id tvId,TV.venue_name venueName,USR.username,USR.id as postedbyuser,TCAT.id as ticketcategoryId ,TCAT.cat_name as ticketcategory";
  708. $from=" FROM tickets T
  709. LEFT JOIN ticket_event_venue TV ON (T.ticket_venue_section_id=TV.id)
  710. LEFT JOIN ticket_event_category TCAT ON (T.ticket_category_id=TCAT.id)
  711. LEFT JOIN users USR ON (T.user_id=USR.id)";
  712. $where="WHERE (NOW() < ticevent_enddate) ";
  713. $where.=" AND T.user_id='".$fetchUsers['userId']."'";
  714. $CountField='T.id';
  715. $others=" order by T.id desc ";
  716. // $where='WHERE 1'; /* For testing */
  717. $PassParameter='';
  718. $this->set("PassParameter",$PassParameter);
  719. $this->pagination($select,$from,$where,$others,$CountField,$this->params['url'],$PassParameter);
  720. if(isset($this->params['url']['Page'])) {
  721. $this->render("orgticevent2","ajax");
  722. }
  723. }
  724. function orgauctxonevent() {
  725. $userName=$this->params['url']['subDomain'];
  726. //$userName = 'testOrganisation';
  727. $queryUsers=mysql_query("SELECT UDTL.user_id userId,U.user_group_master_id GrpId FROM users U,user_details UDTL WHERE U.id=UDTL.user_id AND U.username='".$userName."'") or die(" Error on line ".__LINE__.mysql_error());
  728. $fetchUsers=mysql_fetch_array($queryUsers);
  729. $this->pageTitle = ucfirst($userName) .' Tickets';
  730. $this->Websitetemplateinfo($fetchUsers['userId']);
  731. $this->layout=$this->filelayoutName;
  732. $this->set('profileviewUid',$fetchUsers['userId']);
  733. $this->set('profileviewUgrpId',$fetchUsers['GrpId']);
  734. $curDate=date("Y-m-d");
  735. $this->set("Userid",$fetchUsers['userId']);
  736. $this->set("controller","pages");
  737. $this->set("action","orgauctxonevent");
  738. $select =" SELECT auctxons.title,auctxons.objective,auctxons.enddateofdonation,auctxons.enddateofauction ,user_details.user_profile_img ,auctxons.id ,auctxons.is_featured , users.username , users.id as auctxonpostedby ";
  739. $from=" from auctxons
  740. LEFT JOIN user_details On (auctxons.user_id =user_details.user_id)
  741. LEFT JOIN users On (auctxons.user_id =users.id)
  742. ";
  743. $where="
  744. WHERE auctxons.is_temp='1' and auctxons.is_delete='0' and CURDATE()>=auctxons.startdateofauction and auctxons.enddateofauction>=CURDATE() and auctxons.user_id='".$fetchUsers['userId']."'
  745. ";
  746. $others=" order by auctxons.enddateofdonation desc ";
  747. $PassParameter="";
  748. $fltr='';
  749. $CountField="auctxons.id";
  750. $this->set("fltr",$fltr);
  751. $this->set("PassParameter",$PassParameter);
  752. $this->pagination($select,$from,$where,$others,$CountField,$this->params['url'],$PassParameter);
  753. if(isset($this->params['url']['Page'])) {
  754. $this->render("orgauctxonevent2","ajax");
  755. }
  756. }
  757. function ajaxtimerorgauctxonlist($catId=null,$searchtxt=null,$userId=null) {
  758. if(isset($_SESSION['CurrentListFrom']))
  759. $limitfrom = $_SESSION['CurrentListFrom'] ;
  760. else
  761. $limitfrom = 0 ;
  762. if(isset($_SESSION['CurrentListto']))
  763. $limitTo = $_SESSION['CurrentListto'] ;
  764. else
  765. $limitTo = $this->Totalrecdisplay ;
  766. $timersql ="
  767. SELECT auctxons.title,auctxons.objective,auctxons.enddateofdonation,auctxons.enddateofauction ,user_details.user_profile_img ,auction_donor_product_final.*
  768. from auctxons
  769. LEFT JOIN auction_donor_product_final ON (auction_donor_product_final.auctxon_id=auctxons.id)
  770. LEFT JOIN user_details On (auctxons.user_id =user_details.user_id)
  771. WHERE auctxons.is_temp='1' and auctxons.is_delete='0' and CURDATE()>=auctxons.startdateofauction and auctxons.enddateofauction>=CURDATE() and auctxons.user_id='".$userId."'
  772. ";
  773. $timersql.=" order by auctxons.enddateofdonation desc , auction_donor_product_final.id desc LIMIT $limitfrom , $limitTo ";
  774. echo $timersql ;
  775. $this->set("Listquery",$timersql);
  776. $this->render("ajaxtimerauctxonlistdivupdate","ajax");
  777. }
  778. function orgsponsorevent() {
  779. $userName=$this->params['url']['subDomain'];
  780. //$userName = 'debopamsikder';
  781. $queryUsers=mysql_query("SELECT UDTL.user_id userId,U.user_group_master_id GrpId FROM users U,user_details UDTL WHERE U.id=UDTL.user_id AND U.username='".$userName."'") or die(" Error on line ".__LINE__.mysql_error());
  782. $fetchUsers=mysql_fetch_array($queryUsers);
  783. $this->pageTitle = ucfirst($userName) .' Sponsors Event';
  784. $this->Websitetemplateinfo($fetchUsers['userId']);
  785. $this->layout=$this->filelayoutName;
  786. $this->set('profileviewUid',$fetchUsers['userId']);
  787. $this->set('profileviewUgrpId',$fetchUsers['GrpId']);
  788. $curDate=date("Y-m-d");
  789. $this->set("Userid",$fetchUsers['userId']);
  790. $this->set("controller","pages");
  791. $this->set("action","orgsponsorevent");
  792. ######################################################### SPONSORSHIP QUERY #####################
  793. $select = "
  794. SELECT SPON.id as sponsorshipid,SPONplan.id as Planid , SPONplan.sponsor_type_id as planTypeid,IFNULL(DATE_FORMAT(SPON.end_applied_date,'%Y-%m-%d'),CURDATE()) as lastdate ,
  795. IF(SPON.ticket_id>0,SPONEVENT.ticevent_name,SPON.event_title) as event_name , IF(SPON.ticket_id>0,SPONEVENT.ticevent_desc,SPON.event_desc) as event_desc , SPON.terms ,
  796. CONCAT_WS(' , ',city_master.city_name,state.Name,countries.country_name) as sponLocation,SPONEVENT.ticevent_image ,
  797. IF(SPON.ticket_id>0,SPONEVENT.ticevent_date,SPON.starteventdate) as eventStartdate ,
  798. SPONplan.broucherfile, SPONplan.event_image, SPON.country_id, SPON.state_id , SPON.city_id, sponsor_category.catname ,
  799. sponsor_category.id as plancatId , SPONplan.id as MemberPlanId , SPONplan.sponsor_type_id as MemberPlanList,
  800. SPON.is_featured AS sponsorFeatured , SPONuser.username as planowner , SPON.ticket_id ,
  801. SPONuser.id as planownerId
  802. ";
  803. $from="
  804. FROM sponsors SPON
  805. LEFT JOIN sponsor_plan SPONplan ON SPON.id = SPONplan.sponsor_id
  806. LEFT JOIN tickets SPONEVENT ON SPON.ticket_id= SPONEVENT.id
  807. LEFT JOIN users XU ON XU.id= SPONEVENT.user_id
  808. LEFT JOIN user_details EUD ON XU.id = EUD.user_id
  809. LEFT JOIN sponsor_category ON SPON.sponsor_cat_id = sponsor_category.id
  810. LEFT JOIN users SPONuser ON SPONplan.user_id = SPONuser.id
  811. LEFT JOIN countries ON SPON.country_id = countries.id
  812. LEFT JOIN state ON SPON.state_id = state.id
  813. LEFT JOIN city_master ON SPON.city_id = city_master.city_id
  814. " ;
  815. $where=" WHERE SPON.is_temp='0' AND SPONplan.delstatus='0' AND SPONplan.user_id='".$fetchUsers['userId']."' AND SPON.end_applied_date > CURDATE() ";
  816. #####################################################
  817. $CountField='SPON.id';
  818. $others=" ";
  819. $PassParameter='';
  820. $this->set("PassParameter",$PassParameter);
  821. $this->pagination($select,$from,$where,$others,$CountField,$this->params['url'],$PassParameter);
  822. if(isset($this->params['url']['Page'])) {
  823. $this->render("orgticevent2","ajax");
  824. }
  825. }
  826. function orgproject() {
  827. $userName=$this->params['url']['subDomain'];
  828. //$userName="testOrganisation";
  829. $queryUsers=mysql_query("SELECT UDTL.user_id userId,U.user_group_master_id GrpId FROM users U,user_details UDTL WHERE U.id=UDTL.user_id AND U.username='".$userName."'") or die(" Error on line ".__LINE__.mysql_error());
  830. $fetchUsers=mysql_fetch_array($queryUsers);
  831. $this->pageTitle = ucfirst($userName) .' Projects';
  832. $this->Websitetemplateinfo($fetchUsers['userId']);
  833. $this->layout=$this->filelayoutName;
  834. $this->eventhome();
  835. $this->set('profileviewUid',$fetchUsers['userId']);
  836. $this->set('profileviewUgrpId',$fetchUsers['GrpId']);
  837. //I am using the same login window for the projects section so the variable name is littke weired
  838. //$this->data['Event']['headerEventId']
  839. if(!empty($this->data) && isset($this->data['Event']['headerEventId'])) {
  840. $projectId=$this->data['Event']['headerEventId'];
  841. $wintype=$this->Login($this->data);
  842. if($wintype=="NOT AUTH")
  843. $this->render("notautho");
  844. }
  845. $curDate=date("Y-m-d");
  846. $this->set("Userid",$fetchUsers['userId']);
  847. $this->set("controller","pages");
  848. $this->set("action","orgproject");
  849. $this->set("parameter",'');
  850. $this->set("openLoginWindow",true);
  851. $this->set("UserId",1);
  852. if(isset($_SESSION['UserId'])) {
  853. $this->set("openLoginWindow",false);
  854. $this->set("UserId",$_SESSION['UserId']);
  855. }
  856. if(isset($this->params['url']['Page'])) {
  857. //$this->data['Event']['page']=$this->params['url']['Page'];
  858. $this->set("arg",$this->params['url']);
  859. $this->render("orgproject2","ajax");
  860. }
  861. }
  862. /* Organisation Website */
  863. function pagination($select,$from,$where,$others,$CountField,$arg,$PassParameter) {
  864. if(isset($arg['Page']))
  865. $pageFlag=$arg['Page'];
  866. $this->set("PassParameter",$PassParameter);
  867. //$SetUserNumberOfVpsPerPage=SHOW_REC; /* Defined in config->paths.php*/
  868. $SetUserNumberOfVpsPerPage=12; /* Defined in config->paths.php*/
  869. $this->set("BackgroundClass",'pagination');
  870. $this->set("SelectedPage",'pagination_over');
  871. $this->set("Linkpage",'pagination_over');
  872. $this->set("FirstImage",'fdd.gif');
  873. $this->set("PreviousImage",'previous.gif');
  874. $this->set("NextImage",'next.gif');
  875. $this->set("LastImage",'rewd.gif');
  876. $UserNumberOfVpsPerPage=12; /* Defined in config->paths.php*/
  877. if(!is_numeric($UserNumberOfVpsPerPage)|| (intval($UserNumberOfVpsPerPage)!=$UserNumberOfVpsPerPage)||($UserNumberOfVpsPerPage<=0))
  878. $UserNumberOfVpsPerPage = $SetUserNumberOfVpsPerPage;
  879. if(!isset($arg['Page'])) $arg['Page']=1;
  880. if(!isset($arg['Offset'])) $arg['Offset']=0;
  881. $Query_ForNumber_Records=mysql_query("$select $from $where $others") or die('Line no 120' . mysql_error());
  882. //$Result_Query_ForNumber_Records=mysql_fetch_object($Query_Fo…

Large files files are truncated, but you can click here to view the full file