Commit f5c50c48 by Ashish Pal

form and account order maintained

parent 3231ff52
<?php defined( 'ABSPATH' ) or die( 'Direct access is not permitted' );?> <?php defined( 'ABSPATH' ) or die( 'Direct access is not permitted' );?>
<h1 class="wp-heading-inline">Add Forms</h1> <h1 class="wp-heading-inline">Add Custody Forms</h1>
<table class="form-table"> <table class="form-table">
<form method='post' action='' name='myform' enctype='multipart/form-data'> <form method='post' action='' name='myform' enctype='multipart/form-data'>
<tr class="form-field term-name-wrap"> <tr class="form-field term-name-wrap">
...@@ -49,9 +49,14 @@ ...@@ -49,9 +49,14 @@
<td><input type="text" name="image_url" id="image_url" value="" required></a> <td><input type="text" name="image_url" id="image_url" value="" required></a>
</td> </td>
</tr> </tr>
<th scope="row"><label for="name">Ordering</label></th> <th scope="row"><label for="name">Type of Form Ordering</label></th>
<td> <td>
<input name="ordering" id="ordering" type="number" max="100" min="0" size="10" value="<?php echo $ordering?>" required> <input name="form_ordering" id="form_ordering" type="number" max="100" min="0" size="10" value="<?php echo $form_ordering?>" required>
</td>
</tr>
<th scope="row"><label for="name">Type of Account Ordering</label></th>
<td>
<input name="account_ordering" id="account_ordering" type="number" max="100" min="0" size="10" value="<?php echo $account_ordering?>" required>
</td> </td>
</tr> </tr>
<tr class="form-field term-name-wrap"> <tr class="form-field term-name-wrap">
......
...@@ -26,11 +26,12 @@ $table_name = $wpdb->prefix."custody_icici_forms"; ...@@ -26,11 +26,12 @@ $table_name = $wpdb->prefix."custody_icici_forms";
<tr> <tr>
<th width="5%">Id</th> <th width="5%">Id</th>
<th width="20%">Type of form</th> <th width="20%">Type of form</th>
<th width="10%">Form Order</th>
<th width="20%">Type of Account</th> <th width="20%">Type of Account</th>
<th width="20%">User URl</th> <th width="10%">Account Order</th>
<th width="20%">Url</th> <th width="15%">User URl</th>
<th width="15%">Url</th>
<th width="5%">Status</th> <th width="5%">Status</th>
<th width="5%">Ordering</th>
<th width="8%">Actions</th> <th width="8%">Actions</th>
</tr> </tr>
</thead> </thead>
...@@ -74,11 +75,12 @@ $table_name = $wpdb->prefix."custody_icici_forms"; ...@@ -74,11 +75,12 @@ $table_name = $wpdb->prefix."custody_icici_forms";
<tr> <tr>
<td><?php echo $print->id?></td> <td><?php echo $print->id?></td>
<td><?php echo $print->type_of_form?></td> <td><?php echo $print->type_of_form?></td>
<td><?php echo $print->form_ordering?></td>
<td><?php echo $print->type_of_account?></td> <td><?php echo $print->type_of_account?></td>
<td><?php echo $print->account_ordering?></td>
<td><a href="<?php echo $print->slug?>">User Url</a></td> <td><a href="<?php echo $print->slug?>">User Url</a></td>
<td><a href="<?php echo $print->download_file_name?>">Check File</a></td> <td><a href="<?php echo $print->download_file_name?>">Check File</a></td>
<td><?php echo $status?></td> <td><?php echo $status?></td>
<td><?php echo $print->ordering?></td>
<td> <td>
<span class="edit"><a href="admin.php?page=custodylist&action=update&upt=<?php echo $print->id?>" aria-label="Edit">Edit</a>|</span> |<span class="view"><a href="admin.php?page=custodylist&action=view&upt=<?php echo $print->id?>" aria-label="view">View</a>|</span> | </span><span class="<?php echo $class?>"><a href="admin.php?page=custodylist&action=status&status=<?php echo $status_val?>&upt=<?php echo $print->id?>" class="delete-tag aria-button-if-js" aria-label="Delete “blog”" role="button"><?php echo $status?></a></td> <span class="edit"><a href="admin.php?page=custodylist&action=update&upt=<?php echo $print->id?>" aria-label="Edit">Edit</a>|</span> |<span class="view"><a href="admin.php?page=custodylist&action=view&upt=<?php echo $print->id?>" aria-label="view">View</a>|</span> | </span><span class="<?php echo $class?>"><a href="admin.php?page=custodylist&action=status&status=<?php echo $status_val?>&upt=<?php echo $print->id?>" class="delete-tag aria-button-if-js" aria-label="Delete “blog”" role="button"><?php echo $status?></a></td>
</tr> </tr>
......
...@@ -2,7 +2,8 @@ ...@@ -2,7 +2,8 @@
$type_of_account = trim($_POST['type_of_account']); $type_of_account = trim($_POST['type_of_account']);
$type_of_form = trim($_POST['type_of_form']); $type_of_form = trim($_POST['type_of_form']);
$slug = trim($_POST['slug']); $slug = trim($_POST['slug']);
$ordering = trim($_POST['ordering']); $form_ordering = trim($_POST['form_ordering']);
$account_ordering = trim($_POST['account_ordering']);
$image_url = trim($_POST['image_url']); $image_url = trim($_POST['image_url']);
if($type_of_form=='Other'){ if($type_of_form=='Other'){
$type_of_form = trim($_POST['type_of_form_other']); $type_of_form = trim($_POST['type_of_form_other']);
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
</td> </td>
</tr> </tr>
<tr class="form-field term-name-wrap"> <tr class="form-field term-name-wrap">
<th scope="row"><label for="name">Enter the Type of Account Value</label></th> <th scope="row"><label for="name">Enter Type of Account For Rename</label></th>
<td> <td>
<input name="type_of_account_other" type="text" value="" size="40" placeholder="Please enter other value" required> <input name="type_of_account_other" type="text" value="" size="40" placeholder="Please enter other value" required>
</td> </td>
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
</td> </td>
</tr> </tr>
<tr class="form-field term-name-wrap"> <tr class="form-field term-name-wrap">
<th scope="row"><label for="name">Enter the Type of Form Value</label></th> <th scope="row"><label for="name">Enter Type of Form for Rename</label></th>
<td> <td>
<input name="type_of_form_other" id="type_of_form_other" type="text" value="" size="40" placeholder="Please enter other value" required> <input name="type_of_form_other" id="type_of_form_other" type="text" value="" size="40" placeholder="Please enter other value" required>
</td> </td>
......
...@@ -13,7 +13,7 @@ if(isset($_POST['but_submit']) && $_POST['but_submit'] == 'Submit'){ ...@@ -13,7 +13,7 @@ if(isset($_POST['but_submit']) && $_POST['but_submit'] == 'Submit'){
}else{ }else{
include_once('includes/post_variable.php'); include_once('includes/post_variable.php');
$date_time = date('Y-m-d H:i:s'); $date_time = date('Y-m-d H:i:s');
$data ="INSERT INTO $table_name (type_of_account,type_of_form,slug,download_file_name,created_on,ordering) VALUES('$type_of_account','$type_of_form','$slug','$image_url','$date_time','$ordering')"; $data ="INSERT INTO $table_name (type_of_account,type_of_form,slug,download_file_name,created_on,account_ordering,form_ordering) VALUES('$type_of_account','$type_of_form','$slug','$image_url','$date_time','$account_ordering','$form_ordering')";
$wpdb->query($data); $wpdb->query($data);
echo "<script>location.replace('admin.php?page=custodylist&msg=1');</script>"; echo "<script>location.replace('admin.php?page=custodylist&msg=1');</script>";
exit(); exit();
...@@ -62,7 +62,7 @@ if(isset($_POST['but_submit']) && $_POST['but_submit'] == 'Update' && isset($_PO ...@@ -62,7 +62,7 @@ if(isset($_POST['but_submit']) && $_POST['but_submit'] == 'Update' && isset($_PO
}else{ }else{
$id = $_POST['id']; $id = $_POST['id'];
include_once('includes/post_variable.php'); include_once('includes/post_variable.php');
$update_query = "update $table_name set type_of_account ='$type_of_account',type_of_form ='$type_of_form',slug= '$slug',download_file_name ='$image_url',ordering = '$ordering' WHERE id=".$id; $update_query = "update $table_name set type_of_account ='$type_of_account',type_of_form ='$type_of_form',slug= '$slug',download_file_name ='$image_url',account_ordering = '$account_ordering',form_ordering = '$form_ordering' WHERE id=".$id;
$wpdb->query($update_query); $wpdb->query($update_query);
echo "<script>location.replace('admin.php?page=custodylist&msg=2');</script>"; echo "<script>location.replace('admin.php?page=custodylist&msg=2');</script>";
exit(); exit();
...@@ -116,8 +116,10 @@ if(isset($_GET['err'])){ ...@@ -116,8 +116,10 @@ if(isset($_GET['err'])){
$type_of_account = $print->type_of_account; $type_of_account = $print->type_of_account;
$download_file_name = $print->download_file_name; $download_file_name = $print->download_file_name;
$slug = $print->slug; $slug = $print->slug;
$ordering = $print->ordering; $form_ordering = $print->form_ordering;
$account_ordering = $print->account_ordering;
}?> }?>
<h1 class="wp-heading-inline">Edit Custody Forms</h1>
<table class="form-table"> <table class="form-table">
<form method='post' action='' name='myform' enctype='multipart/form-data'> <form method='post' action='' name='myform' enctype='multipart/form-data'>
<input type="hidden" name="id" id="id" value="<?php echo $id?>"> <input type="hidden" name="id" id="id" value="<?php echo $id?>">
...@@ -162,11 +164,19 @@ if(isset($_GET['err'])){ ...@@ -162,11 +164,19 @@ if(isset($_GET['err'])){
</td> </td>
</tr> </tr>
<tr> <tr>
<th scope="row"><label for="name">Ordering</label></th> <th scope="row"><label for="name">Type of Form Ordering</label></th>
<td> <td>
<input name="ordering" id="ordering" type="number" max="100" min="0" size="10" value="<?php echo $ordering?>" required> <input name="form_ordering" id="form_ordering" type="number" max="100" min="0" size="10" value="<?php echo $form_ordering?>" required>
</td> </td>
</tr> </tr>
<tr>
<th scope="row"><label for="name">Type of Account Ordering</label></th>
<td>
<input name="account_ordering" id="account_ordering" type="number" max="100" min="0" size="10" value="<?php echo $account_ordering?>" required>
</td>
</tr>
<tr> <tr>
<td>&nbsp;</td> <td>&nbsp;</td>
<td><input type='submit' class='button button-primary' name='but_submit' value='Update'></td> <td><input type='submit' class='button button-primary' name='but_submit' value='Update'></td>
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* Template Name: Forms Custody Icici * Template Name: Forms Custody Icici
*/ */
get_header(); get_header();
$new_result = $wpdb->get_results("SELECT * FROM mr_custody_icici_forms WHERE status =1 order by ordering"); $new_result = $wpdb->get_results("SELECT * FROM mr_custody_icici_forms WHERE status =1 order by form_ordering,account_ordering");
?> ?>
<div id="full-content" class="about-page"> <div id="full-content" class="about-page">
<?php if(have_posts()) : ?><?php while(have_posts()) : the_post(); ?> <?php if(have_posts()) : ?><?php while(have_posts()) : the_post(); ?>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment