D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
shubmkcj
/
designpitara.com
/
admin
/
services
/
Filename :
update-services.php
back
Copy
<?php include("../include/config.php"); include("../include/sessionhandle.php"); include("../include/header.php"); $ser_id = $_GET['id']; $sqlAssign1 = "SELECT * FROM `services_show_on_home_page` ;"; $resultAssign1 = mysqli_query($conn, $sqlAssign1); if (mysqli_num_rows($resultAssign1) > 0) { while($rows = mysqli_fetch_assoc($resultAssign1)) { $s_no_services = $rows['no_services']; } } $sqlAssignx = "SELECT * FROM `services` WHERE `services`.`id` = '$ser_id';"; $resultAssignx = mysqli_query($conn, $sqlAssignx); if (mysqli_num_rows($resultAssignx) > 0) { while($rowx = mysqli_fetch_assoc($resultAssignx)) { $s_id = $rowx['id']; $s_name = $rowx['name']; $s_detail = $rowx['detail']; $s_image = $rowx['image']; $s_keyword = $rowx['keyword']; $s_description = $rowx['description']; $s_show_On_home_page = $rowx['show_On_home_page']; $custom_url = $rowx['custom_url']; $meta_title = $rowx['meta_title']; $faqQuestion = $rowx['faqQuestion']; $faqAanswer = $rowx['faqAanswer']; $faq_question = explode("--",$faqQuestion); $faq_answer = explode("--",$faqAanswer); $farrlength = count($faq_question); } } ?> <style> #my_services ul li:nth-child(2) { background-color: #eb6a4e; } #my_services ul li:nth-child(2) a { color: #fff; } #my_services ul li:nth-child(2) a:hover { background-color: #eb6a4e; } </style> <script> window.onload = function() { document.getElementById('my_services').classList.add("active"); document.getElementById('my_services1').classList.add("in"); }; </script> <div class="small-header"> <div class="hpanel"> <div class="panel-body"> <div id="hbreadcrumb" class="pull-right"> <ol class="hbreadcrumb breadcrumb"> <li><a href="<?php echo $admin_baseurl . 'dashboard.php';?>">Dashboard</a></li> <li class="active"> <span>Services</span> </li> </ol> </div> <h2 class="font-light m-b-xs"> Update Services </h2> </div> </div> </div> <div class="content"> <div class="hpanel"> <div class="hpanel"> <div class="panel-heading hbuilt"> <div class="panel-tools"> <a class="showhide"><i class="fa fa-chevron-up"></i></a> <a class="fullscreen"><i class="fa fa-expand"></i></a> </div> Update Services </div> <div class="panel-body"> <form method="post" action="execute.php" class="form-horizontal" enctype="multipart/form-data"> <div class="row"> <div class="form-group col-md-6"> <!-- <div class="col-md-6">--> <label>Services</label> <input name="services_name" class="form-control" placeholder="eg. service name..." value="<?php echo $s_name;?>"> <!-- </div>--> </div> <div class="form-group"> <div class="col-md-6"> <?php $sqlAssignSers = "SELECT COUNT(`id`) AS total FROM `services` WHERE `show_On_home_page` = '1'"; $resultAssignsers = mysqli_query($conn, $sqlAssignSers); //$qresult = mysqli_query($this->conn, $query); $rowes = mysqli_fetch_assoc($resultAssignsers); $count_rows = $rowes['total']; echo "show : " .$s_show_On_home_page; ?> <label>Do You Show On Home Page<span style="color:red;"> (Only Select <?php echo intval($s_no_services);?> Services)</span></label> <div class="form-control" style="padding: 0 !important; border:none;background-color: transparent;"> <label class="radio-inline"> <input type="radio" name="optradio" value="1" <?php if($count_rows>=intval($s_no_services)){ echo 'disabled '; } if($s_show_On_home_page == '1'){ echo 'checked';}?>> Yes </label> <label class="radio-inline"> <input type="radio" name="optradio" value="0" <?php if($count_rows>=intval($s_no_services)){ echo ''; } if($s_show_On_home_page == ''){ echo 'checked';}?>> No </label> <small class="text-white bg-primary"> <?php echo 'Now you have Selected <b>'. $count_rows . ' Services.</b>'; $sqlAssign12 = "SELECT * FROM `services` WHERE `show_On_home_page` = '1'"; $resultAssign12 = mysqli_query($conn, $sqlAssign12); if (mysqli_num_rows($resultAssign12) > 0) { $i=1; echo ' ('; while($rowAssign12 = mysqli_fetch_assoc($resultAssign12)) { $ser_name = $rowAssign12['name']; echo $ser_name . ', '; } echo ')'; } ?> <label></label> </small> </div> </div> </div> <div class="form-group col-md-12"> <label>Custom url</label> <input name="custom_url" class="form-control" placeholder="eg. service custom url..." value="<?php echo $custom_url;?>"> </div> <div class="form-group col-md-12"> <label>Services Detail</label> <textarea style="height:200px;" class="textarea form-control" id="upservice_details" name="service_detail" placeholder="Enter text ..." rows="15" data-height="100"><?php echo $s_detail;?></textarea> </div> <div class="form-group col-md-7"> <input type="file" id="file" class="form-control" name="image_a" multiple="multiple" accept="image/*"> </div> <div class="col-md-5"> <img src="<?php echo $admin_baseurl . 'services/upload/'. $s_image;?>" style="width:100px;"> </div> <div class="form-group col-md-12"> <label>Meta Title</label> <input name="meta_title" class="form-control" placeholder="eg.Meta title... " value="<?php echo $meta_title;?>"> </div> <div class="form-group col-md-12"> <label>Seo Keywords</label> <input name="keyword" class="form-control" placeholder="eg.Meta Keyword... " value="<?php echo $s_keyword;?>"> </div> <div class="form-group col-md-12"> <label>Meta Description</label> <input name="description" class="form-control" placeholder="eg.Meta Description .." value="<?php echo $s_description;?>"> </div> <hr> <div class="form-group col-md-12 text-center bg-info"> <p style="font-weight:600; padding:10px 0 2px">FAQ's Section <i class="fa fa-arrow-down" aria-hidden="true"></i></p> </div> <div class="form-group col-md-12 faqfield_wrapper"> <?php for($y = 0; $y < $farrlength; $y++){ $fq = $faq_question[$y]; $fans = $faq_answer[$y]; ?> <div class="text-center" class="removalbe_div"> <div class="text-center"><a href="javascript:void(0);" style="margin-bottom:10px;" class="faqremove_button btn btn-danger text-center">Remove field for FAQ </a> <div class="form-group col-md-12"> <label style="font-weight:700;float: left;">FAQ's Question</label> <input name="faqQuest[]" class="form-control" placeholder="FAQ's Question .." value="<?php echo $fq; ?>"> </div> <div class="form-group col-md-12"> <label style="font-weight:700;float: left;">FAQ's Answer</label> <input type="text" value="<?php echo trim($fans); ?>" name="faqAns[]" class="form-control"> <!-- <textarea class="textarea form-control" name="faqAns[]" placeholder="FAQ's Answer..." rows="2"> <?php echo trim($fans); ?></textarea>--> </div> </div> </div> <?php }?> </div> <div class="form-group col-md-12 text-center"> <a href="javascript:void(0);" class="faqadd_button btn btn-info" title="Add field"> Add More FAQ's (<span style="color:#ffb606;" id="FaqCount"></span>)</a> </div> <div class="form-group col-md-12 text-right"> <input type="hidden" name="service_id" value="<?php echo $s_id;?>"> <input type="hidden" name="service_images" value="<?php echo $s_image;?>"> <button type="submit" name="update-services" class="btn btn-primary">Submit</button> </div> </div> </form> </div> </div> </div> </div> <script> $(function() { CKEDITOR.replace('upservice_details', { height: 350, filebrowserUploadUrl: "<?php echo $admin_baseurl . 'services/ckupload.php'; ?>", filebrowserUploadMethod: 'form' }); }); </script> <script type="text/javascript"> $(document).ready(function() { // var faqx = 1; faqx = parseInt('<?php echo $farrlength;?>'); // alert(faqx); $('#FaqCount').text(faqx); var faqmaxField = 10; //Input fields increment limitation var faqaddButton = $('.faqadd_button'); //Add button selector var faqwrapper = $('.faqfield_wrapper'); //Input field wrapper var faqfieldHTML = '<div class="text-center" class="removalbe_div"><a href="javascript:void(0);" style="margin-bottom:10px;" class="faqremove_button btn btn-danger text-center">Remove field for FAQ </a><div class="form-group col-md-12"><label style="font-weight:700;float:left;">FAQs Question</label><input name="faqQuest[]" class="form-control" placeholder="FAQs Question .."></div><div class="form-group col-md-12"><label style="font-weight:700;float:left;">FAQs Answer</label><textarea class="textarea form-control" name="faqAns[]" placeholder="FAQs Answer..." rows="2"></textarea></div></div>'; //New input field html //Once add button is clicked $(faqaddButton).click(function() { //Check maximum number of input fields if (faqx < faqmaxField) { faqx++; //Increment field counter $(faqwrapper).append(faqfieldHTML); //Add field html $('#FaqCount').text(faqx); } if (faqx == 10) { alert("Reached maximum attempts count."); } }); //Once remove button is clicked $(faqwrapper).on('click', '.faqremove_button', function(e) { e.preventDefault(); $(this).parent('div').remove(); faqx--; //Decrement field counter $('#FaqCount').text(faqx); }); }); </script> <br> <?php include('../include/footer.php'); ?>