Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include(dirname(__FILE__).'/../../config/config.inc.php');
- include(dirname(__FILE__) . '/advancedexport.php');
- function get_array_needed() {
- $servername = "localhost";
- $username = "algolhos_unisitc";
- $password = "Un1s1t_commerce";
- $dbname = "algolhos_unisitc";
- // Create connection
- $conn = new mysqli($servername, $username, $password, $dbname);
- // Check connection
- if ($conn->connect_error) {
- die("Connection failed: " . $conn->connect_error);
- }
- $sql = "SELECT codice_target FROM customer";
- $result = $conn->query($sql);
- $rtoclass = array();
- if ($result->num_rows > 0) {
- // output data of each row
- while($row = $result->fetch_assoc()) {
- echo "id: " . $row["id_customer"]. " - Codice target: " . $row["codice_target"]."<br>";
- $rtoclass[] = $row;
- }
- } else {
- echo "0 results";
- }
- $conn->close();
- return $rtoclass;
- }
- if (Tools::getIsset('secure_key'))
- {
- $secureKey = Configuration::get('ADVANCEDEXPORT_SECURE_KEY');
- if (!empty($secureKey) AND $secureKey === Tools::getValue('secure_key'))
- {
- include(dirname(__FILE__).'/../../init.php');
- $ae = new AdvancedExport();
- $ae->set_arr_needed( get_array_needed() );
- $ae->cronTask();
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement