www
/
wwwroot
/
magazinmiorita.be
➕ New
📤 Upload
✎ Editing:
ucsv.php
← Back
<?php ob_start(); include('includes/inc.config.php'); ini_set("display_errors",0); ?> <link rel="stylesheet" href="http://miorita.ddns.net/css/style.css"> <link rel="stylesheet" href="http://miorita.ddns.net/css/font-awesome.min.css"> <script src="http://miorita.ddns.net/js/jquery.min.js"></script> <?php $get_remote_data = "select * from products"; $count = 0; $last_number = 0; $array = $database->execute($get_remote_data); foreach($array as $row){ $last_number++; } function replaceSpace($string){ $string = trim(preg_replace('/\s+/', ' ', $string)); return htmlspecialchars(addslashes($string)); } if(isset($_GET['sync'])){ foreach($array as $row){ $count++; ?> <script> $(document).ready(function(){ var count = '<?php echo $count;?>'; var last = '<?php echo $last_number;?>'; $.post("http://www.magazinmiorita.be/apifunc.php", { code: '<?php echo $row['code'];?>', name: '<?php echo $row['name'];?>', cat_id: '<?php echo $row['cat_id'];?>', scat_id: '<?php echo $row['scat_id'];?>', image: '<?php echo $row['thumb'];?>' }, function(data){ console.log(data); var json = $.parseJSON(data); $("#result").append(json.text); if(count == last){ $('#scroll').clearQueue(); }else{ $('#scroll').animate({scrollTop: $('#scroll')[0].scrollHeight + count }); } calculatePercentage(count,last); $("#updated_items").html(count+' Produse - Din '+last+' actualizate'); }); }); </script> <?php } } ?> <script> function calculatePercentage(oldFigure, newFigure) { if ((oldFigure != 0) && (newFigure != 0)) { var percentChange = (1 - oldFigure / newFigure) * 100; } else { var percentChange = null; } var final_perc = Math.round(100 - percentChange); $("#percentage").html('<div style="height:20px;width:'+final_perc+'%;background:#77b300;color:#fff"><span style="float:right;margin-right:5px">'+final_perc+'%</span></div>'); } </script> <div class="update_sku" style="width:98%;margin:0 auto;border:1px solid #ccc;;"> <button class="add_item right button-care" onclick="window.close()">Inchide</button> <center>Update Stock</center> <br /> <center><button onclick="window.location.href='ucsv.php?sync=true'"> <i class="fa fa-refresh"></i> Syncronizeaza</button></center> <br /> <div id="updated_items">0 Produse - din <?php echo $last_number;?> actualizate</div> <div id="percentage" style="background-color:#cfcfcf"> 0%</div> <hr /> <table> <tr> <th width="150">Stare</th> <th width="150">Cod</th> <th width="350">Produs</th> <th width="350">Image</th> </tr> </table> <div id="scroll" style="height:500px;overflow:auto"> <table id="result"> </table> </div> </div>
💾 Save Changes
Cancel
📤 Upload File
×
Select File
Upload
Cancel
➕ Create New
×
Type
📄 File
📁 Folder
Name
Create
Cancel
✎ Rename Item
×
Current Name
New Name
Rename
Cancel
🔐 Change Permissions
×
Target File
Permission (e.g., 0755, 0644)
0755
0644
0777
Apply
Cancel