Advertisement
Guest User

Untitled

a guest
Mar 27th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.21 KB | None | 0 0
  1. <?php
  2.  
  3. include(dirname(__FILE__).'/../../config/config.inc.php');
  4. include(dirname(__FILE__) . '/advancedexport.php');
  5.  
  6. function get_array_needed() {
  7.     $servername = "localhost";
  8.     $username = "algolhos_unisitc";
  9.     $password = "Un1s1t_commerce";
  10.     $dbname = "algolhos_unisitc";
  11.  
  12.     // Create connection
  13.     $conn = new mysqli($servername, $username, $password, $dbname);
  14.     // Check connection
  15.     if ($conn->connect_error) {
  16.         die("Connection failed: " . $conn->connect_error);
  17.     }
  18.  
  19.     $sql = "SELECT codice_target FROM customer";
  20.     $result = $conn->query($sql);
  21.     $rtoclass = array();
  22.  
  23.     if ($result->num_rows > 0) {
  24.         // output data of each row
  25.         while($row = $result->fetch_assoc()) {
  26.             echo "id: " . $row["id_customer"]. " - Codice target: " . $row["codice_target"]."<br>";
  27.             $rtoclass[] = $row;
  28.         }
  29.     } else {
  30.         echo "0 results";
  31.     }
  32.  
  33.     $conn->close();
  34.     return $rtoclass;
  35. }
  36.  
  37.  
  38. if (Tools::getIsset('secure_key'))
  39. {
  40.     $secureKey = Configuration::get('ADVANCEDEXPORT_SECURE_KEY');
  41.     if (!empty($secureKey) AND $secureKey === Tools::getValue('secure_key'))
  42.     {
  43.         include(dirname(__FILE__).'/../../init.php');
  44.  
  45.         $ae = new AdvancedExport();
  46.         $ae->set_arr_needed( get_array_needed() );
  47.         $ae->cronTask();
  48.     }
  49. }
  50.  
  51.  
  52. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement