Exemplo n.º 1
0
			</div>
			<div class="col-6 pull-left mobile-hidden">
				<form action="" method="post">
					<input name="name" type="text" id="name" class="search form-control" placeholder="Pesquisar">
				</form>
			</div>
		</div>
	</div>
	<div class="app-pane-body bleed-bottom" style="background-color:#F9F9F9;">
		<div class="col-12">
			<?php 
$n = 1;
if ($rs) {
    $image = new ProjectImage();
    foreach ($rs as $project) {
        $i = $image->get(array('id_project' => $project['id_project']));
        $img = "/static/img/icons/cubo_black.png";
        if (count($i) > 0) {
            if (array_key_exists('src', $i[0])) {
                $img = 'media/' . str_replace("\\", "/", $i[0]['src']);
            }
        }
        if (ctype_upper($project['title'])) {
            $title = mb_strimwidth($project['title'], 0, 10, "...");
        } else {
            $title = mb_strimwidth($project['title'], 0, 10, "...");
        }
        ?>
						<div class="col-3 pull-left" title="<?php 
        echo $title;
        ?>
        }
        $project = $media . $id_admin . $ds . $pk;
        if (!is_dir($project)) {
            $mkdir = mkdir($project, 0700);
            $chmod = chmod($project, 0700);
        }
        $tmp = $file['tmp_name'];
        $name .= "." . $ext;
        $source = $project . $ds . $name;
        if (move_uploaded_file($tmp, $source)) {
            $source = $id_admin . $ds . $ds . $pk . $ds . $ds . $name;
            $sql = array("id_project" => $pk);
            $image = new ProjectImage();
            $image->fields = array('id_project_image');
            if ($image->count($sql) == 1) {
                $rs = $image->get($sql);
                $rs = $rs[0];
                $sql = array("src" => $source, "name" => $file['name'], "mime_type" => $file['type']);
                $image = new ProjectImage();
                $image->fields = $sql;
                $image->update(array("id_project_image" => $rs['id_project_image']));
            } else {
                $sql = array("id_project" => $pk, "src" => $source, "name" => $file['name'], "mime_type" => $file['type']);
                $image = new ProjectImage($sql);
                $image = $image->save();
                if ($image) {
                    ?>
						<script>
							window.parent.boss.removeClass('modal_dialog', 'active');
							window.parent.boss.popup("Sucesso ao atualizar foto do projeto.");
						</script>