PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Wed Oct 18, 2017 8:43 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Mon Oct 03, 2016 8:26 pm 
Offline
Forum Newbie

Joined: Thu Feb 05, 2015 3:34 pm
Posts: 21
Hi All,

Appreciate help with the below issue......I am trying to display the employee details & giving option to update the records also, everything is working fine but Joining Date display/changes are fine but records are not getting updated.

Please find the code below........
Syntax: [ Download ] [ Hide ]
                <form id="personal_info" name="personal_info" method="post" action="javascript&#058;void(0);" enctype="multipart/form-data">
        <input type="hidden" name="update_id" value="{$sm.res.id_employee}" id="upd_id">
                <table border="0" width="95%" class="mrgtp0" align="center">
                                        <td>Date of Birth:</td>
                        <td align="left">
                            <span class="detail">{if $sm.res.dob eq '0000-00-00'}NA{else}{$sm.res.dob|date_format:'%d-%m-%Y'}{/if}</span>
                            <span class="edit_detail">
                                <input type="text" name="dob" value="{if $sm.res.dob eq '0000-00-00'}{else}{$sm.res.dob|date_format:'%d-%m-%Y'}{/if}" id="dob" class="text"/>
                            </span>
                        </td>
                    </tr>
                                        <tr>
                        <td>Joining Date:</td>
                        <td align="left">
                            <span class="detail">{if $sm.res.joined_date eq '0000-00-00'}NA{else}{$sm.res.joined_date|date_format:'%d-%m-%Y'}{/if}</span>
                            <span class="edit_detail">
                                <input type="text" name="joined_date" value="{if $sm.res.joined_date eq '0000-00-00'}{else}{$sm.res.joined_date|date_format:'%d-%m-%Y'}{/if}" id="joined_date" class="text"/>                                          
                            </span>
                        </td>
                    </tr>
                                       
                                        <span class="detail">
                                <input type="button" name="edit" value="Edit" onclick="editDetail();" class="login_btn">
                            </span>
                            <span class="edit_detail">
                                <input type="button" name="save" value="Save" onclick="saveEmployee();" class="login_btn">        
                                                        </span>
                </table>
                 </form>
                 
                 <script type="text/javascript">
                 function saveEmployee(){      
                        var res = personalInfo();
                        cShowActivity('1');
                        document.personal_info.action="##LBL_SITE_URL##index.php/employee/updateEmployee";
                        if(res){               
                                document.personal_info.submit();
                        }else{
                                var res = personalInfo();
                        }
                        }
                </script>


Appreciate the help in resolving the above issue.

Thanks,
Nick


Top
 Profile  
 
PostPosted: Mon Oct 03, 2016 11:50 pm 
Offline
Spammer :|
User avatar

Joined: Wed Oct 15, 2008 2:35 am
Posts: 6573
Location: WA, USA
None of this actually does any saving. It's just a form. If the changes are not saving then you have to look at the place that actually does the saving - that's whatever code "index.php/employee/updateEmployee" corresponds to.


Top
 Profile  
 
PostPosted: Tue Oct 04, 2016 3:04 pm 
Offline
Forum Newbie

Joined: Thu Feb 05, 2015 3:34 pm
Posts: 21
Hi,

You are right but that I checked earlier only but couldn't identify the issue as in root no employee folder exist where I am getting confusing.....

Anyhow I resolved the issue but really thanks for looking into my issue & your help to resolve the problem is highly appreciated.

Thanks,
Nick


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group