PageRenderTime 68ms CodeModel.GetById 28ms RepoModel.GetById 0ms app.codeStats 0ms

/app/controllers/users_controller.php

https://bitbucket.org/fxrialab/spsp_editor
PHP | 2812 lines | 2118 code | 480 blank | 214 comment | 424 complexity | 7abfd0156b5aa0d4caea3a595afe5acb 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

  1. <?php
  2. class UsersController extends AppController {
  3. var $name='Users';
  4. var $components = array('Pagination','Thumbnail','Thumbnailc','Sendmail'); // ,'Cakephpbb' for phpbb componrent - not need
  5. var $helpers = array('javascript', 'error', 'Pagination','Ajax','Friendsurl');
  6. //this function is used to display the comming soon page
  7. //delete this function along with LAYOUT = FALASE and VIEW - FALSEINDEX
  8. function falseindex() {
  9. $this->layout = 'false';
  10. }
  11. function index() {
  12. $this->layout = 'default';
  13. $this->checkSession();
  14. }
  15. function sendforgotpassword() {
  16. if(isset($this->data['User']['userForgotName']) && $this->data['User']['userForgotName']!='') {
  17. $forgotuser = "SELECT password,id from users where username='".mysql_escape_string($this->data['User']['userForgotName'])."' ";
  18. $forgotuser_res = mysql_query($forgotuser);
  19. if(mysql_num_rows($forgotuser_res)>0) {
  20. $forgotuser_arr = mysql_fetch_array($forgotuser_res);
  21. $userDetails=$this->getUserDetails($forgotuser_arr['id']);
  22. $this->set('receiptInfo',$userDetails);
  23. ####### MAIL TEMPLATE
  24. $this->Sendmail->Mail();
  25. $this->Sendmail->From(FROMMAIL);
  26. $this->Sendmail->To($userDetails['email']);
  27. //$this->Sendmail->Cc("sanjib@navsoft.in");
  28. $subject="XOIMAGES PASSWORD REQUEST";
  29. $this->Sendmail->Subject($subject);
  30. $this->Sendmail->layout='email';
  31. $this->Sendmail->view='mail_userpassword';
  32. $this->Sendmail->startup($this);
  33. $messageBody=$this->Sendmail->bodyText();
  34. $this->Sendmail->Body($messageBody); // set the body
  35. $this->Sendmail->Priority(1) ;
  36. $this->Sendmail->Send();
  37. $this->set('mailmsg','Your login information has been sent to your email.');
  38. #####
  39. }
  40. else {
  41. $this->set('mailmsg','Username is invalid. Please give A valid Username.');
  42. }
  43. }
  44. $this->render('validpasssending', 'ajax');
  45. }
  46. ################################################### PHOTOS SECTION #############################
  47. function indexnew() {
  48. $this->layout = 'xoindex';
  49. $this->homepageslideInfo('Home');
  50. ################################################ Auction Invitation ################
  51. if(isset($_REQUEST['key'])&& $_REQUEST['key']!='') {
  52. $this->Session->write('auctKey',$_REQUEST['key']);
  53. if(isset($_REQUEST['act'])&& $_REQUEST['act']=='auctiondonorsinvite')
  54. $this->Session->write('auctType',$_REQUEST['act']);
  55. }
  56. ############################################ /Auction Invitation ################
  57. }
  58. function photos() {
  59. $this->layout = 'userphotoinner_home';
  60. $this->homepageslideInfo('Photos');
  61. }
  62. function customprofile($savimgpath=null) {
  63. $this->layout = 'profile_blank';
  64. $this->set("saveimagepath",$savimgpath);
  65. }
  66. function myalbum() {
  67. $this->checkSession();
  68. $this->layout = 'userphotoinner';
  69. $this->pageTitle = 'My Album';
  70. }
  71. function allalbum() {
  72. $this->layout = 'userphotoinner';
  73. $this->pageTitle = 'All Album';
  74. $select = " Select Xalbum.id,Xalbum.user_id,Xalbum.album_bg,Xalbum.album_access,Xalbum.album_name,Xuser.username";
  75. $from=" FROM user_albums Xalbum
  76. LEFT JOIN users Xuser ON Xalbum.user_id = Xuser.id
  77. LEFT JOIN user_details Xuserdetail ON Xalbum.user_id = Xuserdetail.user_id";
  78. $where="WHERE 1 AND Xalbum.album_access='public'";
  79. $others=" ";
  80. $others=" order by Xalbum.id desc";
  81. $PassParameter='';
  82. $fltr='';
  83. $CountField="Xalbum.id";
  84. $this->set("controller","users");
  85. $this->set("action","allalbum");
  86. $this->set("parameter",$PassParameter);
  87. $this->set("fltr",$fltr);
  88. $this->pagination($select,$from,$where,$others,$CountField,$this->params['url'],$PassParameter);
  89. if(isset($this->params['url']['Page'])) {
  90. $this->render("allalbum2","ajax");
  91. }
  92. }
  93. function photolisting() {
  94. $this->layout = 'userphotoinner';
  95. if(isset($_REQUEST['listtype']) && $_REQUEST['listtype']!='')
  96. $catlisttype = $_REQUEST['listtype'];
  97. else
  98. $catlisttype = '';
  99. ############################### Page Title & Head ############################
  100. $pageheadArr = array();
  101. $pageheadArr['featured'] = 'Featured';
  102. $pageheadArr['recent'] = 'Recent';
  103. $pageheadArr['mostvoted'] = 'Most Voted';
  104. $pageheadArr['mostcomment'] = 'Most Discussed';
  105. $pageheadArr['random'] = 'Random';
  106. $pageheadArr['favorite'] = 'Most Favorited ';
  107. $pageheadArr['tag'] = 'Tagged ';
  108. $pageheadArr['search'] = 'Search Result';
  109. $pageheadArr['mostviewed'] = 'Most Viewed';
  110. $pageheadArr['albumview'] = 'Album';
  111. if (array_key_exists($catlisttype, $pageheadArr)) {
  112. if($catlisttype=='albumview') {
  113. /* Album Name*/
  114. $albumNameSql = "Select IFNULL(album_name,'') as albumName from user_albums where id='".base64_decode($_REQUEST['albumid'])."'";
  115. $albumNameSql_res = mysql_fetch_array(mysql_query($albumNameSql));
  116. $albumName = stripslashes($albumNameSql_res['albumName']) ;
  117. /**/
  118. $this->pageTitle = $pageheadArr[$catlisttype]. $albumName.' Photos';
  119. $this->set('pagehead',$pageheadArr[$catlisttype].' : '. $albumName. ' Photos');
  120. }
  121. else {
  122. if($catlisttype=='tag') {
  123. $this->pageTitle = $pageheadArr[$catlisttype].' Photos : '. substr($_REQUEST['sortby'],0,20);
  124. $this->set('pagehead',$pageheadArr[$catlisttype].' Photos : '.substr($_REQUEST['sortby'],0,20));
  125. }
  126. else {
  127. $this->pageTitle = $pageheadArr[$catlisttype].' Photos';
  128. $this->set('pagehead',$pageheadArr[$catlisttype].' Photos');
  129. }
  130. }
  131. }
  132. else {
  133. $this->pageTitle = 'Photos';
  134. $this->set('pagehead','Photos');
  135. }
  136. ############################### Page Title & Head ############################
  137. /* Pagination and PHOTO listing */
  138. $select = " Select X.id,X.user_id,X.pic_original_name,X.pic_title,X.pic_desc,Xuser.username ,COUNT(Xcomment.id) as photoreview , Xuserdetail.user_profile_img , IFNULL(ROUND(AVG(Xrating.vote),0),0) as photorat,Xalbum.album_name ,Xalbum.id as albumid ,COUNT(Xfavorite.id) as photofavored ,X.is_featured , X.creation";
  139. $from=" FROM user_photo_albums X
  140. LEFT JOIN user_albums Xalbum ON X.user_album_id = Xalbum.id
  141. LEFT JOIN comments Xcomment ON X.id = Xcomment.user_photo_albums_id
  142. LEFT JOIN users Xuser ON X.user_id = Xuser.id
  143. LEFT JOIN user_details Xuserdetail ON X.user_id = Xuserdetail.user_id
  144. LEFT JOIN user_voting_images Xrating ON X.id = Xrating.image_id
  145. LEFT JOIN user_favorite_photo Xfavorite ON X.id=Xfavorite.favorite_photo_id ";
  146. $where="WHERE 1 AND X.is_blocked='0' AND X.is_temp='0' AND Xalbum.album_access='public'";
  147. if($catlisttype=='featured')
  148. $where.=" AND X.is_featured='1' ";
  149. if( $catlisttype=='albumview' && isset($_REQUEST['albumid']) && base64_decode($_REQUEST['albumid'])>0)
  150. $where.=" AND X.user_album_id='".base64_decode($_REQUEST['albumid'])."' ";
  151. if($catlisttype=='tag')
  152. $where.=" AND X.id IN (Select user_photo_album_id from user_photo_albums_tags where tagname Like '%".$_REQUEST['sortby']."%')";
  153. if($catlisttype=='search')
  154. $where.=" AND X.pic_title LIKE '%".$_REQUEST['srchtxt']."%' OR X.id IN (Select user_photo_album_id from user_photo_albums_tags where tagname Like '%".$_REQUEST['srchtxt']."%') ";
  155. $others=" group by X.id order by X.id desc ";
  156. if($catlisttype=='mostvoted')
  157. $others .=" ,photorat desc ";
  158. if($catlisttype=='mostcomment')
  159. $others .=" ,photoreview desc ";
  160. if($catlisttype=='mostviewed')
  161. $others .=" ,X.viewed desc ";
  162. if($catlisttype=='random')
  163. $others .=" , rand()";
  164. if($catlisttype=='favorite')
  165. $others .=" ,photofavored desc ";
  166. if($catlisttype=='recent')
  167. $others.=" ";
  168. if(isset($_REQUEST['sortby']) && $_REQUEST['sortby']!='')
  169. $PassParameter="listtype=".$catlisttype."&sortby=".$_REQUEST['sortby'];
  170. else {
  171. if(isset($catlisttype) && $catlisttype=='albumview')
  172. $PassParameter="listtype=".$catlisttype."&albumid=".$_REQUEST['albumid'];
  173. else {
  174. if(isset($_REQUEST['srchtxt']) && $_REQUEST['srchtxt']!='')
  175. $PassParameter="listtype=".$catlisttype."&srchtxt=".$_REQUEST['srchtxt'];
  176. else
  177. $PassParameter="listtype=".$catlisttype;
  178. }
  179. }
  180. $fltr='';
  181. $CountField="X.id";
  182. $this->set("controller","users");
  183. $this->set("action","photolisting");
  184. $this->set("parameter",$PassParameter);
  185. $this->set("fltr",$fltr);
  186. $this->pagination($select,$from,$where,$others,$CountField,$this->params['url'],$PassParameter);
  187. if(isset($this->params['url']['Page']) || (isset($fltr) && $fltr!="") ) {
  188. $this->set('pagehead','Most Recent');
  189. $this->render("photolisting2","ajax");
  190. }
  191. /**/
  192. }
  193. function featuredphoto($catlisttype=null) {
  194. $this->layout = 'profile_blank';
  195. /* Pagination and PHOTO listing */
  196. $select = " Select X.id,X.user_id,X.pic_original_name,X.pic_title,X.pic_desc,Xuser.username ,COUNT(Xcomment.id) as photoreview , Xuserdetail.user_profile_img , IFNULL(ROUND(AVG(Xrating.vote),0),0) as photorat,Xalbum.album_name ,Xalbum.id as albumid ,COUNT(Xfavorite.id) as photofavored ,X.is_featured,X.creation ";
  197. $from=" FROM user_photo_albums X
  198. LEFT JOIN user_albums Xalbum ON X.user_album_id = Xalbum.id
  199. LEFT JOIN comments Xcomment ON X.id = Xcomment.user_photo_albums_id
  200. LEFT JOIN users Xuser ON X.user_id = Xuser.id
  201. LEFT JOIN user_details Xuserdetail ON X.user_id = Xuserdetail.user_id
  202. LEFT JOIN user_voting_images Xrating ON X.id = Xrating.image_id
  203. LEFT JOIN user_favorite_photo Xfavorite ON X.id=Xfavorite.favorite_photo_id ";
  204. $where="WHERE 1 AND X.is_blocked='0' AND X.is_temp='0' AND Xalbum.album_access='public'";
  205. $moreUrl = $this->webroot.'users/photolisting?listtype=recent';
  206. if($catlisttype=='featured') {
  207. $where.=" AND X.is_featured='1' ";
  208. $moreUrl = $this->webroot.'users/photolisting?listtype=featured';
  209. }
  210. $others=" group by X.id ";
  211. if($catlisttype=='mostvoted') {
  212. $others .=" order by photorat desc ";
  213. $moreUrl = $this->webroot.'users/photolisting?listtype=mostvoted';
  214. }
  215. if($catlisttype=='')
  216. $others.=" order by X.id desc";
  217. $photoquery = mysql_query($select .$from .$where.$others .' LIMIT 12');
  218. $this->set('query',$photoquery) ;
  219. $this->set('morelink',$moreUrl) ;
  220. }
  221. function pagination($select,$from,$where,$others,$CountField,$arg,$PassParameter) {
  222. if(isset($arg['Page']))
  223. $pageFlag=$arg['Page'];
  224. $this->set("PassParameter",$PassParameter);
  225. $SetUserNumberOfVpsPerPage=SHOW_REC; /* Defined in config->paths.php*/
  226. $this->set("BackgroundClass",'pagination');
  227. $this->set("SelectedPage",'pagination_over');
  228. $this->set("Linkpage",'pagination_over');
  229. $this->set("FirstImage",'fdd.gif');
  230. $this->set("PreviousImage",'previous.gif');
  231. $this->set("NextImage",'next.gif');
  232. $this->set("LastImage",'rewd.gif');
  233. $UserNumberOfVpsPerPage=SHOW_REC; /* Defined in config->paths.php*/
  234. if(!is_numeric($UserNumberOfVpsPerPage)|| (intval($UserNumberOfVpsPerPage)!=$UserNumberOfVpsPerPage)||($UserNumberOfVpsPerPage<=0))
  235. $UserNumberOfVpsPerPage = $SetUserNumberOfVpsPerPage;
  236. if(!isset($arg['Page'])) $arg['Page']=1;
  237. if(!isset($arg['Offset'])) $arg['Offset']=0;
  238. ///echo "$select $from $where $others" ;
  239. $Query_ForNumber_Records=mysql_query("$select $from $where $others") or die('Line no 120' . mysql_error());
  240. //$Result_Query_ForNumber_Records=mysql_fetch_object($Query_ForNumber_Records);
  241. //$NoOfVps=$Result_Query_ForNumber_Records->NoOfVps;
  242. $NoOfVps=mysql_num_rows($Query_ForNumber_Records);
  243. $NumberOfVpsPerPage=$UserNumberOfVpsPerPage;
  244. $NoOfPages=ceil($NoOfVps/$NumberOfVpsPerPage); //3
  245. if($arg['Offset']==$NoOfVps) {
  246. if(isset($Offset)) {
  247. $Offset=$Offset-$NumberOfVpsPerPage;
  248. $Page--;
  249. if($Offset<0) {
  250. $Offset=0;
  251. $Page=1;
  252. }
  253. }else {
  254. $Offset=0;
  255. $Page=1;
  256. }
  257. }
  258. $this->set("Page",$arg['Page']);
  259. $this->set("Offset",$arg['Offset']);
  260. $this->set("NumberOfVpsPerPage",$NumberOfVpsPerPage);
  261. $this->set("NoOfPages",$NoOfPages);
  262. $this->set("UserNumberOfVpsPerPage",$UserNumberOfVpsPerPage);
  263. //print "$select $from $where $others";
  264. $this->set("qryOthr","$select $from $where");
  265. //echo "$select $from $where $others LIMIT ".$arg['Offset'].",$NumberOfVpsPerPage";
  266. $SelectRecord = mysql_query("$select $from $where $others LIMIT ".$arg['Offset'].",$NumberOfVpsPerPage") or die('Line no '.__LINE__ . mysql_error());
  267. $this->set("query",$SelectRecord);
  268. }
  269. ################################################### PHOTOS SECTION #############################
  270. function aboutus() {
  271. $this->layout = 'default';
  272. ########### data from table ######
  273. $contectsql = "Select description from site_managements where id='1'";
  274. $contectsql_res = mysql_query($contectsql);
  275. $contectsql_arr = mysql_fetch_array($contectsql_res);
  276. $this->set('content',$contectsql_arr['description']);
  277. ######
  278. }
  279. function contactus($windowType=null) {
  280. $this->layout = 'default';
  281. ########### data from table ######
  282. $contectsql = "Select description from site_managements where id='2'";
  283. $contectsql_res = mysql_query($contectsql);
  284. $contectsql_arr = mysql_fetch_array($contectsql_res);
  285. $this->set('content',$contectsql_arr['description']);
  286. if($windowType)
  287. $this->set('windowcontent',$windowType);
  288. else
  289. $this->set('windowcontent','feedback');
  290. ######
  291. }
  292. function contactusajax($pageaction=null) {
  293. echo $pageaction;
  294. $this->set('pagecontentText',$pageaction);
  295. $this->render('contactusajax', 'ajax');
  296. }
  297. function terms() {
  298. $this->layout = 'default';
  299. ########### data from table ######
  300. $contectsql = "Select description from site_managements where id='3'";
  301. $contectsql_res = mysql_query($contectsql);
  302. $contectsql_arr = mysql_fetch_array($contectsql_res);
  303. $this->set('content',$contectsql_arr['description']);
  304. ######
  305. }
  306. function privacy() {
  307. $this->layout = 'default';
  308. ########### data from table ######
  309. $contectsql = "Select description from site_managements where id='4'";
  310. $contectsql_res = mysql_query($contectsql);
  311. $contectsql_arr = mysql_fetch_array($contectsql_res);
  312. $this->set('content',$contectsql_arr['description']);
  313. ######
  314. }
  315. function disclaimer() {
  316. $this->layout = 'default';
  317. ########### data from table ######
  318. $contectsql = "Select description from site_managements where id='5'";
  319. $contectsql_res = mysql_query($contectsql);
  320. $contectsql_arr = mysql_fetch_array($contectsql_res);
  321. $this->set('content',$contectsql_arr['description']);
  322. ######
  323. }
  324. function parents() {
  325. $this->layout = 'default';
  326. ########### data from table ######
  327. $contectsql = "Select description from site_managements where id='7'";
  328. $contectsql_res = mysql_query($contectsql);
  329. $contectsql_arr = mysql_fetch_array($contectsql_res);
  330. $this->set('content',$contectsql_arr['description']);
  331. ######
  332. }
  333. function home() {
  334. $this->layout = 'default';
  335. $this->pageTitle = 'Home';
  336. $this->pageTitle = 'User Login';
  337. if(isset($_SESSION['UserId']) && $_SESSION['UserId']!="") {
  338. $tempid = time();
  339. $tempsessid = session_id();
  340. $this->set('loggedUid',base64_encode($_SESSION['UserId']));
  341. $this->set('loggedId',$tempid);
  342. $this->set('loggedsid',$tempsessid);
  343. }
  344. }
  345. function login() {
  346. $this->layout = 'default';
  347. $this->pageTitle = 'User Login';
  348. if(!empty($this->data)) {
  349. $this->data['User']['username']=trim($this->data['User']['userLoginName']);
  350. $this->data['User']['password']=base64_encode(trim($this->data['User']['userLoginPass']));
  351. $someone = $this->User->findByUsername($this->data['User']['username']);
  352. $hRef = $_SERVER['HTTP_REFERER'];
  353. $this->Session->write('href', $hRef);
  354. if(!empty($someone['User']['password']) && $someone['User']['password'] == $this->data['User']['password'] && $someone['User']['user_status']==1) {
  355. if($someone['User']['user_status']==1) {
  356. $this->Session->write('User', $someone['User']['username']);
  357. $this->Session->write('UserId', $someone['User']['id']);
  358. $this->Session->write('GrpId', $someone['User']['user_group_master_id']);
  359. ########################## AUCTION INVITATION OPERATION #######
  360. if(isset($_SESSION['auctKey']))
  361. $this->auctInviteoperation() ;
  362. ############################# /AUCTION INVITATION OPERATION #######
  363. if(isset($_REQUEST['act_event']) && $_REQUEST['act_event'] != "") {
  364. $link = 'calendars/acceptinvitation?id='.time().'&uid='.base64_encode($someone['User']['id']).'&sessid='.'&evid='.$_REQUEST['evtid'].'&invitation='.$_REQUEST['invitation'];
  365. $this->redirect($link);
  366. }
  367. else if(isset($_REQUEST['act']) && $_REQUEST['act'] == "activityinvite") {
  368. $link = 'calendars/showactivity?id='.time().'&uid='.base64_encode($someone['User']['id']).'&sessid='.'&evid='.$_REQUEST['evtid'].'&invitation='.base64_decode($_REQUEST['invitation']);
  369. $this->redirect($link);
  370. }
  371. else if(isset($_REQUEST['actVal']) && $_REQUEST['actVal'] == "sharecal") {
  372. $qry = "insert into calendar_import values(".base64_decode($_REQUEST['calid']).", ".$someone['User']['id'].", 'y')";
  373. $res = mysql_query($qry);
  374. $link = 'users/user_home?id='.time().'&uid='.base64_encode($someone['User']['id']).'&sessid='.base64_encode(1);
  375. $this->redirect($link);
  376. }
  377. else if(isset($_REQUEST['actVal']) && $_REQUEST['actVal'] == "eventinvite") {
  378. $link = 'calendars/acceptinvitation?id='.time().'&uid='.base64_encode($someone['User']['id']).'&sessid='.'&evid='.$_REQUEST['evidVal'].'&invitation='.$_REQUEST['invitationVal'];
  379. $this->redirect($link);
  380. }
  381. else if(isset($_REQUEST['actVal']) && $_REQUEST['actVal'] == "activityinvite") {
  382. $link = 'calendars/showactivity?id='.time().'&uid='.base64_encode($someone['User']['id']).'&sessid='.'&evid='.$_REQUEST['evidVal'].'&invitation='.$_REQUEST['invitationVal'];
  383. $this->redirect($link);
  384. }
  385. else {
  386. $this->flash('The username with id: '.$this->data['User']['username'].' has been submitted.', '/users');
  387. $link = 'users/user_home?id='.time().'&uid='.base64_encode($someone['User']['id']).'&sessid='.base64_encode(1);
  388. $this->redirect($link);
  389. }
  390. }
  391. else {
  392. $msg = "Invalid Login";
  393. $this->redirect('/users/signup?msg=error');
  394. }
  395. }
  396. else {
  397. $msg = "Invalid Login";
  398. $this->redirect('/users/signup?msg=error');
  399. }
  400. }
  401. }
  402. function headerlogin() {
  403. $this->layout = 'default';
  404. $this->pageTitle = 'User Login';
  405. if(!empty($this->data)) {
  406. $this->data['User']['username']=trim($this->data['User']['headerLoginName']);
  407. $this->data['User']['password']=base64_encode(trim($this->data['User']['headerLoginPass']));
  408. $someone = $this->User->findByUsername($this->data['User']['username']);//"http://adserver:8088/xoimage-115-07/Nnew/"
  409. $hRef = $_SERVER['HTTP_REFERER'];
  410. $this->Session->write('href', $hRef);
  411. if(!empty($someone['User']['password']) && $someone['User']['password'] == $this->data['User']['password'] && $someone['User']['user_status']==1) {
  412. if($someone['User']['user_status']==1) {
  413. mysql_query("DELETE FROM xoevent_cart WHERE xoevent_pay_status='0' AND user_id='".$someone['User']['id']."' AND xoevent_sessionid!='".session_id()."'") or die(mysql_error());
  414. $_REQUEST['actVal'];
  415. $this->Session->write('User', $someone['User']['username']);
  416. $this->Session->write('UserId', $someone['User']['id']);
  417. $this->Session->write('GrpId', $someone['User']['user_group_master_id']);
  418. ##################### FORUM SESSION START
  419. /* $ch = curl_init();
  420. $scriptUrl = DOMAIN. 'phpbbcakelogin.php?userName='.$this->data['User']['username'].'&password='.$this->data['User']['password'];
  421. curl_setopt($ch, CURLOPT_URL, $scriptUrl);
  422. curl_setopt($ch, CURLOPT_HEADER, 0);
  423. $output =curl_exec($ch);
  424. curl_close($ch);
  425. echo $output ;/**/
  426. //$this->Cakephpbb->phpbbuserlogged($this->data['User']['username'],$this->data['User']['password']);*/
  427. ##################### FORUM SESSION START
  428. if($someone['User']['user_group_master_id']==2) {
  429. //echo "group id : 2";
  430. $_SESSION['pubSchool']='p';
  431. $_SESSION['is_public']=1;
  432. $_SESSION['categoryTab']=2;
  433. }
  434. if($someone['User']['user_group_master_id']==3) {
  435. //echo "group id : 3";
  436. $_SESSION['pubSchool']='s';
  437. $_SESSION['is_public']=2;
  438. $_SESSION['categoryTab']=3;
  439. }
  440. ########################## AUCTION INVITATION OPERATION #######
  441. if(isset($_SESSION['auctKey']))
  442. $this->auctInviteoperation() ;
  443. ############################# /AUCTION INVITATION OPERATION #######
  444. if(isset($_REQUEST['act']) && $_REQUEST['act'] == "activityinvite") {
  445. $link = 'calendars/showactivity?id='.time().'&uid='.base64_encode($someone['User']['id']).'&sessid='.'&evid='.$_REQUEST['evtid'].'&invitation='.base64_decode($_REQUEST['invitation']);
  446. $this->redirect($link);
  447. }
  448. else if(isset($_REQUEST['actVal']) && $_REQUEST['actVal'] == "sharecal") {
  449. $qry = "insert into calendar_import values(".base64_decode($_REQUEST['calid']).", ".$someone['User']['id'].", 'y')";
  450. $res = mysql_query($qry);
  451. $link = 'users/user_home?id='.time().'&uid='.base64_encode($someone['User']['id']);
  452. $this->redirect($link);
  453. }
  454. else if(isset($_REQUEST['actVal']) && $_REQUEST['actVal'] == "eventinvite") {
  455. $link = 'calendars/acceptinvitation?id='.time().'&uid='.base64_encode($someone['User']['id']).'&sessid='.'&evid='.$_REQUEST['evidVal'].'&invitation='.$_REQUEST['invitationVal'];
  456. $this->redirect($link);
  457. }
  458. else if(isset($_REQUEST['actVal']) && $_REQUEST['actVal'] == "activityinvite") {
  459. $link = 'calendars/showactivity?id='.time().'&uid='.base64_encode($someone['User']['id']).'&sessid='.'&evid='.$_REQUEST['evidVal'].'&invitation='.$_REQUEST['invitationVal'];
  460. $this->redirect($link);
  461. }
  462. else {
  463. $this->flash('The username with id: '.$this->data['User']['username'].' has been submitted.', '/users');
  464. $link = 'users/user_home?id='.time().'&uid='.base64_encode($someone['User']['id']);
  465. $this->redirect($link);
  466. }
  467. }
  468. }
  469. else {
  470. $msg = "Invalid Login";
  471. $this->redirect('/?msg=headererror');
  472. }
  473. }
  474. }
  475. ############## FOR POPUPLOGIN ######
  476. function checkpopuplogin() {
  477. if(!empty($this->data)) {
  478. $this->data['User']['username']=trim($this->data['User']['headerLoginName']);
  479. $this->data['User']['password']=base64_encode(trim($this->data['User']['headerLoginPass']));
  480. $someone = $this->User->findByUsername($this->data['User']['username']);//"http://adserver:8088/xoimage-115-07/Nnew/"
  481. if(!empty($someone['User']['password']) && $someone['User']['password'] == $this->data['User']['password']) {
  482. if($someone['User']['user_status']==1) {
  483. mysql_query("DELETE FROM xoevent_cart WHERE xoevent_pay_status='0' AND user_id='".$someone['User']['id']."' AND xoevent_sessionid!='".session_id()."'") or die(mysql_error());
  484. $this->Session->write('User', $someone['User']['username']);
  485. $this->Session->write('UserId', $someone['User']['id']);
  486. $this->Session->write('GrpId', $someone['User']['user_group_master_id']);
  487. if($someone['User']['user_group_master_id']==2) {
  488. $_SESSION['pubSchool']='p';
  489. $_SESSION['is_public']=1;
  490. $_SESSION['categoryTab']=2;
  491. }
  492. if($someone['User']['user_group_master_id']==3) {
  493. $_SESSION['pubSchool']='s';
  494. $_SESSION['is_public']=2;
  495. $_SESSION['categoryTab']=3;
  496. }
  497. $link = 'users/user_home?id='.time().'&uid='.base64_encode($someone['User']['id']);
  498. $this->set("validated",0); ///right Info
  499. $this->set('userHome',$link);
  500. }
  501. }
  502. else {
  503. $this->set("validated",1); /// Error Info
  504. }
  505. }
  506. $this->render('validpopuplogin', 'ajax');
  507. }
  508. ############## FOR POPUPLOGIN ######
  509. function auctInviteoperation() {
  510. $this->checkSession();
  511. if(isset($_SESSION['auctKey'])) {
  512. $updatesql = "UPDATE auctxon_donors_invite SET is_respond='1' , registered_invitee_userid='".$_SESSION['UserId']."' where is_respond='0' and hash_key='".$_SESSION['auctKey']."' ";
  513. @mysql_query($updatesql);
  514. }
  515. }
  516. function signup() {
  517. if(isset($_SESSION['UserId'])) {
  518. $this->redirect('/?id=1');
  519. }
  520. $group=base64_decode($_REQUEST['gr']);
  521. $this->set('group',$group);
  522. ################################################ Auction Invitation ################
  523. if(isset($_REQUEST['key'])&& $_REQUEST['key']!='') {
  524. $this->Session->write('auctKey',$_REQUEST['key']);
  525. if(isset($_REQUEST['act'])&& $_REQUEST['act']=='auctiondonorsinvite')
  526. $this->Session->write('auctType',$_REQUEST['act']);
  527. }
  528. ############################################ /Auction Invitation ################
  529. $this->layout = 'user_signup';
  530. $this->pageTitle = 'Xoimage Sign-up';
  531. if (!empty($this->data)) {
  532. if(isset($_REQUEST['userType']) && $_REQUEST['userType']!="") {
  533. $this->data['User']['user_group_master_id'] = $_REQUEST['userType'];
  534. //die();
  535. }
  536. $this->data['User']['user_status'] = 1;
  537. $this->data['User']['password'] = base64_encode($this->data['User']['password']);
  538. if ($this->User->save($this->data)) {
  539. $id = mysql_insert_id();
  540. $fname = addslashes(strtolower($this->data['User']['first_name']));
  541. $lname = addslashes(strtolower($this->data['User']['last_name']));
  542. $email = $this->data['User']['email'];
  543. $user_name = trim($this->data['User']['username']) ;
  544. $pass=base64_encode(trim($this->data['User']['password']));
  545. ################ FORUM INTEGRATION
  546. $pass=$this->data['User']['password'];
  547. $email_hash=crc32($email);
  548. $sql1="INSERT INTO phpbb_users (username, username_clean, user_password, user_pass_convert, user_email, user_email_hash, group_id, user_type, user_permissions, user_timezone, user_dateformat, user_lang, user_style, user_allow_pm, user_actkey, user_ip, user_regdate, user_passchg, user_options, user_inactive_reason, user_inactive_time, user_lastmark, user_lastvisit, user_lastpost_time, user_lastpage, user_posts, user_dst, user_colour, user_occ, user_interests, user_avatar, user_avatar_type, user_avatar_width, user_avatar_height, user_new_privmsg, user_unread_privmsg, user_last_privmsg, user_message_rules, user_full_folder, user_emailtime, user_notify, user_notify_pm, user_notify_type, user_allow_viewonline, user_allow_viewemail, user_allow_massemail, user_sig, user_sig_bbcode_uid, user_sig_bbcode_bitfield, user_form_salt) VALUES ('$user_name', '$user_name', '$pass', 0, '$email', '$email_hash', 2, 0, '', 0, 'D M d, Y g:i a', 'en', '1', 1, '', '0.0.0.0', 1202106072, 1202106072, 895, 0, 0, 1202106072, 0, 0, '', 0, '0', '', '', '', '', 0, 0, 0, 0, 0, 0, 0, -3, 0, 0, 1, 0, 1, 1, 1, '', '', '', '39390ba638fe9a78')";
  549. //echo $sql1;
  550. @mysql_query($sql1);
  551. $new_query_group="select MAX(user_id) AS USERID FROM phpbb_users";
  552. $new_result_group=mysql_query($new_query_group);
  553. $new_data_group=mysql_fetch_array($new_result_group);
  554. $new_user_id=$new_data_group['USERID'];
  555. //echo $new_user_id;
  556. $new_query_insert="INSERT INTO phpbb_user_group (group_id,user_id,group_leader,user_pending) VALUES ('2','$new_user_id','0','0')";
  557. @mysql_query($new_query_insert);
  558. ################ FORUM INTEGRATION
  559. if(isset($_REQUEST['userFrndId'])) {
  560. $group = $_REQUEST['userType'];
  561. $frnd_id = base64_decode($_REQUEST['userFrndId']);
  562. $noOfFrndUsr = mysql_num_rows(mysql_query("select * from user_friends where user_id=".$id));
  563. $noFrnd = mysql_num_rows(mysql_query("select * from user_friends where user_id=".$frnd_id));
  564. $frnd_qry = mysql_query("INSERT INTO `user_friends` ( `id` , `user_id`,`friend_id`, `status` )VALUES ('',".$id.",".$frnd_id.",".($noOfFrndUsr+1).")") ;
  565. $frnd_qry = mysql_query("INSERT INTO `user_friends` ( `id` , `user_id`,`friend_id`, `status` )VALUES ('',".$frnd_id.",".$id.",".($noFrnd+1).")") ;
  566. }
  567. else
  568. $group = $this->data['User']['group_id'];
  569. $dob = $_REQUEST['year']."-".$_REQUEST['mon']."-".$_REQUEST['dob'];
  570. $gender=$_REQUEST['sex'];
  571. $city=$_REQUEST['city'];
  572. $state=$_REQUEST['province'];
  573. $country=$_REQUEST['country'];
  574. $qry = "INSERT INTO `user_details` ( `id` , `user_id`, `first_name`, `last_name`, `email`, `dob`,gender,city,state,c_id)VALUES ('',".$id.",'".$fname."','".$lname."','".$email."', '".$dob."','".$gender."','".$city."','".$state."','".$country."')" ;
  575. if($res = mysql_query($qry)) {
  576. $this->Session->write('User', $this->data['User']['username']);
  577. $this->Session->write('UserId', $id);
  578. $this->Session->write('GrpId', $this->data['User']['user_group_master_id']);
  579. //$this->flash('User has been saved.','/users');
  580. ########################## AUCTION INVITATION OPERATION #######
  581. if(isset($_SESSION['auctKey']))
  582. $this->auctInviteoperation() ;
  583. ############################# /AUCTION INVITATION OPERATION #######
  584. $this->sendVerifyemail();
  585. $this->redirect('/users/congratulations?id='.time().'&uid='.base64_encode($id).'&sessid='.session_id());
  586. }
  587. else {
  588. $id = mysql_insert_id();
  589. $this->Session->write('User', $this->data['User']['username']);
  590. $this->Session->write('UserId', $id);
  591. }
  592. if(isset($_REQUEST['act_event']) && $_REQUEST['act_event'] != "") {
  593. //echo $_REQUEST['act_event'].", ".$_REQUEST['evtid'].", ".$_REQUEST['invitation'];
  594. $link = 'calendars/acceptinvitation?id='.time().'&uid='.base64_encode($someone['User']['id']).'&sessid='.'&evid='.$_REQUEST['evtid'].'&invitation='.$_REQUEST['invitation'];
  595. $this->redirect($link);
  596. }
  597. else if(isset($_REQUEST['act']) && $_REQUEST['act'] == "activityinvite") {
  598. $link = 'calendars/showactivity?id='.time().'&uid='.base64_encode($someone['User']['id']).'&sessid='.'&evid='.$_REQUEST['evtid'].'&invitation='.$_REQUEST['invitation'];
  599. $this->redirect($link);
  600. }
  601. else if(isset($_REQUEST['actVal']) && $_REQUEST['actVal'] == "sharecal") {
  602. $checkCalIm = mysql_num_rows(mysql_query("select * from calendar_import where importer_id=".$someone['User']['id']." and import_cal_id=".base64_decode($_REQUEST['calid'])));
  603. if($checkCalIm<1) {
  604. $qry = "insert into calendar_import values(".base64_decode($_REQUEST['calid']).", ".$someone['User']['id'].", 'y')";
  605. $res = mysql_query($qry);
  606. }
  607. $link = 'users/user_home?id='.time().'&uid='.base64_encode($someone['User']['id']).'&sessid='.base64_encode(1);
  608. $this->redirect($link);
  609. }
  610. else if(isset($_REQUEST['actVal']) && $_REQUEST['actVal'] == "eventinvite") {
  611. $link = 'calendars/acceptinvitation?id='.time().'&uid='.base64_encode($someone['User']['id']).'&sessid='.'&evid='.$_REQUEST['evidVal'].'&invitation='.$_REQUEST['invitationVal'];
  612. $this->redirect($link);
  613. }
  614. else if(isset($_REQUEST['actVal']) && $_REQUEST['actVal'] == "activityinvite") {
  615. $link = 'calendars/showactivity?id='.time().'&uid='.base64_encode($someone['User']['id']).'&sessid='.'&evid='.$_REQUEST['evidVal'].'&invitation='.$_REQUEST['invitationVal'];
  616. $this->redirect($link);
  617. }
  618. else {
  619. //$this->sendVerifyemail();
  620. $this->flash('The username with id: '.$this->data['User']['username'].' has been submitted.', '/users');
  621. $this->redirect('/users/congratulations?id='.time().'&uid='.base64_encode($id).'&sessid='.session_id());
  622. }
  623. }
  624. }
  625. $currentuser = array('topleft'=>'event-photo-tab-top-left.gif','topmiddle'=>'eventphoto-tab_topmidsml','topright'=>'event-photo-tab-top-right.gif','midleft'=>'eventphoto-tab_leftmid','midbgcolur'=>'fafeff','midright'=>'eventphoto-tab_rightmid','bottomleft'=>'event-photo-tab-bottom-left.gif','bottommid'=>'eventphoto-tab_botmid','bottomright'=>'event-photo-tab-bottom-right.gif') ;
  626. if(isset($_REQUEST['gr']) && base64_decode($_REQUEST['gr'])==2)
  627. $currentuser = array('topleft'=>'sponsor-tab-top-left.gif','topmiddle'=>'sponsor-tab_topmidsml','topright'=>'sponsor-tab-top-right.gif','midleft'=>'sponsor-tab_leftmid','midbgcolur'=>'fff6f6','midright'=>'sponsor-tab_rightmid','bottomleft'=>'sponsor-tab-bottom-left.gif','bottommid'=>'sponsor-tab_botmid','bottomright'=>'sponsor-tab-bottom-right.gif') ;
  628. if(isset($_REQUEST['gr']) && base64_decode($_REQUEST['gr'])==3)
  629. $currentuser = array('topleft'=>'tickets-tab-top-left.gif','topmiddle'=>'ticket-tab_topmidsml','topright'=>'tickets-tab-top-right.gif','midleft'=>'ticket-tab_leftmid','midbgcolur'=>'fdfff4','midright'=>'ticket-tab_rightmid','bottomleft'=>'tickets-tab-bottom-left.gif','bottommid'=>'ticket-tab_botmid','bottomright'=>'tickets-tab-bottom-right.gif') ;
  630. $this->set('currentStyle', $currentuser);
  631. }
  632. ################################## USERS PROFILE PAGE #####################
  633. function myprofile($userid=null) {
  634. $this->pageTitle = 'Profile';
  635. $this->layout = 'default';
  636. $this->checkSession();
  637. $userid = $_REQUEST['uid'];
  638. if($userid)
  639. $uid = base64_decode($userid);
  640. else
  641. $uid = $_SESSION['UserId'];
  642. $this->set('userprofileId',$uid) ;
  643. $this->data = $this->User->UserDetails->findByUserId($uid);
  644. $this->set('profiledetail',$this->data);
  645. }
  646. function social() {
  647. $this->layout = 'profile_blank';
  648. }
  649. function professional() {
  650. $this->layout = 'profile_blank';
  651. }
  652. function personalinfo() {
  653. $this->layout = 'profile_blank';
  654. }
  655. ###########################################################################
  656. function user_home() {
  657. $this->pageTitle = 'User Home';
  658. //$this->checkSession();
  659. $this->layout = 'userprofilevisit';
  660. $this->userProfileLeftPanel();
  661. $profilehomelink = $this->webroot."users/user_home?id=".time()."&uid=".base64_encode($this->profileUserIdforQry)."&sessid=".session_id()."";
  662. $this->set('profilehomelink',$profilehomelink);
  663. //$someone = $this->User->findById($_SESSION['UserId']);
  664. ##################### Insert the recored for profile allingment #########
  665. if(isset($_SESSION['UserId'])) {
  666. $liitem=array('firstlist_1','firstlist_2','firstlist_3','firstlist_4','firstlist_5','firstlist_8','firstlist_9');
  667. $liitem2=array('secondlist_1','secondlist_2','secondlist_3','secondlist_4','secondlist_5','secondlist_6');
  668. if($_SESSION['GrpId']==2) /// Photographer
  669. array_push($liitem,'firstlist_6');
  670. if($_SESSION['GrpId']==3) /// Organisation
  671. array_push($liitem,'firstlist_7');
  672. $stleftpos=1;
  673. $strightpos=1;
  674. $maxLeftposition = "SELECT MAX(boxorder) as leftpos from profilemap where userid='".$_SESSION['UserId']."' and position='left'" ;
  675. $maxLeftposition_res = mysql_query($maxLeftposition);
  676. if(mysql_num_rows($maxLeftposition_res)>0) {
  677. $maxLeftposition_arr =mysql_fetch_array($maxLeftposition_res);
  678. $stleftpos = $maxLeftposition_arr['leftpos'];
  679. }
  680. $maxLeftposition = "SELECT MAX(boxorder) as rightpos from profilemap where userid='".$_SESSION['UserId']."' and position='right'" ;
  681. $maxLeftposition_res = mysql_query($maxLeftposition);
  682. if(mysql_num_rows($maxLeftposition_res)>0) {
  683. $maxLeftposition_arr =mysql_fetch_array($maxLeftposition_res);
  684. $strightpos = $maxLeftposition_arr['rightpos'];
  685. }
  686. foreach($liitem as $liitem_item=>$liitem_value) {
  687. $profilesql = "SELECT * from profilemap where boxname='".$liitem_value."' and userid='".$_SESSION['UserId']."'";
  688. $profilesql_res = mysql_query($profilesql);
  689. if(mysql_num_rows($profilesql_res)==0) {
  690. $stleftpos++;
  691. $insertleftinfo = "INSERT INTO profilemap SET boxname='".$liitem_value."' ,userid='".$_SESSION['UserId']."',display='block',position='left',boxorder='".$stleftpos."',boxid='".$stleftpos."' ";
  692. mysql_query($insertleftinfo);
  693. }
  694. }
  695. foreach($liitem2 as $liitem_item=>$liitem_value) {
  696. $profilesql = "SELECT * from profilemap where boxname='".$liitem_value."' and userid='".$_SESSION['UserId']."'";
  697. $profilesql_res = mysql_query($profilesql);
  698. if(mysql_num_rows($profilesql_res)==0) {
  699. $strightpos++;
  700. $insertleftinfo = "INSERT INTO profilemap SET boxname='".$liitem_value."' ,userid='".$_SESSION['UserId']."',display='block',position='right',boxorder='".$strightpos."',boxid='".$strightpos."' ";
  701. mysql_query($insertleftinfo);
  702. }
  703. }
  704. ##################### Insert the recored for profile allingment #########
  705. }
  706. if(isset($_REQUEST['uid'])) {
  707. $uid = base64_decode($_REQUEST['uid']);
  708. $mail = mysql_query("select * from emails where user_id=".$uid." and inbox_status='unread'");
  709. if($mail) {
  710. $mailQry = mysql_num_rows($mail);
  711. $this->set('mails', $mailQry);
  712. }
  713. if(empty($this->data)) {
  714. $this->data = $this->User->UserDetails->read(null, $uid);
  715. $this->set('user_det',$this->data);
  716. }
  717. }
  718. else {
  719. $this->redirect('../index');
  720. }
  721. $this->createStuffArray();
  722. $this->getMyComments($this->PROFILE_USER_ID);
  723. }
  724. function postcomment() {
  725. mysql_query("INSERT INTO user_comments(user_id,friend_id,comment) VALUES('".$this->params['form']['profileid']."','".$_SESSION['UserId']."','".mysql_escape_string($this->params['form']['comment'])."')");
  726. $this->getMyComments($this->params['form']['profileid']);
  727. $this->render("usercomment","ajax");
  728. }
  729. function congratulations() {
  730. $this->checkSession(1);
  731. $this->pageTitle = 'Invite Friend';
  732. $this->layout = 'userloggedin';
  733. $someone = $this->User->findById($_SESSION['UserId']);
  734. $this->set('firstname',$someone['UserDetails']['first_name']);
  735. $this->set('lasttname',$someone['UserDetails']['last_name']);
  736. /*if(empty($this->data))
  737. {
  738. $this->data = $this->User->read(null, $id);
  739. $this->set('data',$this->data);
  740. }*/
  741. }
  742. /**/
  743. /* function loading()
  744. {
  745. }
  746. */ function logout() {
  747. //$this->layout = 'default';
  748. //$this->session->delete('Admin');
  749. //$this->session->delete('Admin_id');
  750. unset($_SESSION);
  751. $this->Session->destroy();
  752. $this->Session->destroy('User');
  753. $this->Session->destroy('UserId');
  754. $this->redirect('/');
  755. /*if(session_destroy())
  756. $this->redirect('users/home');
  757. else
  758. $this->flash('session destruction unsuccessfull.','/users/home');*/
  759. }
  760. function forgotPass() {
  761. $this->layout = 'default';
  762. echo $_REQUEST['msg'];
  763. $this->set('data',$_REQUEST['msg']);
  764. }
  765. function forgotPassword() {
  766. /*$this->layout = 'default';
  767. echo $_REQUEST['msg'];
  768. $this->set('data',$_REQUEST['msg']);*/
  769. $this->render('forgotpassview', 'ajax');
  770. }
  771. function my_photo() {
  772. $this->checkSession();
  773. $this->layout = 'userloggedin';
  774. $this->pageTitle = 'My Photo';
  775. }
  776. /*function myphoto_top_old()
  777. {
  778. $this->checkSession();
  779. $this->layout = 'userloggedin';
  780. $this->pageTitle = 'My Friend Top';
  781. }
  782. */
  783. function sendinvite() {
  784. $this->checkSession();
  785. $this->layout = 'userloggedin';
  786. $someone = $this->User->findById($_SESSION['UserId']);
  787. $this->set('invitedGrp',$someone['User']['user_group_master_id']);
  788. $this->set('inviterId',$someone['User']['id']);
  789. $FriendInviteUrl = "http://www.xoimages.com/users/signup?id=".time()."&gr=".base64_encode($someone['User']['user_group_master_id'])."&sessid=".session_id()."&task=invite&taskbyId=".base64_encode($someone['User']['id'])."";
  790. $this->set('inviteMailUrl','<a href="'.$FriendInviteUrl.'">Click Here</a>');
  791. }
  792. ####################### TESTING##########
  793. function userprofile() {
  794. $this->checkSession();
  795. $this->layout = 'usertestprofile';
  796. $this->pageTitle = 'Edit Profile';
  797. $uid = $_SESSION['UserId'];
  798. ########################################### BASIC INFO #####################
  799. if(empty($this->data) || !empty($_SESSION['User'])) {
  800. if(isset($_REQUEST['pg']) && $_REQUEST['pg'] == "con") {
  801. $someone = $this->User->findById($uid);
  802. $this->Session->write('User', $someone['User']['username']);
  803. $this->Session->write('UserId', $someone['User']['id']);
  804. $this->data = $this->User->read(null, $uid);
  805. $this->set('data',$this->data);
  806. }
  807. else {
  808. $this->data = $this->User->read(null, $uid);
  809. $this->set('data',$this->data);
  810. }
  811. ########################################### BASIC INFO #####################
  812. }
  813. //Get Users payment Details
  814. $paymentInfo=$this->getPaymentMethodsUsers($_SESSION['UserId']);
  815. if(isset($paymentInfo['paypal_email']) && $paymentInfo['paypal_email']!='') {
  816. $this->set('paypalemailinfo' , $paymentInfo['paypal_email']) ;
  817. }
  818. if(isset($paymentInfo['gcheckout_email']) && $paymentInfo['gcheckout_email']!='') {
  819. $strgcheckout = $paymentInfo['gcheckout_email'] ;
  820. if(stristr($strgcheckout, 'break')) {
  821. $strgcheckoutexp = explode('break',$strgcheckout);
  822. $this->set('merchantId' , $strgcheckoutexp[0]) ;
  823. $this->set('merchantkey' , $strgcheckoutexp[1]) ;
  824. }
  825. if($strgcheckout!='')
  826. $this->set('gcheckoutinfo' , $paymentInfo['gcheckout_email']) ;
  827. }
  828. }
  829. function setpaypal() {
  830. $this->render("setpaypal","ajax");
  831. }
  832. function saveprofilebasic() {
  833. $this->checkSession();
  834. $this->set("postData",$this->params);
  835. $userInfo = $this->User->read(null,$_SESSION["UserId"]);
  836. $this->data['UserDetails']['id'] = $userInfo['UserDetails']['id'];
  837. $this->data['UserDetails']['user_id'] = $_SESSION['UserId'];
  838. $this->data['UserDetails']['first_name'] = addslashes($this->data['UserDetails']['first_name']);
  839. $this->data['UserDetails']['last_name'] = addslashes($this->data['UserDetails']['last_name']);
  840. $this->data['UserDetails']['gender'] = $_REQUEST['sex'];
  841. $this->data['UserDetails']['city'] = $_REQUEST['city'];
  842. $this->data['UserDetails']['state'] = $_REQUEST['province'];
  843. $this->data['UserDetails']['c_id'] = $_REQUEST['country'];
  844. $this->data['UserDetails']['dob'] = $_REQUEST['dob_Year'] .'-'.$_REQUEST['dob_Month'] .'-'.$_REQUEST['dob_Day'] ;
  845. $this->data['UserDetails']['mobile_phone'] = $this->data['UserDetails']['mobile_phone'];
  846. $this->data['UserDetails']['land_phone'] = $this->data['UserDetails']['land_phone'];
  847. $this->data['UserDetails']['address'] = $this->data['UserDetails']['address'];
  848. $this->data['UserDetails']['state'] = $_REQUEST['province'];
  849. $this->data['Useā€¦

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