public function UpdatePage($dataForm, $pageId) { global $mySession; $db = new Db(); $chkQry = $db->runQuery("select * from " . PAGES1 . " where page_title='" . $dataForm['page_title'] . "' and page_id!='" . $pageId . "'"); if ($chkQry != "" and count($chkQry) > 0) { return 0; } else { // prd($dataForm); //$dataUpdate['page_cat_id']=0; // echo $dataForm['page_content']; exit; $dataUpdate['page_title'] = strip_magic_slashes($dataForm['page_title']); $dataUpdate['page_content'] = strip_magic_slashes($dataForm['page_content']); $dataUpdate['meta_keywords'] = addslashes($dataForm['meta_keywords']); $dataUpdate['meta_description'] = addslashes($dataForm['meta_description']); $dataUpdate['synonyms'] = addslashes($dataForm['synonyms']); // prd($dataUpdate); $conditionUpdate = "page_id='" . $pageId . "'"; $db->modify(PAGES1, $dataUpdate, $conditionUpdate); return 1; } }
function strip_magic_slashes($astr) { if (is_array($astr)) { foreach ($astr as $k => $v) { $astr[$k] = strip_magic_slashes($v); } } else { $astr = stripslashes($astr); } return $astr; }
} if (!(include_once $include_file)) { throw new Exception("No file '{$include_file}' found to include for class '{$class}'"); } } # -------------------------------------------------------------------- # Initilization logic # -------------------------------------------------------------------- if (ini_get('magic_quotes_gpc')) { $_POST = strip_magic_slashes($_POST); } if (ini_get('magic_quotes_gpc')) { $_GET = strip_magic_slashes($_GET); } if (ini_get('magic_quotes_gpc')) { $_REQUEST = strip_magic_slashes($_REQUEST); } mb_internal_encoding("UTF8"); # Database setup Z::c(); # # Random seed # function make_seed() { list($usec, $sec) = explode(' ', microtime()); return (double) $sec + (double) $usec * 100000; } srand(make_seed()); // #
$ext = 'png'; } $outfile = TMP_DIR . "/{$tmpName}.{$ext}"; $cmd = "{$cmd} -outfile {$outfile}"; if ((empty($svg) && empty($options)) != 1 && (empty($options) && $ext == 'svg') == 0) { // width if ($_POST['width'] && $_POST['width'] != 'undefined') { // added != undefined otherwise param -width=0 $width = "-width " . (int) strip_magic_slashes($_POST['width']); } if ($_POST['scale']) { $scale = "-scale " . (double) strip_magic_slashes($_POST['scale']); } // constructor if ($_POST['constr']) { $constr = "-constr " . (string) strip_magic_slashes($_POST['constr']); } if (!file_put_contents($infile, $filecontent)) { die("Couldn't create temporary file. Check that the directory permissions for\n\t\t\t\tthe /tmp directory are set to 777."); } if (!empty($callback) && !file_put_contents(TMP_DIR . "/{$tmpName}.cb.js", $callback)) { die("Couldn't create temporary file. Check that the directory permissions for\n\t\t\t\tthe /tmp directory are set to 777."); } // do the conversion /*Usage: 'Usage: highcharts-convert.js -infile URL -outfile filename -scale 2.5 -width 300 -constr Chart -callback callback.js'*/ $command = PHANTOMJS_PATH . " " . PHANTOMJS_SCRIPT . " {$cmd} {$width} {$scale} {$constr}"; $output = execute($command); // catch error if (!is_file($outfile) || filesize($outfile) < 10) { echo "<h4>PhantomJS messages</h4>";
public function UpdateBusiness($dataForm, $businessId) { global $mySession; $db = new Db(); // $chkQry=$db->runQuery("select * from ".SERVICE_BUSINESS." where business_title='".mysql_escape_string($dataForm['business_title'])."' and business_id!='".$businessId."'"); // if($chkQry!="" and count($chkQry)>0) // { // return 0; // } // else // { $BusinessImagesPath = ""; for ($counter = 1; $counter <= 10; $counter++) { $businessImage = $dataForm['old_business_image' . $counter]; if ($dataForm['business_image' . $counter] != "") { if ($businessImage != "" && file_exists(SITE_ROOT . 'images/events/' . $businessImage)) { unlink(SITE_ROOT . 'images/events/' . $businessImage); } $businessImage = time() . "_" . $dataForm['business_image' . $counter]; @rename(SITE_ROOT . 'images/businesses/' . $dataForm['business_image' . $counter], SITE_ROOT . 'images/businesses/' . $businessImage); } if ($businessImage != "") { $BusinessImagesPath .= $businessImage . ","; } } if ($BusinessImagesPath != "") { $BusinessImagesPath = substr($BusinessImagesPath, 0, strlen($BusinessImagesPath) - 1); } $myLatLongData = getLatLongFromAddress($dataForm['country_id'], $dataForm['state_id'], $dataForm['city_name'], $dataForm['address']); $explode = explode("::", $myLatLongData); $Lat = $explode[0]; $Long = $explode[1]; $dataUpdate['business_title'] = strip_magic_slashes($dataForm['business_title']); $dataUpdate['business_category_id'] = $dataForm['business_category_id']; $dataUpdate['description'] = strip_magic_slashes($dataForm['description']); $dataUpdate['search_keywords'] = strip_magic_slashes($dataForm['search_keywords']); $dataUpdate['address'] = strip_magic_slashes($dataForm['address']); $dataUpdate['city_name'] = strip_magic_slashes($dataForm['city_name']); $dataUpdate['zipcode'] = $dataForm['zipcode']; $dataUpdate['state_id'] = $dataForm['state_id']; $dataUpdate['country_id'] = $dataForm['country_id']; $dataUpdate['phone_number'] = $dataForm['phone_number']; $dataUpdate['email_address'] = $dataForm['email_address']; $dataUpdate['website'] = $dataForm['website']; $dataUpdate['business_image'] = $BusinessImagesPath; $dataUpdate['business_lat'] = $Lat; $dataUpdate['business_long'] = $Long; $dataUpdate['business_status'] = '1'; $dataUpdate['business_subcategory_id'] = $dataForm['business_subcategory_id']; // prd($dataUpdate); $conditionUpdate = "business_id='" . $businessId . "'"; $db->modify(SERVICE_BUSINESS, $dataUpdate, $conditionUpdate); return 1; //} }