<?php $server = "localhost"; $loginName = "user01"; $password = "******"; $db_handle = "lwip"; $table = "table11"; $conn_obj = new mysqli($server, $loginName, $password, $db_handle); foreach ($_GET as $key => $value) { ${$key} = $value; } connect(); write_to_db(); get_new_record_for_ajax_request(); //checks to see if there is a connection error function connect() { if ($conn_obj->connect_error) { echo "Could not make connection at point 1 ERROR: " . $conn_obj->connect_error; die; } } //this function writes to the database function write_to_db() { global $jewelry_name, $quality, $price, $discounts, $user_id, $location_id, $table, $conn_obj; $sql_statement = $conn_obj->stmt_init(); if ($sql_statement = $conn_obj->prepare("INSERT INTO {$table} (jewlery_type,quality,price_paid,discount,user_id,location_id) VALUES (?,?,?,?,?,?)")) { $sql_statement->bind_param('ssiiii', $jewelry_name, $quality, $price, $discounts, $user_id, $location_id); $sql_statement->execute(); $sql_statement->close();
// create redirection file question --- end if ($rows_displayed == 0) { print '<tr>'; print ' <td class="tableh2" colspan="3" align="center">'; print ' <h2>' . $lang_bridgemgr_php['no_action_needed'] . '</h2>'; print ' </td>'; print '</tr>'; } print cpg_submit_button($next_step[$step]); endtable(); print "</form>\n"; } // end if error break; case "finalize": $error = write_to_db($previous_step[$step]); if (!$error) { $BRIDGE = cpg_get_bridge_db_values(); $CONFIG = cpg_refresh_config_db_values(); // sync groups here now :) if ($CONFIG['bridge_enable']) { include_once 'bridge/' . $BRIDGE['short_name'] . '.inc.php'; $cpg_udb->synchronize_groups(); } else { // ok, then restore group table cpg_db_query("DELETE FROM {$CONFIG['TABLE_USERGROUPS']} WHERE 1"); cpg_db_query("INSERT INTO {$CONFIG['TABLE_USERGROUPS']}\n VALUES (1, 'Administrators', 0, 1, 1, 1, 1, 1, 1, 0, 0, 3, 0, 5, 3)"); cpg_db_query("INSERT INTO {$CONFIG['TABLE_USERGROUPS']}\n VALUES (2, 'Registered', 1024, 0, 1, 1, 1, 1, 1, 1, 0, 3, 0, 5, 3)"); cpg_db_query("INSERT INTO {$CONFIG['TABLE_USERGROUPS']}\n VALUES (3, 'Anonymous', 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 5, 3)"); cpg_db_query("INSERT INTO {$CONFIG['TABLE_USERGROUPS']}\n VALUES (4, 'Banned', 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 5, 3)"); }
} if (isset($_GET["version"])) { $version = htmlspecialchars($_GET["version"]); } if (isset($_GET["target"])) { $target = htmlspecialchars($_GET["target"]); } // insert in database $field_str[] = "email"; $data_str[] = "'" . write_to_db($email) . "'"; $field_str[] = "name"; $data_str[] = "'" . write_to_db($company) . "'"; $field_str[] = "country"; $data_str[] = "'" . write_to_db($country) . "'"; $field_str[] = "newsletter"; $data_str[] = "'" . write_to_db($version) . "'"; $field_str[] = "date_login"; $data_str[] = Date("'Y-m-d H:i:s'"); $cc = implode(',', $field_str); $dd = implode(',', $data_str); $sql = new sql(); $query = "insert into qcs_tracking ({$cc}) values ({$dd})"; $sql->dinsert($query); $sql->dclose(); } // redirection $host = $_SERVER['HTTP_HOST']; $uri = rtrim(dirname($_SERVER['PHP_SELF']), '/\\'); if ($target != '') { header("Location: http://{$host}{$uri}/{$target}"); } else {
$folder = "channel_bi_bpm_cpm"; $open_folder = file("d:\\wamp\\www\\fsn\\public\\{$folder}"); $w = 0; $flimit = count($open_folder); while ($w <= $flimit) { if (is_file($open_folder[$w])) { write_to_db($folder); } elseif (is_dir($open_folder[$w])) { $inner_folder = $open_folder[$w]; $open_inner_folder = file("d:\\wamp\\www\\fsn\\public\\{$folder}\\{$inner_folder}"); $v = 0; $iflimit = count($open_inner_folder); while ($v <= $iflimit) { if (is_file($ope_inner_folder[$v])) { write_to_db($inner_folder); } $v++; } } $w++; } function write_to_db($folder) { if ($connect = mysql_connect("localhost", "root", "")) { mysql_select_db("fsn", $connect); } else { echo "There was an error connecting to the database, please contact the administrator"; } # http://fsn.co.uk/channel_financial_reporting/why_we_need_creative_accountants_not_creative_accounting.htm $page = file("http://fsn.co.uk/channel_bi_bpm_cpm/int_with_bernard_liautaud_ceo_business_objects.htm");
$t = 0; while ($inner_name = readdir($open_inner_folder)) { if ($inner_name == '.' || $inner_name == '..' || $inner_name == '...' || $inner_name == '_notes') { continue; } $inner_file_array[$t] = $inner_name; $t++; } $v = 0; $iflimit = count($inner_file_array); while ($v <= $iflimit) { if (is_file("../../../../fsn/public/channel_{$folder}/{$inner_folder}/{$inner_file_array[$v]}")) { echo "<hr />"; echo "<strong>filename:</strong> <a href=\"../../../../fsn/public/channel_{$folder}/{$inner_folder}/{$inner_file_array[$v]}\" target=\"_blank\">" . $inner_file_array[$v] . "</a><br /><br />"; echo "NEWS"; $output = write_to_db("../../../../fsn/public/channel_{$folder}/{$inner_folder}/{$inner_file_array[$v]}", $folder, 'news'); } $v++; } } $w++; } } /////////////////////////////////////////////////////////////////////////////////// // FUNCTION THAT PROCESSES PAGES WITHING FOLDER AND OUTPUTS THE VARIOUS SECTIONS // /////////////////////////////////////////////////////////////////////////////////// function write_to_db($file, $folder, $type) { global $results; if ($connect = mysql_connect("localhost", "root", "")) { mysql_select_db("fsn", $connect);
<?php error_reporting(1); include "../db_connect.php"; $models_for_output = "2347*750 1853*750 2035*750 2066*650 0914*450 2040*750 2010*750 1659*850 1146*750 2059*850 1590*850 1341*450 1839*450 0870*450 2150*750 1713*750 0795*650 1172*450 0720*450 0838*450 1034*350 2235*850 1816*650 1190*450 2268*1200 0395*90 0289*90 1211*250 0757*450 0655*450 1722*450 1617*450 1637*450 0862*950 1234*750 0717*450 2168*800 0669*350 2307*800 0716*550 1670*550 1012*350 1236*350 1899*950 1817*800 1510*800 2003*800 1978*800 1377*800 1938*800 2079*800 2024*800 2015*800 2033*1200 2034*1200 2026*1200 2004*800 1954*800 1309*800 2009*650 1909*800 0777*300 0797*300 0918*800 1152*500 1196*500 1209*500 1224*500 1341*500 1365*250 1437*350 1481*350 1557*950 1618*500 1628*350 1663*900 1686*350 1710*500 1793*850 1794*550 1900*550 1990*550 2036*900 2037*900 2337*750 2536*950 2266*750 0530*200 0867*200 0215*200 1697*400 2235*880 1575*350 1275*250 1981*550 1615*550 1523*250 1879*500 0385*200 2120*150 1501*600 0341*200 1466*800 1010*400 2557*1000 1826*1250 2299*880"; $pars = explode(' ', $models_for_output); foreach ($pars as $tt) { //$query="UPDATE `im_catalog` SET `season` = 'Весна-лето' WHERE `nomer_mod` = '".$tt."';"; //$result=mysql_query($query); //$q++; //echo $q."<br>"; $ht = explode('*', $tt); write_to_db($ht[0], $ht[1]); // echo "модель: ".$ht[0]."price: ".$ht[1]."<br>"; } echo "<br><br><br>__ok"; function write_to_db($art, $price) { $query = "UPDATE `im_catalog` SET `price_new` = '" . $price . "', `promo`='4',`show`='1' WHERE `nomer_mod` like '" . $art . "%';"; $result = mysql_query($query); echo $query . "<br>"; } /*$models=explode (' ',$models_for_output); foreach ($models as $val) { unshownfunc($val); } echo 'end'; */ /* function unshownfunc($val2)