function mrr_display_quick_links_edit()
{
	$tab="";
	
	$cur_user=$_SESSION['selected_user_id'];
	$cur_cust=$_SESSION['selected_merchant_id'];
	$cur_store=$_SESSION['selected_store_id'];
	
	if($cur_user==0)		$cur_user=$_SESSION['user_id'];
	
	$merch_adder="";
	if($cur_cust > 0)
	{
		$merch_adder="
			 and (
			 	quick_links.merchant_id=0
			 	or
			 	quick_links.merchant_id='".sql_friendly($cur_cust)."'
			 	or
			 	LOCATE(',".sql_friendly($cur_cust).",',merchant_id_list) >0
			 )
		";	
	}
	
	$store_adder="";
	if($cur_cust > 0)
	{
		$store_adder="
			 and (
			 	quick_links.store_id=0
			 	or
			 	quick_links.store_id='".sql_friendly($cur_store)."'
			 	or
			 	LOCATE(',".sql_friendly($cur_store).",',store_id_list) >0
			 )
		";	
	}	
	
	$tab.="<div id='cce_quick_links_editor'><div id='cce_quick_links_editor_pad' style='display:none;'>";
	
	//new quick link form...
	
	//get_merchant_select_box($field,$pre=0,$cd=0,$prompt="",$classy="")
     $selbox1=get_merchant_select_box('quick_link_0_cust',$cur_cust,0,"ALL"," class='all_quick_link_input'");          
     
     //get_store_select_box($field,$pre=0,$merchant=0,$cd=0,$prompt="",$classy="")
     $selbox2=get_store_select_box('quick_link_0_store',$cur_store,$cur_cust,0,"ALL"," class='all_quick_link_input'");    
	
	$tab.="<div id='quick_links_0_block' class='all_quick_link_edits'>";
	$tab.=	"<div>
				&nbsp;
				&nbsp;
				&nbsp;				
				<span class='mrr_quick_links_spacer' style='color:#e19918;'>NEW</span>&nbsp;
			</div>";		
	$tab.=	"<span>Link Name</span> <input type='text' name='quick_link_0_name' id='quick_link_0_name' value=\"\" class='all_quick_link_input'>";
	$tab.=	"<span>Web Address</span> <input type='text' name='quick_link_0_url' id='quick_link_0_url' value=\"\" class='all_quick_link_input'><br>";
	$tab.=	"<span>Customer</span> ".$selbox1."<br>";	
	$tab.=	"<span>Store</span> ".$selbox2."<br>";		
	$tab.=	"<span>&nbsp;</span> <label>Make Private <input type='checkbox' name='quick_link_0_private' id='quick_link_0_private' value=\"1\"></label>";
	$tab.="</div>";
	
	
	$sql="
		select quick_links.*
		from quick_links		
		where quick_links.deleted=0
			".$merch_adder."
			".$store_adder."
			and (
				quick_links.private_link=0
				or
				(quick_links.private_link=1 && quick_links.user_id='".sql_friendly($cur_user)."')
			)
		order by quick_links.position_id asc,
			quick_links.row_num asc, 
			quick_links.col_num asc, 
			quick_links.link_name asc, 
			quick_links.id asc
		";
	$data=simple_query($sql);	
	while($row = mysqli_fetch_array($data))
	{		
		$allow_removal="";
		if($row['user_id']==$_SESSION['user_id'] || $row['access_level'] <= $_SESSION['access_level'])
		{
			$allow_removal="<i class='fa fa-trash' style='color:#e19918; font-size:14px;' title='Click to remove this merchant' onClick='edit_quick_links(".$row['id'].",3);'></i>";	
		}
		
		$selbox1=get_merchant_select_box('quick_link_'.$row['id'].'_cust',$cur_cust,0,"ALL"," class='all_quick_link_input' onChange='edit_quick_links(".$row['id'].",6);'");          
          $selbox2=get_store_select_box('quick_link_'.$row['id'].'_store',$cur_store,$cur_cust,0,"ALL"," class='all_quick_link_input' onChange='edit_quick_links(".$row['id'].",7);'");    
		
		$tab.="<div id='quick_links_".$row['id']."_block' class='all_quick_link_edits'>";
		$tab.=	"<div>
					<img src='common/images/prev_orange.png' alt='' border='0' style='cursor:pointer;height:16px' onClick='edit_quick_links(".$row['id'].",1);'>
					".$row['position_id']." 
					<img src='common/images/next_orange.png' alt='' border='0' style='cursor:pointer;;height:16px' onClick='edit_quick_links(".$row['id'].",2);'>
					<span class='mrr_quick_links_spacer'>".$allow_removal."</span>&nbsp;
				</div>";		
		$tab.=	"<span>Link Name</span> <input type='text' name='quick_link_".$row['id']."_name' id='quick_link_".$row['id']."_name' value=\"".$row['link_name']."\" class='all_quick_link_input' onBlur='edit_quick_links(".$row['id'].",4);'>";
		$tab.=	"<span>Web Address</span> <input type='text' name='quick_link_".$row['id']."_url' id='quick_link_".$row['id']."_url' value=\"".$row['link_url']."\" class='all_quick_link_input' onBlur='edit_quick_links(".$row['id'].",5);'><br>";
		$tab.=	"<span>Customer</span> ".$selbox1."<br>";		//".$row['merchant_id'].": ".$row['merchant_id_list']."
		$tab.=	"<span>Store</span> ".$selbox2."<br>";			//".$row['store_id'].": ".$row['store_id_list']."
		$tab.=	"<span>&nbsp;</span> <label>Make Private <input type='checkbox' name='quick_link_".$row['id']."_private' id='quick_link_".$row['id']."_private' value=\"1\"".($row['private_link'] > 0 ? " checked" : "")." onClick='edit_quick_links(".$row['id'].",8);'></label>";
		$tab.="</div>";
		
		//<input type='text' name='quick_link_".$row['id']."_cust' id='quick_link_".$row['id']."_cust' value=\"".$row['merchant_id'].": ".$row['merchant_id_list']."\">
		//<input type='text' name='quick_link_".$row['id']."_store' id='quick_link_".$row['id']."_store' value=\"".$row['store_id'].": ".$row['store_id_list']."\">
	}     
	$tab.="</div></div>";
	return $tab;
}
示例#2
0
							  			//echo "<input type='button' name='create-new-merchant' id='create-new-merchant' value='Add' onClick='debread_crumb_trail(0); edit_merchant(0,1);' class='btn btn-default add_new_btn'>";	
							  			
							  			echo "<input type='button' name='archived-in-merchant' id='archived-in-merchant' value='View Archived' onClick='view_merchant_archived();' class='btn btn-default add_new_btn'>";	
							  			
							  			echo "</div>";	
							  		}
							  		?>	
							  		<div id='merchant_edit_button'></div>
							  	</td>
							</tr>
						  </tbody>
					</table>
										
					<?         
                   		//get_merchant_select_box($field,$pre=0,$cd=0,$prompt="",$classy="")
                   		$selbox0=get_merchant_select_box('ms_parent_id',0,0,"","");
                   		//$selbox0="<input type='hidden' name='ms_parent_id' id='ms_parent_id' value='0'> 0";
                   		
                   		
                         //get_template_select_box($field,$pre=0,$store=0, $merchant=0,$cd=0,$prompt="",$classy="")
                         $selbox1=get_template_select_box('ms_template_id',0,0,0,0,"","");
                         
                         //get_state_select_box($field,$pre="",$cd=0,$prompt="",$classy="")
                         $selbox2=get_state_select_box('ms_state',"",0,"","");
                         
                         //get_user_select_box($field,$pre=0,$cd=0,$prompt="",$classy="")
                         $selbox3=get_user_select_box('ms_co_user_id',0,0,"Select Compliance Officer","");
                         $selbox4=get_user_select_box('ms_grp_user_id',0,0,"Select Group Manager","");
                         ?>
                         <!--Form for New Customers -->
                         <div id='dialog_merchant_form' title='Add/Edit Customer' style='display:none;'>
示例#3
0
	function load_dynamic_user_customer_select()
	{
		$field_name=trim($_POST['field_name']);
		$pre=$_POST['id'];
		$cd=$_POST['cd'];
		$prompt=trim($_POST['prompt']);
		$classy=$_POST['class_text'];
		
		if($_SESSION['selected_merchant_id'] > 0)		$pre=$_SESSION['selected_merchant_id'];
				
		if($_POST['id'] < 0)		$pre=0;
				
		$tab=get_merchant_select_box($field_name,$pre,$cd,$prompt,$classy);
		
		display_xml_response("<rslt>1</rslt><pre>$pre</pre><mrrTab><![CDATA[".$tab."]]></mrrTab>");		
	}