Exemplo n.º 1
0
        foreach ($files as $val) {
            if (is_file($dir . $val)) {
                $mydir .= '<option VALUE=' . $val;
                $mydir .= $val == $curr_val ? ' selected>' : '>';
                $mydir .= $val . "\n";
                $teller++;
            }
        }
        $mydir .= "";
    }
    return $mydir;
}
if (!isset($_POST['ItemPDF'])) {
    $_POST['ItemPDF'] = '';
}
echo '<tr><td>' . _('PDF attachment (.pdf)') . ':' . "\n</td><td>" . select_files('companies/' . $_SESSION['DatabaseName'] . '/pdf_append//', '', 'ItemPDF', $_POST['ItemPDF'], '60') . '</td></tr>' . "\n";
// Add image upload for New Item  - by Ori
echo '<tr><td>' . _('Image File (.jpg)') . ':</td><td><input type="file" id="ItemPicture" name="ItemPicture"></td></tr>';
// EOR Add Image upload for New Item  - by Ori
echo '<tr><td>' . _('Category') . ':</td><td><select name="CategoryID" onChange="ReloadForm(ItemForm.UpdateCategories)">';
$sql = 'SELECT categoryid, categorydescription FROM stockcategory WHERE stocktype="A"';
$ErrMsg = _('The stock categories could not be retrieved because');
$DbgMsg = _('The SQL used to retrieve stock categories and failed was');
$result = DB_query($sql, $db, $ErrMsg, $DbgMsg);
while ($myrow = DB_fetch_array($result)) {
    if (!isset($_POST['CategoryID']) or $myrow['categoryid'] == $_POST['CategoryID']) {
        echo '<option selected VALUE="' . $myrow['categoryid'] . '">' . $myrow['categorydescription'];
    } else {
        echo '<option VALUE="' . $myrow['categoryid'] . '">' . $myrow['categorydescription'];
    }
    $category = $myrow['categoryid'];
Exemplo n.º 2
0
}
echo rtrim($ext, ", ") . "</b>";
?>
  </p>
  <form action="<?php 
echo $_SERVER['PHP_SELF'];
?>
" method="post" enctype="multipart/form-data" name="form1">
	<input type="hidden" name="MAX_FILE_SIZE" value="<?php 
echo $max_size;
?>
">
	<center><input type="file" name="upload" id="upload" size="25"></center>
	<label for="replace">Replace?</label>
	<input type="checkbox" name="replace" id="replace" value="y"><br clear="all">
	<label for="check">Validate filename ?</label>
	<input name="check" type="checkbox" id="check" value="y" checked>
	<br clear="all">
	<center><input type="submit" name="Submit" id="Submit" value="Submit"></center>
  </form>
  <p style="margin-top:20px;color:#FF0000;"><?php 
echo $my_upload->show_error_string();
?>
</p>
  <?php 
echo select_files($folder);
?>
  <p style="margin-top:40px;">Find more information about the directory and download function on: <a href="http://www.finalwebsites.com/snippets.php" target="_blank">www.finalwebsites.com</a></p>
</div>  
</body>
</html>
Exemplo n.º 3
0
    }
}
// establish database connection
db_connect();
$erase_all_data = fopen("all.txt", "w+");
//open text file to erase all data (if any)
fclose($erase_all_data);
//close file
$file_content = NULL;
//declare variable to avoid warning at insert data (if others file came before text file)
// creating the current path
$path = dirname(__FILE__);
// the trailing slash for windows or linux
$path .= substr($path, 0, 1) == "/" ? "/sync/" : "\\sync\\";
// get the filenames from the directory
$file_array = select_files($path);
// creating some controle variables and arrays
$num_files = count($file_array);
$success = 0;
$error_array = array();
// if the file array is not empty the loop will start
if ($num_files > 0) {
    foreach ($file_array as $val) {
        $fdate = date("Y-m-d", filectime($path . $val));
        //extract file modified date
        /*$type = substr($val, 0, -44);  //extract file type
        		$ttl = substr($val, 4, -41);  //extract time to live
        		$c_id = substr($val, 7, -30);  //extract creator id
        		$r_id = substr($val, 18, -19);  //extract receiver id
        		$ts_p = substr($val, 29, -4);   //extract time stamp as integer
        		*/