[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: edit_module.php
<?php include 'header.php';?> <style> .col-md-3,.col-md-2,.col-md-6{ display:inline-block !important; } </style> <div class="main-panel"> <div class="content"> <div class="container-fluid"> <div class="row"> <div class="col-md-12"> <div class="card"> <div class="card-header"> <div class="card-title">Edit Module</div> </div> <form method="post" id="exampleValidation" data-toggle="validator" enctype="multipart/form-data" > <?php $count=1; $sr='project'; //$stmt =$show->readwithdata($sr,'status','Project Confirmed'); $s1="select * from project left join module on project.project_id=module.mproject_id where module.id='".$_REQUEST['pid']."'";//echo $s1; $stmt=$con->prepare($s1); $stmt->execute(); $num = $stmt->rowCount(); if($num>0){ $count=1; while ($row = $stmt->fetch(PDO::FETCH_ASSOC)){ extract($row); $id=$row['id']; ?> <a href="show_module.php?pid=<?=$row['mproject_id']?>" class="btn btn-xs btn-info">All Module</a><hr> <div class="card-body"> <div class="form-group form-show-validation row"> <div class="col-lg-3 col-md-12 col-sm-12" id="direct" style="display:"> <label>Project Type</label> <input type="text" value="<?=$row['project_type']?>" class="form-control" placeholder="Project Name" readonly> </div> <div class="col-lg-6 col-md-12 col-sm-12" id="agent" style=""> <label>Project Title </label> <input type="text" value="<?=$row['title']?>" class="form-control" placeholder="Project Name" readonly> </div> </div> <div class="form-group form-show-validation row"> <div class="col-lg-3 col-md-12 col-sm-12" id="direct" style="display:"> <label>Customer Details</label> <input type="text" value="<?=$row['customer_name']?> | <?=$row['customer_phone']?>" class="form-control" placeholder="Project Name" readonly> </div> <div class="col-lg-6 col-md-12 col-sm-12" id="agent" style=""> <label>Project Cost </label> <input type="text" value="<?=$row['final_cost']?>" class="form-control" placeholder="Project Name" readonly> </div> </div> <div class="form-group form-show-validation row"> <label for="name" class="col-lg-2 col-md-3 col-sm-4 mt-sm-2 ">Module Title </label> <div class="col-lg-10 col-md-12 col-sm-12"> <input type="text" name="mtitle" value="<?=$row['mtitle']?>" class="form-control" placeholder="Module Title" required> </div> </div> <div class="form-group form-show-validation row"> <label for="name" class="col-lg-1 col-md-3 col-sm-4 mt-sm-2 ">Start Date <span class="required-label">*</span></label> <div class="col-lg-3 col-md-12 col-sm-12"> <input type="date" name="mstart_date" value="<?=date('Y-m-d',strtotime($row['mstart_date']))?>" class="form-control" placeholder="Proposed Cost" required> </div> <label for="name" class="col-lg-1 col-md-3 col-sm-4 mt-sm-2 ">End Date <span class="required-label">*</span></label> <div class="col-lg-3 col-md-12 col-sm-12"> <input type="date" name="mend_date" value="<?=date('Y-m-d',strtotime($row['mend_date']))?>" class="form-control" placeholder="Proposed Cost" required> </div> </div> <div class="form-group form-show-validation row"> <label for="name" class="col-lg-2 col-md-3 col-sm-4 mt-sm-2 ">Description </label> <div class="col-lg-10 col-md-12 col-sm-12"> <textarea name="mdescription" class="form-control" placeholder="Country"><?=$row['mdescription']?></textarea> </div> </div> <div class="form-group form-show-validation row"> <label for="name" class="col-lg-2 col-md-3 col-sm-4 mt-sm-2 ">Modules Status </label> <div class="col-lg-10 col-md-12 col-sm-12"> <td> <script> $(document).ready(function(){ $('#status<?=$count;?>').change(function(){ var trend=$('#status<?=$count;?>').val(); var id=$('#id<?=$count;?>').val(); //alert(trend); $.ajax({ type: "POST", url: "ajax_check.php", // Name of the php files data: "status="+trend+"&id="+id, async: false, global: false, success: function(result) { window.location.reload(); } }); }); }); </script> <?php $interests = array('Started','Completed'); ?> <select name="mstatus" class="form-control" id="status<?=$count;?>"> <?php foreach( $interests as $interest ): ?> <option value="<?php echo $interest ?>"<?php if( $interest==$row['mstatus']): ?> selected="selected"<?php endif; ?>><?php echo $interest ?></option> <?php endforeach; ?> </select> <input type="hidden" id="id<?=$count?>" value="<?=$row['id']?>" > </td> </div> </div> <div class="card-action"> <div class="row"> <div class="col-md-12"> <input class="btn btn-success" type="submit" name="sub" value="Edit"> <a href="all_project_confirmed.php" class="btn btn-info">Back</a> </div> </div> </div> </div> <?php } } ?> </form> <?php if(isset($_POST['sub'])){ $allowed = ["mtitle","mdescription","mamount","mstatus"]; $params = []; $setStr = ""; foreach ($allowed as $key) { if (isset($_POST[$key]) && $key != "uid") { $setStr .= "`$key` = :$key,"; $params[$key] = htmlspecialchars($_POST[$key]); } } $setStr .= "`mstart_date` = :mstart_date,`mend_date` = :mend_date"; $setStr = rtrim($setStr, ","); $params['id'] =$_REQUEST['pid']; $params['mstart_date'] =date('Y-m-d',strtotime($_POST['mstart_date'])); $params['mend_date'] =date('Y-m-d',strtotime($_POST['mend_date'])); $params['id'] =$_REQUEST['pid']; $show->table ='module'; $show->cols =$setStr; $show->id_name ='id'; $show->params =$params; //print_r($params); if($show->update_all()){ echo '<script> setTimeout(function() { swal({ title: "Thank You ", text: "for Updating!", type: "success" }, function() { window.location = "'.$_SERVER['REQUEST_URI'].'"; }); }, 1000); </script>'; } else{ echo "ss"; } }?> </div> </div> </div> </div> </div> <?php include 'footer.php'; ?>
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: server05.hostinghome.co.in
Server IP: 192.168.74.40
PHP Version: 7.4.33
Server Software: Apache
System: Linux server05.hostinghome.co.in 3.10.0-962.3.2.lve1.5.81.el7.x86_64 #1 SMP Wed May 31 10:36:47 UTC 2023 x86_64
HDD Total: 1.95 TB
HDD Free: 677.74 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Disabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes
gcc:
Yes
pkexec:
No
git:
Yes
User Info
Username: itsweb
User ID (UID): 1619
Group ID (GID): 1621
Script Owner UID: 1619
Current Dir Owner: 1619