Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function saveImage($barcode)
- {
- if(is_numeric($barcode))
- {
- $qw = $this->PDO->query("SELECT `BARCODE`, `IMAGE`, `PHOTO_NUM` FROM `photo` WHERE `BARCODE`='".$barcode."' LIMIT 0, 32");
- if($qw->fetchColumn()>0)
- {
- while($row = $qw->fetch())
- {
- $mark = $this->getMark($row['BARCODE']);
- if(!file_exists($this->app_path.'\images\\'.$mark))
- {
- mkdir($this->app_path.'\images\\'.$mark, 0777);
- }
- $img_path=$this->app_path.'\images\\'.$mark.'\\'.$row['BARCODE'].'-'.$row['PHOTO_NUM'].'.jpg';
- if(!file_exists($img_path))
- {
- file_put_contents($img_path, $row['IMAGE']);
- }
- }
- }
- else
- {
- return false;
- }
- }
- else
- {
- return false;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement