|
Trying to create a multi level tree inside a drop down list in Angular Js.
does anybody has similar implementation where tree can be collapsed and expanded.
modified 7-Jul-17 16:39pm.
|
|
|
|
|
Yes.
What's your question? Where are you stuck?
"There are three kinds of lies: lies, damned lies and statistics."
- Benjamin Disraeli
|
|
|
|
|
|
Hi,
I have the following SQL:
SELECT customers_address.customer_address_id, address_category.address_category_name, customers_address.address_name,
address_details.address_details_id,
address_details.address_details_text
FROM customers_address
JOIN address_category ON address_category.address_category_id = customers_address.address_category_id
LEFT JOIN address_details ON address_details.customer_address_id = customers_address.customer_address_id
WHERE customer_id = param_customer;
I want to show this output in JSON:
CustomerAddress:
{
customer_address_id
address_category_name
address_name
}
Details:
{
address_details_id
address_details_text
}
my current php is:
$mysql_query = $mysql_connection->prepare('CALL sp_populate_customer_addresses(:param_customer)');
$mysql_query->bindParam(':param_customer', $customer_id, PDO::PARAM_STR);
$mysql_query->execute();
if ($mysql_query->rowCount() <= 0) { echo "false"; }
else
{
$jsonData = array();
while($mysql_row = $mysql_query->fetch())
{
$jsonData[] = $mysql_row;
}
echo json_encode($jsonData);
}
Thanks,
Jassim
Technology News @ www.JassimRahma.com
|
|
|
|
|
It is quite simple. You should change :
$jsonData[] = $mysql_row;
to something like this
$jsonData[$i]['customer_address_id'] = $mysql_row['customer_address_id];
itd ..
$jsonData[$i]['Details']['address_details_id'] = $mysql_row['address_details_id];
|
|
|
|
|
What makes more sense?
1) Versioning in the uri itself for e.g. /foo/bar/v2/1
2) Versioning in the header Accept: application/vnd.bar.v2 + json
Any experiences or other good approaches?
|
|
|
|
|
|
5. I've been threw most of these articles earlier through .
What I'm trying to find are practical experiences.
|
|
|
|
|
I am aware of the debate over security issues with opening a software program using html but I have a special need to do so for use in a fillable PDF for in-house use only. I followed the code on an earlier post by one of your members for doing this with Notepad.exe, but the same code will not work with Snippingtool.exe. Another possible solution would be code for doing the same in HTA or in Javascript but I am a novice in such and could use some help.
Thanks!
|
|
|
|
|
Member 13263586 wrote: but the same code will not work with Snippingtool.exe. What was the code?
There are two kinds of people in the world: those who can extrapolate from incomplete data.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
The original HTMl code from the post on this website for the Notepad (which does work, though replacing the snippingtool.exe does not) is:
<html>
<head>
<title>Application Executer</title>
<HTA:APPLICATION ID="oMyApp"
APPLICATIONNAME="Application Executer"
BORDER="no"
CAPTION="no"
SHOWINTASKBAR="yes"
SINGLEINSTANCE="yes"
SYSMENU="yes"
SCROLL="no"
WINDOWSTATE="normal">
<script type="text/javascript" language="javascript">
function RunFile() {
WshShell = new ActiveXObject("WScript.Shell");
WshShell.Run("c:/windows/system32/notepad.exe", 1, false);
}
</script>
</head>
<body>
<input type="button" value="Notepad" onclick="RunFile();"/>
</body>
</html>
|
|
|
|
|
This will only work in IE and only if the user enables unsafe active x. But even doing that, I also could not get SnippingTool to work. If you google WshShell.Run SnippingTool.exe you'll see other examples of people doing it through VBA or VBS so something may help.
There are two kinds of people in the world: those who can extrapolate from incomplete data.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Thanks RyanDev for the Google search tip. It did not take long to find the problem and correct the code so it works as .hta at least. The issue was with Windows 10 redirecting 64bit snippingtool to Windows\SysWOW64 folder. The fix was simply changing the path name in the code to Windows\sysnative and the code now works (See below).
<html>
<head>
<title>Application Executer</title>
<HTA:APPLICATION ID="oMyApp"
APPLICATIONNAME="Application Executer"
BORDER="no"
CAPTION="no"
SHOWINTASKBAR="yes"
SINGLEINSTANCE="yes"
SYSMENU="yes"
SCROLL="no"
WINDOWSTATE="normal">
<script type="text/javascript" language="javascript">
function RunFile() {
WshShell = new ActiveXObject("WScript.Shell");
WshShell.Run("c:/windows/sysnative/snippingtool.exe", 1, false);
}
</script>
</head>
<body>
<input type="button" value="SnippingTool" onclick="RunFile();"/>
</body>
</html>
|
|
|
|
|
How weird. The original path you had worked if you put it into the Run command of the Start Menu so that's quite strange.
There are two kinds of people in the world: those who can extrapolate from incomplete data.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
The "run" dialog is a 64-bit application, so it's not subject to the whims of the file system redirector:
In most cases, whenever a 32-bit application attempts to access %windir%\System32, the access is redirected to %windir%\SysWOW64.
If the access causes the system to display the UAC prompt, redirection does not occur. Instead, the 64-bit version of the requested file is launched.
32-bit applications can access the native system directory by substituting %windir%\Sysnative for %windir%\System32.
Note that 64-bit applications cannot use the Sysnative alias as it is a virtual directory not a real one. Yeah, that's not even slightly complicated, Microsoft!
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Two type provide adding a table in nopcommerce. One for Nop.Admin and second for Nop.web(Nop.admin used admin side and if we are an add table in user side then used Nop.web)
so I want to add a new table in Nop.web interface (I mean to say we want integration in nopCommerce new tables in the User interface. Like create form "CustomOrder" in user side. )
Please anyone help.
|
|
|
|
|
|
Hello,
I want to switch between UI router tabs with same state and different parameters.
I have created array for tabs with same route and different parameters, but when we switch between tabs only 1st time we are able to fetch parameters, when next tab is clicked we can't fetch parameters and URL is also not changing.
Can anyone help me out of this.
Thanks for your time.
.state("child.tab", {
url: "/tab/{TableId:int}",
cache: false,
reloadOnSearch: true,
params: { TableId: null },
views: {
'filters@child.tab': {
templateProvider: ['$stateParams', '$templateFactory', function ($stateParams, $templateFactory) {
return $templateFactory.fromUrl('templates/user/abc.html');
}]
},
'list@child.tab': {
templateProvider: ['$stateParams', '$templateFactory', function ($stateParams, $templateFactory) {
return $templateFactory.fromUrl('templates/user/xyz.html');
}]
},
'form@child.tab': {
templateProvider: ['$stateParams', '$templateFactory', function ($stateParams, $templateFactory) {
return $templateFactory.fromUrl('templates/user/pqr.html');
}]
}
}
})
|
|
|
|
|
|
|
did you try use reddit for it?
|
|
|
|
|
Yes i have posted links on reddit. Thanks for reply
|
|
|
|
|
Here is my registerController
<?php
namespace App\Http\Controllers\Auth;
use App\User;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\Validator;
use Illuminate\Foundation\Auth\RegistersUsers;
class RegisterController extends Controller
{
/*
|--------------------------------------------------------------------------
| Register Controller
|--------------------------------------------------------------------------
|
| This controller handles the registration of new users as well as their
| validation and creation. By default this controller uses a trait to
| provide this functionality without requiring any additional code.
|
*/
use RegistersUsers;
/**
* Where to redirect users after registration.
*
* <a href="https://www.codeproject.com/Members/var">@var</a> string
*/
protected $redirectTo = '/home';
/**
* Create a new controller instance.
*
* <a href="https://www.codeproject.com/Members/return">@return</a> void
*/
public function __construct()
{
$this->middleware('guest');
}
/**
* Get a validator for an incoming registration request.
*
* <a href="https://www.codeproject.com/Members/param">@param</a> array $data
* <a href="https://www.codeproject.com/Members/return">@return</a> \Illuminate\Contracts\Validation\Validator
*/
protected function validator(array $data)
{
return Validator::make($data, [
'fname' => 'required|string|max:255',
'lname' => 'required|string|max:255',
'email' => 'required|string|email|max:255|unique:users',
'password' => 'required|string|min:6|confirmed',
'phone' => 'required|string|max:255',
'address' => 'required|string|max:255',
'user_type' => 'required|string|max:20',
]);
}
/**
* Create a new user instance after a valid registration.
*
* <a href="https://www.codeproject.com/Members/param">@param</a> array $data
* <a href="https://www.codeproject.com/Members/return">@return</a> User
*/
protected function create(array $data)
{
return User::create([
'fname' => $data['fname'],
'lname' => $data['lname'],
'email' => $data['email'],
'password' => bcrypt($data['password']),
'phone' => $data['phone'],
'address' => $data['address'],
'user_type' => $data['user_type'],
]);
}
}
|
|
|
|
|
have a scenario where my apigateway is going to be made secure, which is the entry to access all micro services.
Right now we use these APIs for web based apps by making server side calls(using C#).
we are going to make the APIs public, where mobile apps, other web apps or other services can request them to consume the data.
Is there a secure way to perform API request from client side script like javascript?
As far as i have come across, it is quite impossible.
Expecting some good suggestions. Any further discussion is warmly welcomed.
What I have come across:
1.I have read across few articles mentioning use of proxy servers in between client and API server.
2.Hashing combination of informations and passing in headers.
3.Storing information in cookies.
|
|
|
|
|
I have a Rows Per Page selector. It's two labels with a Select element between them. When I applied a style, the elements now show up vertically:
See here
Here's my HTML
<div id="headerLeft" style="position: relative; width:50%; float:left">
<pre>
<label>Show</label>
<div class="select-style">
<select id="rowsperpage" name="rowsperpage" onchange="updateRowsPerPage(this.value)">
<option value="10">10</option>
<option value="25">25</option>
<option value="50">50</option>
</select>
</div>
<label>rows</label>
and my CSS
.select-style {
border: 1px solid #ccc;
width: 65px;
border-radius: 3px;
overflow: hidden;
background: #fafafa url("img/icon-select.png") no-repeat 90% 50%;
}
.select-style select {
padding: 5px 8px;
width: 130%;
border: none;
box-shadow: none;
background: transparent;
background-image: none;
-webkit-appearance: none;
}
.select-style select:focus {
outline: none;
}
How do I get these elements to align horizontally?
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.
|
|
|
|