lt;/div gt;
lt;! - /.modal-content - gt;
lt;/div gt;
lt;! - /.modal-dialog - gt;
lt;/div gt;
lt;! - /.modal - gt;
lt;/div gt;
lt; script gt; edit_pupil ($ this)
{
$ ( # id_ ). val ($ ($ this) .parent (). children ( .id ). val ());
$(laquo;#name_raquo;).val($($this).parent().parent()ildren(laquo;.nameraquo;).text());
$(laquo;#surname_raquo;).val($($this).parent().parent()ildren(laquo;.surnameraquo;).text());
$(laquo;#lastname_raquo;).val($($this).parent().parent()ildren(laquo;.lastnameraquo;).text());
$(laquo;#birthday_raquo;).val($($this).parent().parent()ildren(laquo;.birthdayraquo;).text());
$(laquo;#adress_raquo;).val($($this).parent().parent()ildren(laquo;.adressraquo;).text());
$(laquo;#mather_raquo;).val($($this).parent().parent().find(laquo;.matherraquo;).text());
$(laquo;#father_raquo;).val($($this).parent().parent().find(laquo;.fatherraquo;).text());
}
//send_change ()
{
$ id=$ ( # id_ ). val ();
$ name=$ ( # name_ ). val ();
$ surname=$ ( # surname_ ). val ();
$ lastname=$ ( # lastname_ ). val ();
$ birthday=$ ( # birthday_ ). val ();
$ adress=$ ( # adress_ ). val ();
$ mather=$ ( # mather_ ). val ();
$ father=$ ( # father_ ). val ();
$. post ( lt;?=URL. ajax_admin/save_pupil laquo ;;? gt; raquo ;, { id raquo ;: $ id, name raquo ;: $ name, surname raquo ;: $ surname, lastname raquo ;: $ lastname, birthday raquo ;: $ birthday, adress raquo ;: $ adress, mather raquo ;: $ mather, father raquo ;: $ father}, function (data) {($ ( # id_ ). val ()!=- 1)
{
$ tr=$ ( # pupil_ + $ id);
$ trildren ( .name ). text ($ name);
$ trildren ( .surname ). text ($ surname);
$ trildren ( .lastname ). text ($ lastname);
$ trildren ( .birthday ). text ();
$ trildren ( .adress ). text ();
$ tr.find ( .mather ). text ();
$ tr.find ( .father ). text ();
} else if ($ .isNumeric (data)) {
$ ( # subjects_cont ). append (
$ ( lt; tr id= pupil_ + $ id + gt; +
' lt; td gt;
' lt; td gt;
' lt; td gt;
' lt; td gt;
' lt; td gt;
lt; td gt; +
' lt; span gt;
' lt; span gt;
lt;/td gt; +
lt; td width= 200 gt; +
' lt; input type= hidden gt;
' lt; button type= button gt;
' lt; button type= button gt;
' lt; button type= button gt;
lt;/td gt; lt;/tr gt; ));
}
}
);
$ ( # addPupil ). click ();
} clean_form () {
$ ( # id_ ). val (- 1);
$ ( # name_ ). val ( );
$ ( # surname_ ). val ( );
$ ( # lastname_ ). val ( );
$ ( # birthday_ ). val ( );
$ ( # adress_ ). val ( );
$ ( # mather_ ). val ( );
$ ( # father_ ). val ( );
} remove_puple ($ this) {
$ id=$ ($ this) .parent (). children ( .id ). val ();
$. post ( lt;?=URL. ajax_admin/delete_pupil laquo ;;? gt; raquo ;, { id raquo ;: $ id}, function (data) {
$ ( # teacher_ + $ id) .remove ();
});
}
$ (document) .ready (function () {
$ ( # table ). tablesorter ({: {
: {: false
}
}
});
});
lt;/script gt;
Файл: search.p...