Completed

Sabes que es esto?

Published on the February 28, 2017 in IT & Programming

About this project

Open

Function updProperty($property, $propertyId, $userLangId)
    {
        $this->Common_model->updateTableData($this->tableList, $propertyId, array(), $property);
    }

    function addPropertyPhotos($propertyImages, $list_id)
    {
        $featured            = 1;
        $order                = 0;

        for($i = 0; $i < count($propertyImages->Image); $i++){
            if($featured) {
                $url = (string)$propertyImages->Image[$i][0];
                $dir = "/home/bydays/www/images/list/" . $List_id . "/";

                If (!is_dir($dir))
                    mkdir($dir, 0777, true);

                $archivoFinal = fopen($dir .
basename($url), "w+");
                $imageTypeID = $image['@attributes']['ImageTypeID'];

                $ch = curl_init();
                $ch = curl_init($url);
                curl_setopt($ch, CURLOPT_TIMEOUT, 50);
                curl_setopt($ch, CURLOPT_FILE, $archivoFinal);
                curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
                curl_setopt($ch, CURLOPT_ENCODING, "");
                curl_exec($ch);
                curl_close($ch);
                fclose($archivoFinal);

                $listPhotosData        = array(
                    'img_desc'            => $this->rentalsunited->getImageType($imageTypeID),
                    'name'                => basename($url),
                    'is_featured'        => $featured,
                    'order'                => $order,
                    'list_id'            => $list_id,
                    'created'            => time(),
                );

            } else {
                $image = xml2array($propertyImages->Image[$i]);
                $imageTypeID = $image['@attributes']['ImageTypeID'];

                $listPhotosData        = array(
                    'img_desc'            => $this->rentalsunited->getImageType($imageTypeID),
                    'name'                => (string)$propertyImages->Image[$i][0],
                    'is_featured'        => $featured,
                    'order'                => $order,
                    'list_id'            => $list_id,
                    'created'            => time(),
                );
            }

            $this->Common_model->insertData($this->tableListPhotos, $listPhotosData);
            $featured            = 0;
            $order++;
        }
    }

Category IT & Programming
Subcategory Web development
What is the scope of the project? Small change or bug
Is this a project or a position? Project
I currently have Not applicable
Required availability As needed
Experience in this type of projects Yes (I have managed this kind of project before)
Roles needed Developer

Delivery term: Not specified

Other projects posted by O. L.