<?
ob_start();
require_once("../../../lib/config_ar.php");
//echo "231311321";    
if(!isset($_COOKIE['admin']) && !isset($_COOKIE['user'])){
        header('Location: ../../index.php');
    }								
function namesite(){
    $sel = "select sitename from users where adm_mem=1";
        $query = mysql_query($sel);
        while($result=mysql_fetch_array($query)){
            extract($result);
            echo $sitename;
        }
}
?>
<!DOCTYPE HTML>

<html lang="en" class="no-js">
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><? namesite(); ?></title>
<link href="css/style.css" rel="stylesheet" type="text/css" />

<link rel="stylesheet" href="jquery-ui.css" id="theme">
<link rel="stylesheet" href="../jquery.fileupload-ui.css">
<link rel="stylesheet" href="style.css">
</head>
<body>
<!-- header ----------------------------------------------------->

<link href="css/header.css" rel="stylesheet" type="text/css" />

<div class="name_site">
<span class="slogan_site">مركز تحميل الملفات</span><br />
<? namesite(); ?>
</div>
<a href="../../info.php">
    <!--<div class="view_site">عودة للوحة التحكم</div> -->
</a>

<!-- header -->
<!-------------------------------------------------------->
<?
/*
    $selho = "select * from adsurl where id=1";
    $qurho = mysql_query($selho);
    while($resho = mysql_fetch_array($qurho)){
        extract($resho);
        $urlho = $url;
    }
*/
?>
<!--
<form method="post" action="<?= $_SERVER['PHP_SELF']; ?>">
    <table>
        <tr>
            <td>رابط الاعلان</td>
            <td>:</td>
            <td></td>
            <td><input type="text" name="url_f" value="<?=$urlho?>" size="50" /></td>
            <td>www.yahoo.com :مثال</td>
        </tr>
        <tr>
            <td class="ti_ro">التفعيل</td>
            <td class="comast">:</td>
            <td></td>
            <td><select name="active">
                    <option value="1">تفعيل</option>
                    <option value="0">الغاء التفعيل</option>
                </select>
            </td>
        </tr>
        <tr>
            <td></td>
            <td></td>
            <td></td>
            <td><input type="submit" name="submit_f" value="تعديل" /></td>
        </tr>
    </table>
</form>
<?
    $submit_f = $_POST['submit_f'];
    $url_f = $_POST['url_f'];
    $active_f=$_POST['active'];
    if($submit_f){
        //to send data from editor to db
        $result = "update adsurl set url='$url_f', active='$active_f' where id=1";
        $query = mysql_query($result);
        echo "<p align='center'><font siz='22' color='green'>من فضلك انتظر حتى يتم التعديل</font></p>".
                                                    "<meta http-equiv='refresh' content='1'>";
    }
?>
<br /><br /><br />
<h3><b><p>ملحوظة هذا الإعلان يقبل صورة واحدة</p></b></h3>
<br /><br />
-->
<!-------------------------------------------------------->
<br /><br /><br /><br /><br /><br /><br /><br />
<div id="fileupload">
    <form action="upload.php" method="POST" enctype="multipart/form-data">
        <div class="fileupload-buttonbar">
            <label class="fileinput-button">
                <span>إضافة صور...</span>
                <input type="file" name="files[]" multiple>
            </label>
            <button type="submit" class="start">بدء الرفع</button>
            <button type="reset" class="cancel">الغاء الرفع</button>
            <button type="button" class="delete">حذف كل الصور</button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <!--<a href="../../info.php">عودة للوحة التحكم</a>-->
        </div>
    </form>
    <div class="fileupload-content">
        <table class="files"></table>
        <div class="fileupload-progressbar"></div>
    </div>
</div>
<script id="template-upload" type="text/x-jquery-tmpl">
    <tr class="template-upload{{if error}} ui-state-error{{/if}}">
        <td class="preview"></td>
        <td class="name">${name}</td>
        <td class="size">${sizef}</td>
        {{if error}}
            <td class="error" colspan="2">Error:
                {{if error === 'maxFileSize'}}File is too big
                {{else error === 'minFileSize'}}File is too small
                {{else error === 'acceptFileTypes'}}Filetype not allowed
                {{else error === 'maxNumberOfFiles'}}Max number of files exceeded
                {{else}}${error}
                {{/if}}
            </td>
        {{else}}
            <td class="progress"><div></div></td>
            <td class="start"><button>Start</button></td>
        {{/if}}
        <td class="cancel"><button>Cancel</button></td>
    </tr>
</script>
<script id="template-download" type="text/x-jquery-tmpl">
    <tr class="template-download{{if error}} ui-state-error{{/if}}">
        {{if error}}
            <td></td>
            <td class="name">${name}</td>
            <td class="size">${sizef}</td>
            <td class="error" colspan="2">Error:
                {{if error === 1}}File exceeds upload_max_filesize (php.ini directive)
                {{else error === 2}}File exceeds MAX_FILE_SIZE (HTML form directive)
                {{else error === 3}}File was only partially uploaded
                {{else error === 4}}No File was uploaded
                {{else error === 5}}Missing a temporary folder
                {{else error === 6}}Failed to write file to disk
                {{else error === 7}}File upload stopped by extension
                {{else error === 'maxFileSize'}}File is too big
                {{else error === 'minFileSize'}}File is too small
                {{else error === 'acceptFileTypes'}}Filetype not allowed
                {{else error === 'maxNumberOfFiles'}}Max number of files exceeded
                {{else error === 'uploadedBytes'}}Uploaded bytes exceed file size
                {{else error === 'emptyResult'}}Empty file upload result
                {{else}}${error}
                {{/if}}
            </td>
        {{else}}
            <td class="preview">
                {{if thumbnail_url}}
                    <a href="${url}" target="_blank"><img src="${thumbnail_url}"></a>
                {{/if}}
            </td>
            <td class="name">
                <a href="${url}"{{if thumbnail_url}} target="_blank"{{/if}}>${name}</a>
            </td>
            <td class="size">${sizef}</td>
            <td colspan="2"></td>
        {{/if}}
        <td class="delete">
            <button data-type="${delete_type}" data-url="${delete_url}">Delete</button>
        </td>
    </tr>
</script>
<script src="jquery.min.js"></script>
<script src="jquery-ui.min.js"></script>
<script src="jquery.tmpl.min.js"></script>
<script src="../jquery.iframe-transport.js"></script>
<script src="../jquery.fileupload.js"></script>
<script src="../jquery.fileupload-ui.js"></script>
<script src="application.js"></script>
</body> 
</html>
<?ob_flush();?>