hjkhghopjkertteerterterterertertrtoirh
bnmbertsurhetertertertertertertertpdf'tdfg
/
home
/
ubuntu
/
bmse.net
/
Upload FileeE
HOME
<?php ob_start(); session_start(); header('Content-Type: application/json'); //CONFIGARATIONS - ///////////////////////////////////// include ("fpconfig.php"); if($_REQUEST["actType"]=="GET_EVENTS"){// give the list of existing projects $query = mysql_query("SELECT `id`, `name`, `city` FROM bmse_expos where status=1 and remove=1 order by start_dttm desc"); $values= array(); while($row = mysql_fetch_assoc($query)){ //$data.="<exbition><id>".$row["id"]."</id><name>".$row["name"]."</name></exbition>"; $values[]=$row; } echo json_encode($values); }else if($_REQUEST["actType"]=="LOAD_EVENT"){ // update the current project with data $ex_id = $_REQUEST["ex_id"]; $query = mysql_query("SELECT `id`, `name`, `city` FROM bmse_expos where status=1 and remove=1 and `id`='".$ex_id."'"); $data_result = mysql_fetch_assoc($query); $values= array(); $values['event'][]=$data_result; $booth_query = mysql_query("select id,expo_id,room_number as booth, size_id from bmse_expo_rooms where type=1 and expo_id='".$ex_id."' and status=1 and remove=1 order by room_number asc"); while($row = mysql_fetch_assoc($booth_query)){ $values['booths'][]=$row; } $hall_query = mysql_query("select id,expo_id,room_number as hall from bmse_expo_rooms where type=2 and expo_id='".$ex_id."' status=1 and remove=1 order by room_number asc"); while($row1 = mysql_fetch_assoc($hall_query)){ $values['halls'][]=$row1; } echo json_encode($values); /*echo "&loadedProject=".stripslashes($data_result["ex_data"]); echo "&booths=".$booths; echo "&halls=".$halls;*/ }else if($_REQUEST["actType"]=="LOAD_EVENT_BUYERS"){ // update the current project with data $ex_id = $_REQUEST["ex_id"]; $query = mysql_query("SELECT `id`, `name`, `city` FROM bmse_expos where status=1 and remove=1 and `id`='".$ex_id."'"); $data_result = mysql_fetch_assoc($query); $values= array(); $values['event'][]=$data_result; $buyers_query = mysql_query("SELECT ER.id AS room_id, ER.expo_id, ER.size_id, BC.booth_logo as boothlogo, BC.title, M.company_logo,M.id as memid, M.name,M.website,M.email,M.phone, M.image_name,M.companyname as company, O.insert_dttm AS orderdate, ER.room_number ,ER.size_id as size FROM bmse_expo_rooms ER LEFT JOIN bmse_booth_configs BC ON ER.id = BC.boothid LEFT JOIN bmse_order_details OD ON ER.id = OD.item_id LEFT JOIN bmse_orders O ON O.id = OD.order_id LEFT JOIN bmse_members M ON M.id = O.member_id WHERE ER.expo_id ='".$ex_id."' AND OD.item_type_id =1 AND ER.order_status =2 AND ER.status=1 AND ER.remove=1 ORDER BY ER.room_number ASC "); $buyers = "<buyers>"; $members=array(); while($row = mysql_fetch_assoc($buyers_query)){ if (file_exists("exhibitoradmin/images/booth_logos/".$row['boothlogo']) AND $row['boothlogo']!='') { $row['boothlogo'] = str_replace("&","%26", $row['boothlogo']); } else { $row['boothlogo'] = 'default-company-logo.jpg'; } if ($row['image_name']!='') { $row['image_name'] = str_replace("&","%26", $row['image_name']); } else { $row['image_name']='default-company-logo.jpg'; } if ($row['company_logo']!='') { $row['company_logo'] = str_replace("&","%26", $row['company_logo']); } else { $row['company_logo']='default-company-logo.jpg'; } # Booth sign or company if (isset($row['title']) AND $row['title']!='') { $company=str_replace("&", "%26", $row['title']); $company=str_replace("'", "%27", $row['title']); $company=str_replace("'", "'", $row['title']); } else { $company=str_replace("&", "%26", $row['company']); $company=str_replace("'", "%27", $row['company']); $company=str_replace("'", "'", $row['company']); } $row['title'] =$company; $row['company'] =$company; $row['boothid']=$row['room_id']; $row['size_id']=$row['size_id']; $row['booth']=$row['room_number']; $row['booth-img']='exhibitoradmin/images/booth_logos/'.$row['boothlogo']; $row['email']=$row['email']; $row['url']=str_replace("http://","",$row['website']); $row['member_id']=$row['memid']; $values['buyers'][]=$row; } echo json_encode($values); } else if($_REQUEST["actType"]=="FB_LOAD_EVENT_DATA"){ // update the current project with data $evt_id = $_REQUEST["evt_id"]; $values= array(); $events_query = mysql_query("SELECT `event_id`, `event_name` FROM `fb_events` where `event_id`='".$evt_id."' and `status`='active'"); $data_eventresult = mysql_fetch_assoc($events_query); $data_eventresult['event_id']=(int)$data_eventresult['event_id']; $data_eventresult['event_name']=$data_eventresult['event_name']; $values['Event'] = $data_eventresult; $mapset_query = mysql_query("SELECT booth_font_size, color, size, `height`, `width` FROM fb_mapset where `event_id`='".$evt_id."' and `status`='active'"); $data_mapsetresult = mysql_fetch_assoc($mapset_query); $data_mapsetresult['booth_font_size'] = (int)$data_mapsetresult['booth_font_size']; $data_mapsetresult['height'] = (int)$data_mapsetresult['height']; $data_mapsetresult['width'] = (int)$data_mapsetresult['width']; $values['MapSet']=$data_mapsetresult; $colors_query = mysql_query("SELECT available, meeting, sold FROM fb_colors where `event_id`='".$evt_id."' and `status`='active'"); $data_colorsresult = mysql_fetch_assoc($colors_query); $values['colors']=$data_colorsresult; $elements_query = mysql_query("SELECT `_booth_id`, `_booth_number`, `_mcName`, `color`, `bgColors`, `directions`, `height`, `key`, `keyArr`, `left`, `rotate`, `size`, `top`, `type`, `width`, `event_id` as `expo_id`, `text`, `zIndex` FROM fb_elements where `event_id`='".$evt_id."' and `status`='active'"); $i=1; if ( mysql_num_rows($elements_query) >= 1 ) { while($row = mysql_fetch_assoc($elements_query)){ $row['rotate'] = (int)$row['rotate']; $row['keyArr'] = (int)$row['keyArr']; $row['key'] = (int)$row['key']; //$row['height'] = (int)$row['height']; //$row['width'] = (int)$row['width']; $row['height'] = $row['height']; $row['width'] = $row['width']; $row['text'] = $row['text']; if ($row['type']=='square') { $row['zIndex'] = (int)$row['zIndex']; } if ($row['_booth_id']=='' OR $row['_booth_id']==0) { $val = $i; //echo "yes"; //echo "<br>"; } else { $sizeqry = mysql_query("select size_id from bmse_expo_rooms where id='".$row['_booth_id']."' "); $sizeRes = mysql_fetch_assoc($sizeqry); $row['size_id']= $sizeRes['size_id']; $val=$row['_booth_id']; } $values['elements']['element_'.$val]=$row; $i++; } //echo "<pre>"; //print_r($values); echo json_encode($values); } else { echo 0; } /*echo "&loadedProject=".stripslashes($data_result["ex_data"]); echo "&booths=".$booths; echo "&halls=".$halls;*/ } else if($_REQUEST["actType"]=="FB_SAVE_EVENT_DATA"){ // update the current project with data $event_id = $_REQUEST["evt_id"]; $postdata = file_get_contents("php://input"); $request = json_decode($postdata); # exponame $expoinfoone = mysql_query('select `name` FROM `bmse_expos` WHERE `id`='.$event_id.''); $expoinfo=mysql_fetch_assoc($expoinfoone); //echo $request->MapSet->booth_font_size; # Checking for the existing inactive and current records - deleting old FP, inactivating current FP and inserting new FP - START # for the event fb_events db $eventInfoInactveqr = mysql_query('SELECT `event_id` FROM `fb_events` WHERE `event_id`='.$event_id.' and `status`="inactive"'); $eventInfoInactve=mysql_fetch_assoc($eventInfoInactveqr); $eventInfoActiveqr =mysql_query('SELECT `event_id` FROM `fb_events` WHERE `event_id`='.$event_id.' and `status`="active"'); $eventInfoActve=mysql_fetch_assoc($eventInfoActiveqr); if (!empty($eventInfoInactve)) { mysql_query('DELETE FROM `fb_events` WHERE `status`="inactive" and `event_id`='.$event_id.''); } if (!empty($eventInfoActve)) { mysql_query('UPDATE `fb_events` SET `status`="inactive", `event_name`="'.$expoinfo['name'].'" WHERE `event_id`='.$event_id.''); } # for the event fb_mapset db $eventMapsetInactveqr = mysql_query('SELECT `event_id` FROM `fb_mapset` WHERE `event_id`='.$event_id.' and `status`="inactive"'); $eventMapsetInactve=mysql_fetch_assoc($eventMapsetInactveqr); $eventMapsetActiveqr = mysql_query('SELECT `event_id` FROM `fb_mapset` WHERE `event_id`='.$event_id.' and `status`="active"'); $eventMapsetActive=mysql_fetch_assoc($eventMapsetActiveqr); if (!empty($eventMapsetInactve)) { mysql_query('DELETE FROM `fb_mapset` WHERE `status`="inactive" and `event_id`='.$event_id.''); } if (!empty($eventMapsetActive)) { mysql_query('UPDATE `fb_mapset` SET `status`="inactive" WHERE `event_id`='.$event_id.''); } # for the event fb_colors db $eventColorsInactveqr = mysql_query('SELECT `event_id` FROM `fb_colors` WHERE `event_id`='.$event_id.' and `status`="inactive"'); $eventColorsInactve=mysql_fetch_assoc($eventColorsInactveqr); $eventColorsActiveqr = mysql_query('SELECT `event_id` FROM `fb_colors` WHERE `event_id`='.$event_id.' and `status`="active"'); $eventColorsActive=mysql_fetch_assoc($eventColorsActiveqr); if (!empty($eventColorsInactve)) { mysql_query('DELETE FROM `fb_colors` WHERE `status`="inactive" and `event_id`='.$event_id.''); } if (!empty($eventColorsActive)) { mysql_query('UPDATE `fb_colors` SET `status`="inactive" WHERE `event_id`='.$event_id.''); } # for the event fb_elements db $eventElementsInactveqr = mysql_query('SELECT `event_id` FROM `fb_elements` WHERE `event_id`='.$event_id.' and `status`="inactive"'); $eventElementsInactve=mysql_fetch_assoc($eventElementsInactveqr); $eventElementsActiveqr = mysql_query('SELECT `event_id` FROM `fb_elements` WHERE `event_id`='.$event_id.' and `status`="active"'); $eventElementsActive=mysql_fetch_assoc($eventElementsActiveqr); if (!empty($eventElementsInactve)) { mysql_query('DELETE FROM `fb_elements` WHERE `status`="inactive" and `event_id`='.$event_id.''); } if (!empty($eventElementsActive)) { mysql_query('UPDATE `fb_elements` SET `status`="inactive" WHERE `event_id`='.$event_id.''); } # Checking for the existing inactive and current records - deleting old FP, inactivating current FP and inserting new FP - END // Query to insert into new MapSet $eventSetSQL = "INSERT INTO fb_events (event_id, event_name) VALUES ($event_id, '".$expoinfo['name']."') "; $eventInsert_query = mysql_query($eventSetSQL) or die(mysql_error()); $mapSetSQL = "INSERT INTO fb_mapset (event_id, booth_font_size, color, size, height, width) VALUES ($event_id, '".$request->MapSet->booth_font_size."', '".$request->MapSet->color."', '".$request->MapSet->size."', ".$request->MapSet->height.", ".$request->MapSet->width.") "; $mapsetInsert_query = mysql_query($mapSetSQL) or die(mysql_error()); if ( $mapsetInsert_query ){ $colorsSQL = "INSERT INTO fb_colors (event_id, available, meeting, sold) VALUES ($event_id, '".$request->colors->available."', '".$request->colors->meeting."', '".$request->colors->sold."') "; $colorsInsert_query = mysql_query($colorsSQL); if ( $colorsInsert_query ) { $i = 0 ; foreach ($request->elements as $eleKey => $eleVal ) { if (!isset($eleVal->_booth_number)) { $boothnum='0'; } else { $boothnum = $eleVal->_booth_number; } if (!isset($eleVal->_booth_id)) { $boothid='0'; } else { $boothid = $eleVal->_booth_id; } if (!isset($eleVal->keyArr)) { $keyarr='0'; } else { $keyarr = $eleVal->keyArr; } if (!isset($eleVal->key)) { $key='0'; } else { $key = $eleVal->key; } if (!isset($eleVal->bgColors)) { $bgColors=''; } else { $bgColors = $eleVal->bgColors; } //echo $eleKey; $elementsSQL = "INSERT INTO fb_elements ( event_id, `_booth_id`, `_booth_number`, `_mcName`, `color`,`bgColors`, `directions`, `height`, `key`, `keyArr`, `left`, `rotate`, `size`, `top`, `type`, `width`,`text`) VALUES ($event_id, ".$boothid.", ".$boothnum.", '".$eleVal->_mcName."', '".$eleVal->color."', '".$bgColors."', '".$eleVal->directions."', '".$eleVal->height."', ".$key.", ".$keyarr.", '".$eleVal->left."', ".$eleVal->rotate.", '".$eleVal->size."', '".$eleVal->top."', '".$eleVal->type."', '".$eleVal->width."','".$eleVal->text."') "; //echo $elementsSQL; $elements_query = mysql_query($elementsSQL) or die(mysql_error()); } } } echo json_encode($request); } else if($_REQUEST["actType"]=="is_logged_in"){ // update the current project with data //$request = json_decode($postdata); $value = array(); if ( isset($_SESSION['staffone']['id']) AND $_SESSION['staffone']['id']!='') { $value['id'] = $_SESSION['staffone']['id']; } echo json_encode($value); } ?>