示例#1
0
     $inquiry_info = $objInquiries->GetInfoByID($inq_id);
     $is_active = isset($inquiry_info['is_active']) ? $inquiry_info['is_active'] : 0;
     $add_mode = $is_active && !empty($customer_id) && !$customer_replies ? true : false;
     if ($add_mode) {
         $action = 'add';
         $objInquiriesReplies->SetActions(array('add' => $add_mode));
     }
 }
 if ($action == 'add') {
     $mode = 'add';
 } else {
     if ($action == 'create') {
         if ($objInquiriesReplies->AddRecord()) {
             $msg = draw_success_message(_ADDING_OPERATION_COMPLETED, false);
             // refresh the class
             $objInquiriesReplies = new InquiriesReplies($inq_id, $objLogin->GetLoggedID());
             $mode = 'view';
         } else {
             $msg = draw_important_message($objInquiriesReplies->error, false);
             $mode = 'add';
         }
     } else {
         if ($action == 'edit') {
             $mode = 'edit';
         } else {
             if ($action == 'update') {
                 if ($objInquiriesReplies->UpdateRecord($rid)) {
                     $msg = draw_success_message(_UPDATING_OPERATION_COMPLETED, false);
                     $mode = 'view';
                 } else {
                     $msg = draw_important_message($objInquiriesReplies->error, false);
示例#2
0
* @author ApPHP <*****@*****.**>
* @license http://www.gnu.org/licenses/
*/
// *** Make sure the file isn't accessed directly
defined('APPHP_EXEC') or die('Restricted Access');
//--------------------------------------------------------------------------
if ($objLogin->IsLoggedInAsAdmin() && Modules::IsModuleInstalled('inquiries')) {
    $action = MicroGrid::GetParameter('action');
    $rid = MicroGrid::GetParameter('rid');
    $mode = 'view';
    $msg = '';
    $inq_id = isset($_GET['inq_id']) ? (int) $_GET['inq_id'] : '0';
    $objInquiries = Inquiries::Instance();
    $inquiry_info = $objInquiries->GetInfoByID($inq_id);
    if (count($inquiry_info) > 0) {
        $objInquiriesReplies = new InquiriesReplies($inq_id);
        if ($action == 'add') {
            $mode = 'view';
        } else {
            if ($action == 'create') {
                $mode = 'view';
            } else {
                if ($action == 'edit') {
                    $mode = 'edit';
                } else {
                    if ($action == 'update') {
                        if ($objInquiriesReplies->UpdateRecord($rid)) {
                            $msg = draw_success_message(_UPDATING_OPERATION_COMPLETED, false);
                            $mode = 'view';
                        } else {
                            $msg = draw_important_message($objInquiriesReplies->error, false);