<commit_before><?php


// List of Documents
$sql    = "SELECT `document_type_id`,`document_description`, `document_path`, `document_status` FROM `tams_talent_documents` WHERE (`document_status` = 'active') AND ( tams_talent_documents.`document_type_id` NOT IN (SELECT document_type_id FROM tams_talent_documents WHERE talent_id=".$talent_id."))";
$document_types = DB::query($sql);

if(isset($_GET['talent_id']))
{
	$talent_id = $_GET['talent_id'];
}

$document_sql    = "SELECT
*
FROM
tams_talent_documents
WHERE talent_id = $talent_id";

$talent_document = DB::query($document_sql);
if(isset($_POST['save'])) {
 
$talent_id = $_POST['talent_id'];
$document_type_id = $_POST['document_type_id'];
$document_description = $_POST['document_description'];
$document_path = $_POST['document_path'];
$document_status = $_POST['document_status']; 
$last_modified_by = $_SESSION['user_id'];
$last_modified_on = getDateTime(NULL,"mySQL");

 // if client id is not empty update the database
 
	if($talent_id <> ""){
		$update = DB::update('tams_talent_documents', array(
			
			'talent_id' => $talent_id,
			'document_type_id' => $document_type_id,
			'document_description' => $document_description,
			'document_path' => $document_path,
			'document_status' => $document_status,
			'last_modified_by'	=> $last_modified_by,
			'last_modified_on'	=> $last_modified_on
			),
			"talent_id=%s", $talent_id
		);
	//check if the file is uploaded and process the file if file is uploaded	
	
	if(!file_exists($_FILES['talent_doc']['tmp_name']) || !is_uploaded_file($_FILES['talent_doc']['tmp_name'])) {
		echo '<h2> No file ploaded</h2>';
	}  else {
		echo '<h2> file was uploaded</h2>';
	}
	//if logo file is uploaded process the file with upload class
	
	$handle1 = new upload($_FILES['talent_doc']);
		if ($handle1->uploaded) {
			$handle1->file_new_name_body   = $talent_id.'_doc';
			$handle1->allowed = array('application/pdf','application/msword','application/vnd.ms-powerpoint', 'application/vnd.ms-excel','text/plain');
			$handle->file_new_name_ext = 'pdf';
			$handle1->file_overwrite = true;
			$handle1->process('..uploads/documents/');
		if ($handle1->processed) {
			
	// save uploaded file name and path in database table field logo_url
	
	
			$last_modified_by = $_SESSION['user_id'];
			$last_modified_on = getDateTime(NULL,"mySQL");
			
	/* if client id is not empty update the database */
	
		if($talent_id <> ""){
				$update = DB::update('tams_talent_documents', array(

				'document_path'=> '/talent/uploads/documents/'.$talent_id.'_doc.pdf',
				'last_modified_by'	=> $last_modified_by,
				'last_modified_on'	=> $last_modified_on
			),
			"talent_id=%s", $talent_id
		);
		
		}
		echo 'Photo is uploaded and path select saved in database';	
			$handle1->clean();
		} else {
			echo 'error : ' . $handle1->error;
		} // close handle processed
		} // close handle uploaded
		} // close file exist
				
}
?>
<form  enctype="multipart/form-data" id="edit_talent_document_info" name="edit_talent_document_info" class="form-horizontal" method="post" action="process_talent_forms.php?talent_id="<?php echo $talent_id; ?>" >
<!-- Documents Information box -->       			
       		<div class="box box-info">
            <div class="box-header with-border">
              <h3 class="box-title"> 
              	Documents Information
              	 </h3>
              <div class="box-tools pull-right">
              		<button class="btn btn-box-tool" data-widget="collapse" data-toggle="tooltip" title="Open/Close This Box"><i class="fa fa-minus"></i></button>
              		<button class="btn btn-box-tool" data-widget="remove" data-toggle="tooltip" title="Remove"><i class="fa fa-times"></i></button>
              </div>
            </div>
            
            <div class="box-body bg-info">
            <div class="row">
				<div class="form-group"  >
						<label class="col-md-3 col-sm-3 control-label"> Document Name:</label>
						  <div class="col-md-9 col-sm-9">
							 <input class="form-control" type="text" required placeholder="Add Document Name " 
							 value="" name="document_name" id="document_name">							
						  </div>
					</div>

                    <div class="form-group"  >
						<label class="col-md-3 col-sm-3 control-label"> Document Description:</label>
						  <div class="col-md-9 col-sm-9">
							 <input class="form-control" type="text" required placeholder="Add Document Description " 
							 value="" name="document_description" id="document_description">							
						  </div>
					</div>
					 
				<div class="form-group">
						<label class="col-md-3 col-sm-3 control-label">
							Upload Document :
						</label>
						<div class="col-md-9 col-sm-9">
						<img src="<?php echo $photo1_url; ?>" alt="no file uploaded" />
		<!-- input-group image-preview [FROM HERE]-->
            <div class="input-group image-preview"><commit_msg>small change<commit_after><?php


// List of Documents
$sql    = "SELECT `document_type_id`,`document_description`, `document_path`, `document_status` FROM `tams_talent_documents` WHERE (`document_status` = 'active') AND ( tams_talent_documents.`document_type_id` NOT IN (SELECT document_type_id FROM tams_talent_documents WHERE talent_id=".$talent_id."))";
$document_types = DB::query($sql);

if(isset($_GET['talent_id']))
{
	$talent_id = $_GET['talent_id'];
}

$document_sql    = "SELECT
*
FROM
tams_talent_documents
WHERE talent_id = $talent_id";

$talent_document = DB::query($document_sql);
if(isset($_POST['save'])) {
 
$talent_id = $_POST['talent_id'];
$document_type_id = $_POST['document_type_id'];
$document_description = $_POST['document_description'];
$document_path = $_POST['document_path'];
$document_status = $_POST['document_status']; 
$last_modified_by = $_SESSION['user_id'];
$last_modified_on = getDateTime(NULL,"mySQL");

 // if client id is not empty update the database
 
	if($talent_id <> ""){
		$update = DB::update('tams_talent_documents', array(
			
			'talent_id' => $talent_id,
			'document_type_id' => $document_type_id,
			'document_description' => $document_description,
			'document_path' => $document_path,
			'document_status' => $document_status,
			'last_modified_by'	=> $last_modified_by,
			'last_modified_on'	=> $last_modified_on
			),
			"talent_id=%s", $talent_id
		);
	//check if the file is uploaded and process the file if file is uploaded	
	
	if(!file_exists($_FILES['talent_doc']['tmp_name']) || !is_uploaded_file($_FILES['talent_doc']['tmp_name'])) {
		echo '<h2> No file ploaded</h2>';
	}  else {
		echo '<h2> file was uploaded</h2>';
	}
	//if logo file is uploaded process the file with upload class
	
	$handle1 = new upload($_FILES['talent_doc']);
		if ($handle1->uploaded) {
			$handle1->file_new_name_body   = $talent_id.'_doc';
			$handle1->allowed = array('application/pdf','application/msword','application/vnd.ms-powerpoint', 'application/vnd.ms-excel','text/plain');
			$handle->file_new_name_ext = 'pdf';
			$handle1->file_overwrite = true;
			$handle1->process('..uploads/documents/');
		if ($handle1->processed) {
			
	// save uploaded file name and path in database table field logo_url
	
	
			$last_modified_by = $_SESSION['user_id'];
			$last_modified_on = getDateTime(NULL,"mySQL");
			
	/* if client id is not empty update the database */
	
		if($talent_id <> ""){
				$update = DB::update('tams_talent_documents', array(

				'document_path'=> '/talent/uploads/documents/'.$talent_id.'_doc.pdf',
				'last_modified_by'	=> $last_modified_by,
				'last_modified_on'	=> $last_modified_on
			),
			"talent_id=%s", $talent_id
		);
		
		}
		echo 'Photo is uploaded and path select saved in database';	
			$handle1->clean();
		} else {
			echo 'error : ' . $handle1->error;
		} // close handle processed
		} // close handle uploaded
		} // close file exist
				
}
?>
<form  enctype="multipart/form-data" id="edit_talent_document_info" name="edit_talent_document_info" class="form-horizontal" method="post" action="process_talent_forms.php?talent_id="<?php echo $talent_id; ?>" >
<!-- Documents Information box -->       			
       		<div class="box box-info">
            <div class="box-header with-border">
              <h3 class="box-title"> 
              	Documents Information
              	 </h3>
              <div class="box-tools pull-right">
              		<button class="btn btn-box-tool" data-widget="collapse" data-toggle="tooltip" title="Open/Close This Box"><i class="fa fa-minus"></i></button>
              		<button class="btn btn-box-tool" data-widget="remove" data-toggle="tooltip" title="Remove"><i class="fa fa-times"></i></button>
              </div>
            </div>
            
            <div class="box-body bg-info">
            <div class="row">
				<div class="form-group"  >
						<label class="col-md-3 col-sm-3 control-label"> Document Name:</label>
						  <div class="col-md-9 col-sm-9">
							 <input class="form-control" type="text" required placeholder="Add Document Name " 
							 value="" name="document_name" id="document_name">							
						  </div>
					</div>

                    <div class="form-group"  >
						<label class="col-md-3 col-sm-3 control-label"> Document Description:</label>
						  <div class="col-md-9 col-sm-9">
							 <input class="form-control" type="text" required placeholder="Add Document Description " 
							 value="" name="document_description" id="document_description">							
						  </div>
					</div>
					 
				<div class="form-group">
						<label class="col-md-3 col-sm-3 control-label">
							Upload Document :
						</label>
						<div class="col-md-9 col-sm-9">
						<img src="<?php echo $document_path; ?>" alt="no file uploaded" />
		<!-- input-group image-preview [FROM HERE]-->
            <div class="input-group image-preview">
{'fraction_non_alphanumeric': 0.1619631901840491, 'fraction_numerical': 0.005623721881390593, 'mean_word_length': 3.532437442075996, 'pattern_counts': {'":': 0, '<': 101, '<?xml version=': 0, '>': 139, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5625821', 'n_tokens_mistral': 3652, 'n_tokens_neox': 3153, 'n_words': 640}