Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <meta charset="UTF-8">
- <pre>
- <?
- error_reporting(E_ALL & ~E_NOTICE);
- $link = mysql_connect("localhost", ) or die(mysql_error());
- $db = mysql_select_db("_sistem", $link) or die (mysql_error());
- mysql_query("SET NAMES 'UTF8'");
- mysql_query("SET character_set_connection = 'UTF8'");
- mysql_query("SET character_set_client = 'UTF8'");
- mysql_query("SET character_set_results = 'UTF8'");
- echo "....<br>";
- echo "Revisioned #6" . " Last modified: " . date ("F d Y H:i:s.", getlastmod()) . "<p>";
- require('files/excel_reader/reader.php');
- $connection = new Spreadsheet_Excel_Reader();
- $connection->setOutputEncoding('UTF-8');
- // Sistem seç:
- $sistem = "artemis";
- // Platform seç:
- $platform = "all";
- echo "Selected brand group is <b>$sistem</b> and platform is <b>$platform</b><br>";
- if ($platform == "all") {
- $appKey = "";
- $appSecret = "";
- } elseif ($platform == "ha") {
- $appKey = "616ba6e11a2";
- $appSecret = "oNnZsGB";
- } elseif($platform == "xx") {
- $appKey = "ae317a8";
- $appSecret = "1eNmx";
- } else {
- echo "Hangi sistem olduğu seçili ama platform seçili değil. İşlem sonlandırılıyor.";
- die;
- }
- $en = "_en";
- $tr = "_tr";
- $lang = "en";
- $secsis._.$lang = "Seçili sistem ";
- if ($sistem == "artemis") {
- $connection->read('files/xls_files/artemis.xls');
- } elseif ($sistem == "bahariye") {
- $connection->read('files/xls_files/bahariye.xls');
- echo "$secsis_en $sistem";
- } elseif ($sistem == "foneks") {
- $connection->read('files/xls_files/foneks.xls');
- echo "$secsis_en $sistem";
- } elseif ($sistem == "patika") {
- $connection->read('files/xls_files/patika.xls');
- echo "$secsis_en $sistem";
- } // if:/sistem biti?i.
- echo "<u>Marka - Model - Stok - M2 - SS - Kategori - Stokkodu</u><br>";
- for ($i = 2; $i < $connection->sheets[0]['numRows']; $i++) {
- for ($j = 1; $j <= $connection->sheets[0]['numCols']; $j++)
- $marka = $connection->sheets[0]['cells'][$i][4];
- $modell = $connection->sheets[0]['cells'][$i][3];
- $stok = $connection->sheets[0]['cells'][$i][7];
- $m2 = $connection->sheets[0]['cells'][$i][10];
- $ss = $connection->sheets[0]['cells'][$i][1];
- $kat = $connection->sheets[0]['cells'][$i][5];
- $stokkod1 = $connection->sheets[0]['cells'][$i][3];
- $stokkod2 = $connection->sheets[0]['cells'][$i][10];
- $stokkodu = "$stokkod1-$stokkod2";
- if ($sistem == "artemis" AND $marka = "Artemis Halı") {
- $model1 = str_replace(array(
- "Art.","080x",".",
- ),array(
- NULL,"80x",NULL,
- ),$modell);
- $model_trconv1 = array("Ğ","Ü","İ","Ş","Ö","Ç","ğ","ü","ı","ş","ö","ç"); $model_trconv2 = array("G","U","I","S","O","C","g","u","i","s","o","c"); $model_trconv = str_replace($model_trconv1,$model_trconv2,$model1);
- $model = rtrim($model_trconv);
- $stok_kodu = $model."-".$m2;
- $stokkod = str_replace(" ","-",$stok_kodu);
- mysql_query('update urun set adet = "'.$stok.'" where stokk = "'.$stokkod.'"') or die(mysql_error());
- }
Advertisement
Add Comment
Please, Sign In to add comment