HEX
Server: Apache
System: Linux xmf17.cloudnstools.com 5.14.0-611.49.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Apr 21 16:39:08 EDT 2026 x86_64
User: pricecom (1134)
PHP: 7.4.33
Disabled: exec,passthru,shell_exec,system
Upload Files
File: /home/pricecom/public_html/phonerepair/models.php
<?php 
	include('include/files.php');
		$module=6;
	include('include/user_rights.php');

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo $site_settings['title']; ?> - Admin Panel</title>
<link href="styles/style.css" rel="stylesheet" type="text/css" />
<script src="include/javascriptfunctions.js"></script>
<script src="ajaxscript.js"></script> 
</head>
<body>
     <table cellpadding="0" cellspacing="0" border="0" align="center">
    	<tr>
            <td>
            	<table cellpadding="0" cellspacing="0" border="0" width="918">
                	<?php include('include/header.php'); ?>
					<tr>
                    	<td>
                        	<table cellpadding="0" cellspacing="0" border="0">
                            	<tr>
                                    <td valign="top">
                                    	<table cellpadding="0" cellspacing="0" border="0">
                                        	<tr>
                                            	<td bgcolor="#FFFFFF" width="100%" height="" class="bor" valign="top">
                                                	<table cellpadding="4" cellspacing="0" border="0" width="918">
														
														
                                                        <tr>
                    	<td>
                        	<table cellpadding="0" cellspacing="0" align="center" width="100%">
                                <tr><td height="25"></td></tr>
                                
					<tr>
                    	<td width="30"></td>
                    	 
                        <td valign="top">
                        	<table cellpadding="0" cellspacing="0" align="center" width="850">
                                    <tr>
                                        <td colspan="" class="abouthd">Manage Auto Model</td>
                                      
                                        <td width="50"></td>
                                    </tr>
                                <tr><td height="10"></td></tr>
                                <tr>
                                	<Td valign="top" colspan="15">
                                    	<table cellpadding="0" cellspacing="0" border="0" width="100%">
                        	<tr>
                            	<td>
                                	<?php
									  ################################################################################   
									  ## +---------------------------------------------------------------------------+
									  ## | 1. Creating & Calling:                                                    | 
									  ## +---------------------------------------------------------------------------+
									  ##  *** define a relative (virtual) path to datagrid.class.php file
									  ##  *** (relatively to the current file)
									  ##  *** RELATIVE PATH ONLY ***
									  
									    $unique_prefix = "f_";     /* prevent overlays - must be started with a letter */
										$postback   = (isset($_REQUEST['postback']) && $_REQUEST['postback'] != "") ? strip_tags($_REQUEST['postback']) : "ajax";
   										$mode       = isset($_REQUEST[$unique_prefix.'mode']) ? $_REQUEST[$unique_prefix.'mode'] : "";    
										$mid = isset($_REQUEST["riymid"]) ? (int)$_REQUEST["riymid"] : "";

										define("DATAGRID_DIR", "");                     /* Ex.: "datagrid/" */ 
										require_once(DATAGRID_DIR.'datagrid.class.php');
									
										// includes database connection parameters
										include_once('install/config.inc.php');
										
										ob_start();      
									  ##  *** set needed options
										$debug_mode = false;
										$messaging = true;
										$unique_prefix = "f_";  
										$dgrid = new DataGrid($debug_mode, $messaging, $unique_prefix);
										
										## *** defines postback method for DataGrid: AJAX, POST(default) or GET
										$postback_method = 'AJAX';
										$dgrid->SetPostBackMethod($postback_method);
										
										$dg_encoding = "utf8";
										$dg_collation = "utf8_general_ci";
										$dgrid->setEncoding($dg_encoding, $dg_collation);

										## *** make sure your tmp/cache/ dir has 755 (write) permissions
										## *** parameters: 1st - allow caching, 2nd - cache lifetime in minutes
										//$dgrid->SetCachingParameters(true, 5);
										## *** delete all caching pages
										/// $dgrid->DeleteCache();
									
										## *** datagrid layouts: '0' - tabular(horizontal) - default, '1' - columnar(vertical), '2' - customized
										## *** use 'view'=>'0' and "edit"=>"0" only if you work on the same tables
										## *** filter layouts: '0' - tabular(horizontal) - default, '1' - columnar(vertical), '2' - advanced(inline)
										//$layouts = array('view'=>2, 'edit'=>1, 'filter'=>1); 
										//$dgrid->SetLayouts($layouts);
									
									
										## *** set modes for operations ('type' = 'link|button|image'),
										## *** set CSS class for datagrid
										## *** 'default|blue|gray|green|pink|empty|x-blue|x-gray|x-green' or your own css style
										$css_class = $css_co; 
										$dgrid->SetCssClass($css_class);
										
											# *** set modes for operations ('type' = 'link|button|image'),
										## *** 'view' - view mode | 'edit' - add/edit/details modes
										## *** ('byFieldValue' - make the field as a link to edit mode page)
										## *** 'show_button' - specifies to show mode button or not
										
									$modes = array(
										  'add' => array('view'=>$right_add, 'edit'=>false, 'type'=>'link', 'show_button'=>true, 'show_add_button'=>'inside|outside'),
										  'edit' => array('view'=>$right_edit, 'edit'=>true, 'type'=>'link', 'show_button'=>true, 'byFieldValue'=>''),
										  'details' => array('view'=>$right_view, 'edit'=>false, 'type'=>'link', 'show_button'=>true),
										 
										  'delete' => array('view'=>$right_del, 'edit'=>false, 'type'=>'image', 'show_button'=>true)
										);
										$dgrid->SetModes($modes);
										
									
									  ##  *** set data source with needed options
									  ##  *** put a primary key on the first place 
										$sql=" SELECT "  
										." auto_models.moid, "
										." auto_models.mid, "
										." auto_makes.mid, "
										." auto_models.eng_title as  modelTitle, "
										." auto_makes.eng_title as makeTitle, "
										." auto_models.edit_date "
										."FROM auto_makes, auto_models  where auto_makes.mid =  auto_models.mid 								 ";     
										
										$default_order = array("moid"=>"DESC");
										$dgrid->DataSource("PEAR", "mysql", $DB_HOST, $DB_NAME, $DB_USER, $DB_PASS, $sql, $default_order);             
									
										$dg_caption = '';
										$dgrid->SetCaption($dg_caption);
										
										## *** set filtering option: true or false(default)
										## *** tips: use ',' (comma) if you want to make search by some words, for ex.: hello, bye, hi
										$filtering_option = false;
										$show_search_type = true;
										$dgrid->AllowFiltering($filtering_option, $show_search_type);
										$filtering_fields = array(
     "Enter Category Title"=>array("type"=>"textbox",      "table"=>"category", "field"=>"title", "filter_condition"=>"", "show_operator"=>"false", "default_operator"=>"%like%", "case_sensitive"=>"false", "comparison_type"=>"string|numeric|binary", "width"=>"", "on_js_event"=>"", "default"=>""),
	 									);
	 
	 									$dgrid->SetFieldsFiltering($filtering_fields);
										
										$fill_yes_no_array = array("1"=>"Yes", "0"=>"No");

									  ## +---------------------------------------------------------------------------+
									  ## | 6. View Mode Settings:                                                    | 
									  ## +---------------------------------------------------------------------------+
									  ##  *** set columns in view mode
										$dgrid->SetAutoColumnsInViewMode(true);  
										
										 $vm_table_properties = array("width"=>"90%");
    									 $dgrid->SetViewModeTableProperties($vm_table_properties);  
										 ##  *** set columns in view mode
										 
										  $vm_colimns = array(

	 "makeTitle"     => array("header"=>"Make Title", "align"=>"center", "width"=>"", "wrap"=>"nowrap", "text_length"=>"-1", "tooltip"=>"false", "tooltip_type"=>"floating|simple", "case"=>"normal", "summarize"=>"false", "sort_type"=>"string", "sort_by"=>"", "visible"=>"true", "on_js_event"=>""),
	 
	  "modelTitle"     => array("header"=>"Model Title", "align"=>"center", "width"=>"", "wrap"=>"nowrap", "text_length"=>"-1", "tooltip"=>"false", "tooltip_type"=>"floating|simple", "case"=>"normal", "summarize"=>"false", "sort_type"=>"string", "sort_by"=>"", "visible"=>"true", "on_js_event"=>""),

	 
	 														);
	  
	 								  $dgrid->SetColumnsInViewMode($vm_colimns);    
										 
										
										

## *** set foreign keys for add/edit/details modes (if there are linked tables)
										## *** Ex.: 'condition'=>'Table_1.FieldName > "a" AND Table_1.FieldName < "c"'
										## *** Ex.: 'on_js_event'=>'onclick="alert(\'Yes!!!\');"'
										$foreign_keys = array(
															  
    "mid" =>array("table"=>"auto_makes", "field_key"=>"mid", "field_name"=>"concat(eng_title)", "view_type"=>"dropdownlist", "elements_alignment"=>"horizontal|vertical", "condition"=>"cid=1", "order_by_field"=>"eng_title", "order_type"=>"ASC", "show_count"=>"true"),
   

										);
										$dgrid->SetForeignKeysEdit($foreign_keys);									
										

			
									  ## +---------------------------------------------------------------------------+
									  ## | 7. Add/Edit/Details Mode settings:                                        | 
									  ## +---------------------------------------------------------------------------+
									  ##  ***  set settings for edit/details mode
									    ##  *** set add/edit mode table properties
										$em_table_properties = array("width"=>"60%");
										$dgrid->SetEditModeTableProperties($em_table_properties);
									  ##  *** set details mode table properties
										$dm_table_properties = array("width"=>"60%");
										$dgrid->SetDetailsModeTableProperties($dm_table_properties);
										
										$dgrid->firstFieldFocusAllowed = true;
									  
										$table_name = "auto_models";
										$primary_key = "moid";
										$condition = "";
										$dgrid->SetTableEdit($table_name, $primary_key, $condition);
										$dgrid->SetAutoColumnsInEditMode(true);
										
										$em_columns = array(
			
									 	
										"edit_date" =>array("header"=>"", "type"=>"hidden", "req_type"=>"st", "default"=>date("Y-m-d H:i:s"), "value"=>date("Y-m-d H:i:s"), "unique"=>"false", "visible"=>"false"),
										
										"mid" =>array("header"=>"Make Title", "type"=>"foreign_key", "req_type"=>"ri", "width"=>"325px", "title"=>"", "readonly"=>"false", "maxlength"=>"-1", "default"=>"", "unique"=>"false", "unique_condition"=>"", "visible"=>"true", "on_js_event"=>""),
										

										"eng_title" =>array("header"=>"Title.", "type"=>"textbox", "aligh"=>"left", "req_type"=>"rt", "width"=>"325px", "title"=>"", "readonly"=>"false", "maxlength"=>"-1", "default"=>"", "unique"=>"false", "unique_condition"=>"", "visible"=>"true", "on_js_event"=>""),


										);
										
										
										 $dgrid->SetColumnsInEditMode($em_columns);
										 
										 ## *** set printing option: true(default) or false 
										$printing_option = false;
										$dgrid->AllowPrinting($printing_option); 
										
										## *** initialize the session with session_start();
										## *** default exporting directory (requires write permissions): tmp/export/
										$exporting_option = true;
										$export_all = false;
										$dgrid->AllowExporting($exporting_option, $export_all);
										$exporting_types = array(
											'csv'=>'false', 'xls'=>'false', 'pdf'=>'false', 'xml'=>'false', 'doc'=>'false'
										);
										$dgrid->AllowExportingTypes($exporting_types);

									  ## +---------------------------------------------------------------------------+
									  ## | 8. Bind the DataGrid:                                                     | 
									  ## +---------------------------------------------------------------------------+
									  ##  *** set debug mode & messaging options
										$dgrid->Bind();        
										ob_end_flush();
										
									?>
                                </td>
                            </tr>
                        </table>
                                    </Td>
                                </tr>
                            </table>
                        </td>	
                       
                    </tr>
                    <tr><td height="25"></td></tr>
                            </table>
                        </td>	
                    </tr>
                                                    </table>
                                                </td>
												<td width="15"></td>
                                            </tr>
                                        </table>
                                    </td>
                                   
                                    
                                </tr>
                            </table>
                        </td>
                    </tr>                    
                    <tr><td height="22"></td></tr>
                    
                     <td><?php include('include/footer.php'); ?></td>
                    
                    <tr><td height="20"></td></tr>
                    
                    
                </table>
            </td>
         </tr>
    </table>
</body>
</html>