function store($data, $csum) { $status = 0; $csumn = new Csum($data); if (!is_object($csum)) { return null; } if (!$csum->matches($csumn)) { return null; } return store($data, $csum); }
function PunkRecordIntakeHandler() { global $l; $l = new llog(); global $generalAuthKey; if (authorized($generalAuthKey)) { $l->a("Started DataIntakeHandler<br>"); $status = 0; if (isset($_FILES['uploadedfile'])) { $ulfilename = base64_encode($_FILES['uploadedfile']['name']); $ulsize = base64_encode($_FILES['uploadedfile']['size']); } else { $ulfilename = null; $ulsize = null; } $filename = "coal_temp/" . "data." . guidv4() . ".stt"; if (isset($_FILES['uploadedfile'])) { if (move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $filename)) { } else { $status = 2; $l->a("error 2<br>"); } } else { $status = 6; $l->a("error 6<br>"); } $csum = new Csum(null, $filename); $insertion = store(file_get_contents($filename), $csum); $id = $insertion['id']; $status = $insertion['status']; $db = new FractureDB('futuqiur_ember'); if (isset($_REQUEST['punkUser'])) { $addedTree = $db->addRow('trees', 'user, collection, number, csum', "'" . $_REQUEST['punkUser'] . "', '" . $_REQUEST['punkCollection'] . "', '" . $id . "', '" . $csum->len . '|' . $csum->md5 . '|' . $csum->sha . '|' . $csum->s512 . "'"); } if (check($status, true)) { echo $id . '|' . $csum->len . '|' . $csum->md5 . '|' . $csum->sha . '|' . $csum->s512; } } }
$logfile = dirname(__FILE__) . '/logs/storedata.log'; //si aggiorna verso le 10.00 del mattino $biometeo_ITA_file = BIOMETEO_ITA_LINK; $biometeo_ENG_file = BIOMETEO_ENG_LINK; //si aggiorna verso le 8.30 del mattino $meteo_file = METEO_LINK; //si aggiorna dalle 10 alle 13 del mattino //$risk_file = RISK_LINK. $today.".xml"; // RISK_LINK Puglia $risk_file = RISK_LINK; store($biometeo_ITA_file, dirname(__FILE__) . "/data/biometeo_ITA.xml", $logfile); store($biometeo_ENG_file, dirname(__FILE__) . "/data/biometeo_ENG.xml", $logfile); store($meteo_file, dirname(__FILE__) . "/data/meteo.xml", $logfile); //cancello il file in locale in quanto cambia il nome da un giorno all'altro ed esiste un momento del giorno in cui non esiste il file (la mattina) unlink(dirname(__FILE__) . "/data/risk.xml"); store($risk_file, dirname(__FILE__) . "/data/risk.xml", $logfile); //download pics download_remote_file(IDROMETRIA_Bisenzio_Prato, dirname(__FILE__) . "/data/IDROMETRIA_Bisenzio_Prato.jpg", $logfile); download_remote_file(IDROMETRIA_Bisenzio_Vaiano_Gamberame, dirname(__FILE__) . "/data/IDROMETRIA_Bisenzio_Vaiano_Gamberame.jpg", $logfile); download_remote_file(IDROMETRIA_Ombrone_PonteAlleVanne, dirname(__FILE__) . "/data/IDROMETRIA_Ombrone_PonteAlleVanne.jpg", $logfile); download_remote_file(IDROMETRIA_Ombrone_PoggioACaiano, dirname(__FILE__) . "/data/IDROMETRIA_Ombrone_PoggioACaiano.jpg", $logfile); download_remote_file(PLUVIOMETRIA_Prato_Città, dirname(__FILE__) . "/data/PLUVIOMETRIA_Prato_Città.jpg", $logfile); download_remote_file(PLUVIOMETRIA_Prato_Università, dirname(__FILE__) . "/data/PLUVIOMETRIA_Prato_Università.jpg", $logfile); download_remote_file(PLUVIOMETRIA_Galceti_Montemurlo, dirname(__FILE__) . "/data/PLUVIOMETRIA_Galceti_Montemurlo.jpg", $logfile); download_remote_file(PLUVIOMETRIA_Vaiano_Gamberame, dirname(__FILE__) . "/data/PLUVIOMETRIA_Vaiano_Gamberame.jpg", $logfile); download_remote_file(PLUVIOMETRIA_Vaiano_Acquedotto, dirname(__FILE__) . "/data/PLUVIOMETRIA_Vaiano_Acquedotto.jpg", $logfile); download_remote_file(PLUVIOMETRIA_Fattoria_Iavello_Montemurlo, dirname(__FILE__) . "/data/PLUVIOMETRIA_Fattoria_Iavello_Montemurlo.jpg", $logfile); download_remote_file(PLUVIOMETRIA_Cantagallo, dirname(__FILE__) . "/data/PLUVIOMETRIA_Cantagallo.jpg", $logfile); download_remote_file(TERMOMETRIA_Prato_Università, dirname(__FILE__) . "/data/TERMOMETRIA_Prato_Università.jpg", $logfile); download_remote_file(TERMOMETRIA_Galceti_Montemurlo, dirname(__FILE__) . "/data/TERMOMETIRIA_Galceti_Montemurlo.jpg", $logfile); download_remote_file(ANEMOMETRIA_Prato_Università, dirname(__FILE__) . "/data/ANEMOMETRIA_Prato_Università.jpg", $logfile);
if (lateForms($value)) { // echo "late with forms <br>"; deactivate($value["id"]); } else { if (lateAssessment($value)) { deactivate($value["id"]); } else { if (needAssessmentReminder($curr)) { remind($curr); } } } } //store disabled users if ($value["activated"] == -1) { store($value["id"], $value["email"]); remove($value["id"]); } } } } function remind($curr) { //update reminder value $assessments = getLastAssessment($curr); $update = QueryFactory::Build("update"); $update->Table("assessments")->Where(["id", "=", $curr["id"]], ["TestNumber", "=", $assessments["TestNumber"]])->Set(["reminded", "1"]); $cinfo = DatabaseManager::Query($complete); //write email Mailer::Send($curr["email"], "This is an email reminder that your Sit And Be Fit assessment is due in a week./nPlease go to sbfresearch.org and login to complete the assessment"); }
if (!is_dir($path)) { $output->writeln('<error>Path "' . $path . '" not found.</error>'); return; } $locales = array_filter(scandir($path), function ($path) { return '.' !== $path[0]; }); $availableLocales = array(); $root = (include __DIR__ . '/data_root.php'); foreach ($locales as $locale) { $output->write('Processing locale <comment>' . $locale . '</comment>...'); $data = parse($path, $locale); if (null === $data) { $output->writeln('<error>No data found</error>.'); continue; } $filled = array_replace_recursive($root, $data); store($locale, $filled); $availableLocales[] = $locale; $output->writeln('<info>Done</info>.'); } $output->write('Storing root file...'); store('root', $root); $output->writeln('<info>Done</info>.'); $output->write('Storing meta file...'); $meta = array('locales' => $availableLocales); store('meta', $meta); $output->writeln('<info>Done</info>.'); $output->writeln('<info>Finished processing ' . count($locales) . ' locales.</info>'); }); $console->run();
$filelist .= template($mode . '_image_' . $layout, $array); } elseif ($extension == 'zip') { # Item is a zip file=> add change to folder $icone_visu = '<a class="tofolder" href="index.php?p=admin&unzip=' . $id . '&token=' . returnToken() . '" title="' . e('Convert this zip file to folder', false) . '"> </a>'; $array = array('#CLASS' => $class, '#ID' => $id, '#FICHIER' => $fichier_short, '#TOKEN' => returnToken(), '#SIZE' => $taille, '#NAME' => $nom, '#TITLE' => $title, '#EXTENSION' => $extension, '#ICONE_VISU' => $icone_visu, '#SLASHEDNAME' => addslashes($nom), '#SLASHEDFICHIER' => addslashes($fichier_short)); $filelist .= template($mode . '_file_' . $layout, $array); } else { # all other types $array = array('#CLASS' => $class, '#ID' => $id, '#FICHIER' => $fichier_short, '#TOKEN' => returnToken(), '#SIZE' => $taille, '#NAME' => $nom, '#TITLE' => $title, '#EXTENSION' => $extension, '#ICONE_VISU' => $icone_visu, '#SLASHEDNAME' => addslashes($nom), '#SLASHEDFICHIER' => addslashes($fichier_short)); $filelist .= template($mode . '_file_' . $layout, $array); } } } echo $folderlist . $filelist; if ($save) { store($ids); } // save in case of new files } else { e('No file on the server'); } ?> <script src="core/qr.js"></script> <script> function put_file(fichier){ document.getElementById('filename').value=fichier; document.getElementById('filename_hidden').value=fichier; } function put_id(id){document.getElementById('ID_hidden').value=id;} function put_link(id){document.getElementById('link').value="<?php
} else { $user = load($_GET['id']); if ($user == NULL) { $result['success'] = false; $result['msg'] = "Error : User could not be found."; $result['id'] = $_GET['id']; } else { if (property_exists('user', $_GET['field']) == false) { $result['success'] = false; $result['msg'] = "Error : Unknown field."; $result['field'] = $_GET['field']; } else { //TODO check if field exists $methodName = "set" . ucfirst($_GET['field']); $user->{$methodName}($_GET['value']); if (store($user) == false) { $result['success'] = false; $result['msg'] = "Error : User could not be saved."; $result['id'] = $_GET['id']; } else { $result['success'] = true; } } } } } break; default: echo "ERR : No actions given. :("; break; }
function updateIDs($ids = null, $folder_id = null) { if (!$ids) { $ids = unstore(); } $ids = array_map(function ($id) { return str_replace('//', '/', $id); }, $ids); $sdi = array_flip($ids); $saveid = $savetree = false; $ids = array_flip($sdi); # here, all the redundant ids have gone ^^ # scann all uploads folder (can be long but it's important) # or only the requested folder if (!empty($folder_id)) { $tree = recursive_glob(id2file($folder_id), true); } else { $tree = recursive_glob($_SESSION['upload_root_path'], true); } unset($tree[0]); # add missing ids foreach ($tree as $index => $file) { if (!isset($sdi[$file])) { $saveid = true; $id = uniqid(true); $ids[$id] = $file; } else { unset($sdi[$file]); } } if (empty($folder_id)) { # remove ids with no file (not required for single folder update) if (!empty($sdi)) { $saveid = true; foreach ($sdi as $file => $id) { if (!is_dir($file) && !is_file($file)) { unset($ids[$id]); if ($remove = array_search($file, $tree)) { unset($tree[$remove]); } } } } } if ($saveid) { store($ids); regen_tree($_SESSION['login'], $ids); } return $ids; }
function lstore($data, $language) { //Store a localizable string. $db = new FractureDB('futuqiur_ember'); $store = store($data); $sid = $store['id']; $id = $db->addRow('strings', 'language, data', '\'' . $language . '\', \'' . $sid . '\''); $store['id'] = $id; return $store; }
public function ajaxCheckStoreSlugUnique(Request $request) { if ($request->ajax() && $request->isMethod('POST')) { $slug = str_slug($request->get('slug')); $stores = Store::where('id', '!=', store()->id)->where('slug', $slug)->get(); return pong(1, ['data' => ['stores' => ['count' => $stores->count(), 'message' => _t('store_slug_unique')]]]); } }
function copy_slice($source, $dest) { global $SLICE_LEN; $i = 0; while ($i < $SLICE_LEN) { store(fetch($source, $i), $dest, $i); $i += 1; } }
public function ajaxChangeCover(Request $request) { if ($request->isMethod('POST') && user()->has_store) { $rules = $this->_getCoverRules(); $messages = $this->_getCoverMessages(); $validator = Validator::make($request->all(), $rules, $messages); if ($validator->fails()) { return file_pong(['status' => _const('AJAX_ERROR'), 'messages' => $validator->errors()->first()], 403); } /** * 1. Get file, path and info * 2. Generate file name * 3. Upload * 4. Resize * 5. Delete old cover images and upload image * 6. Save new info */ try { // 1 $store = store(); $coverPath = config('front.cover_path'); $file = $request->file('__file'); // 2 $filename = new FileName($coverPath, $file->getClientOriginalExtension()); $filename->cover()->generate(); $filename->setPrefix(_const('COVER_PREFIX')); $filename->cover()->group($this->_getCoverGroup(), true); // 3 $upload = new Upload($file); $upload->setDirectory($coverPath)->setName($filename->getName())->move(); // 4 $image = new Image($coverPath . $upload->getName()); $image->setDirectory($coverPath)->resizeGroup($filename->getGroup()); // 5 delete_file([$coverPath . $upload->getName(), $coverPath . $store->cover_original, $coverPath . $store->cover_big, $coverPath . $store->cover_medium, $coverPath . $store->cover_small]); // 5 $resizes = $image->getResizes(); $store->cover_original = $resizes['original']; $store->cover_big = $resizes['big']; $store->cover_medium = $resizes['medium']; $store->cover_small = $resizes['small']; $store->update(); } catch (Exception $ex) { $validator->errors()->add('__file', _t('opp')); return file_pong(['status' => _const('AJAX_OK'), 'messages' => $validator->errors()->first()], 500); } return file_pong(['status' => _const('AJAX_OK'), 'messages' => _t('saved_info'), 'data' => ['big' => asset($coverPath . $resizes['big']), 'medium' => asset($coverPath . $resizes['medium']), 'small' => asset($coverPath . $resizes['small'])]]); } }
function lstore($data, $csum, $language, $fallbackLanguage = 0) { //Store a localizable string. $db = new FractureDB('futuqiur_ember'); $csumn = new Csum($data); if (!$csum->matches($csumn)) { return null; } $store = store($data, $csum); $sid = $store['id']; //deduplicate rows here... $test = ltest($language, $sid); if (is_null($test)) { $id = $db->addRow('localized', 'language, data', '\'' . $language . '\', \'' . $sid . '\''); $store['id'] = $id; return $store; } $store['id'] = $test; return $store; }
function save() { inlog('Saving snippet file'); cache_clear(); global $config, $snippets; $snippets['tag_list'] = list_tags(); $snippets['tag_private_list'] = list_tags(false); if (!store($config['data_file'], $snippets)) { return alert('Error'); } else { return success('saved'); } }
$filelist .= template($mode . '_image_item', $array); } elseif ($extension == 'zip') { # Item is a zip file=> add change to folder $icone_visu = '<a class="tofolder" href="admin.php?unzip=' . $id . '&token=' . returnToken() . '" title="' . e('Convert this zip file to folder', false) . '"> </a>'; $array = array('#CLASS' => $class, '#ID' => $id, '#FICHIER' => $fichier_short, '#TOKEN' => returnToken(), '#SIZE' => $taille, '#NAME' => $nom, '#TITLE' => $title, '#EXTENSION' => $extension, '#ICONE_VISU' => $icone_visu, '#SLASHEDNAME' => addslashes($nom), '#SLASHEDFICHIER' => addslashes($fichier_short)); $filelist .= template($mode . '_file_item', $array); } else { # all other types $array = array('#CLASS' => $class, '#ID' => $id, '#FICHIER' => $fichier_short, '#TOKEN' => returnToken(), '#SIZE' => $taille, '#NAME' => $nom, '#TITLE' => $title, '#EXTENSION' => $extension, '#ICONE_VISU' => $icone_visu, '#SLASHEDNAME' => addslashes($nom), '#SLASHEDFICHIER' => addslashes($fichier_short)); $filelist .= template($mode . '_file_item', $array); } } } echo $folderlist . $filelist; if ($save) { store(); } // save in case of new files } else { e('No file on the server'); } ?> <script> function put_file(fichier){ document.getElementById('filename').value=fichier; document.getElementById('filename_hidden').value=fichier; } function put_id(id){document.getElementById('ID_hidden').value=id;} function put_link(id){document.getElementById('link').value="<?php
/** * writes the POT file * * this function writes the general.pot file * * @return void */ function writeFiles() { // read the storage $output = store(0, 0, array(), true); // iterate through the files and merge the information for the same strings foreach ($output as $file => $content) { // the original created separate .pot files for each source file // that containted over 11 strings, we've dropped this rule //if (count($content) <= 11 && $file != 'general') { if ($file != 'general') { @($output['general'][1] = array_unique(array_merge($output['general'][1], $content[1]))); if (!isset($output['general'][0])) { $output['general'][0] = $content[0]; } unset($content[0]); unset($content[1]); foreach ($content as $msgid) { $output['general'][] = $msgid; } unset($output[$file]); } } // create the POT file foreach ($output as $file => $content) { $tmp = preg_replace('<[/]?([a-z]*/)*>', '', $file); $tmp = preg_replace('/^\\.+/', '', $tmp); $file = str_replace('.', '-', $tmp) . '.pot'; $filelist = $content[1]; unset($content[1]); // source file and version information (from the Id tags) //if (count($filelist) > 1) { // $filelist = "Generated from files:\n# " . join("\n# ", $filelist); //} elseif (count($filelist) == 1) { // $filelist = "Generated from file: " . join("", $filelist); //} else { // $filelist = "No version information was available in the source files."; //} // writing the final POT to the proper file(s) / STDOUT //$fp = fopen($file, 'w'); fwrite(STDOUT, str_replace("--VERSIONS--", $filelist, join("", $content))); //fclose($fp); } }
/** * BoZoN admin page: * allows upload / delete / filter files * @author: Bronco (bronco@warriordudimanche.net) **/ include 'auto_restrict.php'; # Admin only! include 'core.php'; # delete file if (!empty($_GET['del']) && $_GET['del'] != '') { $f = id2file($_GET['del']); if (is_file($f)) { unlink($f); unset($ids[$_GET['del']]); store(ID_FILE, $ids); } } # search/filter if (!empty($_GET['filter'])) { $mask = strip_tags($_GET['filter']); } else { $mask = ''; } if ($_FILES) { include 'auto_dropzone.php'; exit; } ?> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr" charset="UTF-8">
function apply() { global $cart; global $rawSequence; global $discount; global $couponExclude; $coupons = array_values(array_merge($cart['coupons']['pre'], $cart['coupons']['post'])); for ($j = 0; $j < count($rawSequence); $j++) { for ($i = 0; $i < count($coupons); $i++) { if ($coupons[$i]['raw_type'] != $rawSequence[$j]) { continue; } switch ($coupons[$i]['type']) { case $discount['STORE_WIDE']: store($cart, json_decode($coupons[$i]['params'], true), $coupons[$i]['raw_type'], $discount['STORE_WIDE']); break; case $discount['CATEGORY_WIDE']: category($cart, json_decode($coupons[$i]['params'], true), $discount['CATEGORY_WIDE']); break; case $discount['BOGO']: bogo($cart, json_decode($coupons[$i]['params'], true), $discount['BOGO'] | $discount['CATEGORY_WIDE']); break; case $discount['GROUP_WISE']: break; default: } array_splice($coupons, $i, 1); $exclude = $couponExclude[$rawSequence[$j]]; for ($k = 0; $k < count($exclude); $k++) { for ($l = 0; $l < count($coupons); $l++) { if ($coupons[$l]['raw_type'] != $exclude[$k]) { continue; } array_splice($coupons, $i, 1); $l--; } } $i = -1; } } return $cart; }
function completeID($array_of_files) { $ids = unstore(); $sdi = array_flip($ids); // paths are keys $save = false; $upload_path_size = strlen($_SESSION['upload_path']); foreach ($array_of_files as $file) { $file = substr($file, $upload_path_size); if (!isset($sdi[$file])) { $save = true; $ids[uniqid(true)] = $file; } } if ($save) { store($ids); echo '<script>location.reload();</script>'; } }
<?php require "store.php"; $table = "usuario"; $preField[] = "nombre"; $preField[] = "contra"; $preField[] = "pregunta"; $preField[] = "respuesta"; $preField[] = "usuario"; $preValue[] = "Gustavo Amilcar Lopez"; $preValue[] = "G1234567"; $preValue[] = "G1234567?"; $preValue[] = "no"; $preValue[] = "GGustavoLopez"; store($preField, $preValue, $table);
$action = "login"; } $auth = getAuth(); /* print "<pre>"; print_r($_SERVER); print "</pre>"; */ if (isset($auth['isAuthenticated']) && $auth['isAuthenticated'] == 1) { // print $action . "<br/>"; switch ($action) { case "account": account_maintenance($config, $auth['agent']['webid'], $authreqissuer); break; case "store": store($config, $auth['agent']['webid'], $_POST['mbox'], $_POST['password'], $_POST['active'], $_POST['mbox_sha1sum'], $authreqissuer); break; case "reminder": reminder($config, $realm); break; case "forgotten": forgotten($auth['agent']['webid']); break; case "login": check_foaf_password($config, $authreqissuer, $auth['agent']['webid']); break; case "FOAFSSL": if (isset($authreqissuer)) { webid_redirect($authreqissuer, $auth['agent']['webid']); } else { login_screen($auth['agent']['webid']);
// go to the page for selection of an old report without storing the content of this page $url = REPGENDIR . "/repgen_select.php"; $url = "http://{$HTTP_HOST}" . $url; header("Location: " . $url); // switches to repgen_select.php exit; } if (isset($store)) { // go to page for definition of String-items if (!check_short($short)) { $error = ID_ERROR_BLOCK; } else { if (stristr($funct, " " . $short . "(")) { // $short == functionname? $info = $short . "|" . $date_ . "|" . $author . "|" . $long . "|" . addslashes($funct); store($id_new, $info); $url = REPGENDIR . "/repgen_select.php"; $url = "http://{$HTTP_HOST}" . $url; header("Location: " . $url); // switches to repgen_strings.php } else { $error = ERROR_FUNC . $short . "(){...}"; } } } if (isset($test)) { if (stristr($funct, " " . $short . "(")) { // $short == functionname? global $php_errormsg; @eval($funct); //declare funct
$adr = urlencode($location); $url = "http://maps.google.com/maps/geo?q=" . $adr . "&output=xml&key={$google_maps_key}"; $xml = simplexml_load_file($url); $status = $xml->Response->Status->code; if ($status = '200') { //address geocoded correct, show results //echo ("The address can be geocoded, we found the following results:<br/>"); foreach ($xml->Response->Placemark as $node) { // loop through the responses $address = $node->address; $quality = $node->AddressDetails['Accuracy']; $coordinates = $node->Point->coordinates; $latlng = explode(",", $coordinates); //echo ($coordinates); //echo ("Quality: $quality. $name. $address. $latlng[0]. $latlng[1]<br/>"); $id = store($name, $cnic, $address, $latlng[0], $latlng[1], $disease, $contact); if ($id != 0) { echo "Information has been inserted in the database. Marker id is: " . $id; } else { echo "Unable to insert the record in database."; } } } else { // address couldn't be geocoded show error message echo "The address \"{$adr}\" could not be geocoded<br/>"; } } function store($name, $cnic, $address, $lat, $lng, $disease, $contact) { //for local host $dbname = 'mapdatabase';
nextConf(-1); } elseif ($cfg == "Hide") { syslog(LOG_DEBUG, "p4: hide"); store("D", 0, 0, "black"); nextConf(1); } } if ($action == "click") { $mouseX = htmlspecialchars($_POST["mouse_x"]); $mouseY = htmlspecialchars($_POST["mouse_y"]); if ($_SESSION["cur"] > 0) { // check numrows $result = mysql_query($selectAllSchemaConf); $_SESSION["num"] = mysql_numrows($result); // update ... who nows :o store("A", $mouseX, $mouseY, "black"); nextConf(1); } } } // ------------------------- // show values include "schema.php"; echo " </form>"; include "footer.php"; //*************************************************************************** // Next Conf //*************************************************************************** function nextConf($dir) { // echo $_SESSION["cur"].":".$_SESSION["num"].":".$started;
/** * Get product image * * @param string $image Product image name * * @return string */ function product_image($image) { $path = config('front.product_path') . store()->id . '/'; return asset($path . $image); }
* Store a new session in the database. * * @param Connection $conn Connection with the database. * @return boolean true Stored successfuly. */ function store($conn) { // Gets all information received from the session factory. $name = utf8_decode($_REQUEST['name']); $speaker = utf8_decode($_REQUEST['speaker']); $location = utf8_decode($_REQUEST['location']); $date = $_REQUEST['date']; $hourStart = $_REQUEST['hourStart']; $hourFinish = $_REQUEST['hourFinish']; $capacity = $_REQUEST['capacity']; $query = "INSERT INTO session (name, speaker, location, date, hourStart, hourFinish, capacity, maxCapacity)\n\t\t VALUES('{$name}', '{$speaker}', {$location}', '{$date}', '{$hourStart}', '{$hourFinish}', {$capacity}, {$capacity})"; $result = $conn->query($query); echo true; } // Try to make the connection with the database. $connection = new Connection(); $conn = $connection->createConnection(); if ($conn) { // Get the action from the user factory. $action = $_REQUEST['action']; if ($action === "store") { store($conn); } } else { echo false; }
/** * Delete product old images * * @param Illuminate\Support\Collection $newImages * @param array $oldImages * * @return void */ protected function _deleteOldImages($newImages, $oldImages) { $oldImages = new Collection(json_decode($oldImages)); $productPath = config('front.product_path') . store()->id . '/'; if ($oldImages->count()) { foreach ($newImages as $k => $image) { if (isset($oldImages[$k])) { foreach ($oldImages[$k] as $one) { delete_file($productPath . $one); } } } } }
} } if (isset($page_graphics)) { // go to page for definition of Line-items if (!check_short($short) || empty($sql) || trim($sql) == "") { $error = ID_ERROR; } if (empty($error)) { // switches to repgen_graphics.php (Definition of items of the report) // set_session_data(); // test, if $sql is correct SQL Statement $sql = urldecode(stripslashes($sql)); $sql1 = str_replace("0_", TB_PREF, $sql); db_query($sql1, "Entered values NOT saved!"); $info = $short . "|" . $date_ . "|" . $author . "|" . $long . "|" . $print_format . "|" . $print_size . "|" . $report_type; store($id_new, $info, $sql, $group, $group_type); $url = REPGENDIR . "/repgen_graphics.php?id_new=" . $id_new . "&long=" . urlencode($long); header("Location: http://{$HTTP_HOST}" . $url); // switches to repgen_graphics.php exit; } } page("Report Generator REPGEN"); ### Output key administration forms, including all updated ### information, if we come here after a submission... ?> <script language="javascript"><!-- function num_test(feld) { if (isNaN(feld.value) == true) { alert("Use only Numbers here!");